Link to home
Start Free TrialLog in
Avatar of Xtreem
XtreemFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Linker errors LNK2019/LNK1561 (entry points) building custom wrapper (CRCW) code using C++ interop to use COM API DLL

I have implemented the code on this MSDN page in Visual Studio 2003:
http://msdn2.microsoft.com/library/f31k2c87.aspx

It was created from the 'Add New Project' dialogue using 'Visual C++ Projects>>Empty Project (.NET)', which is an empty project that uses managed extensions for C++.

It compiles but I get a linker error:
error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup

...which I solved using the Accepted Answer from https://www.experts-exchange.com/questions/21452684/Linker-error-LNK2019-unresolved-external-symbol-main-referenced-in-function-mainCRTStartup.html, namely http://support.microsoft.com/?id=814472.

However, now I'm getting:
fatal error LNK1561: entry point must be defined

Judging from the Accepted Answer in https://www.experts-exchange.com/questions/21452684/Linker-error-LNK2019-unresolved-external-symbol-main-referenced-in-function-mainCRTStartup.html, it would seem that the problem is due to including comdef.h as the Accepted Answer suggests using managed Math class rather than unmanaged math.h for that Question's particular problem, as opposed to the solution described in http://support.microsoft.com/?id=814472

I seem to be almost there, but still got one or two small obstacles yet to overcome. Any ideas?
Avatar of Xtreem
Xtreem
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

I resolved this problem myself. It's purely a matter of creating a 'Class Library (.NET)' project as opposed to an 'Empty Project (.NET)' project (in Visual C++) then following the steps described in http://support.microsoft.com/?id=814472 to sort out the linker problems I got from including comdef.h and #import'ing my COM DLL.

This problem was consequential of another problem described in this Question:
https://www.experts-exchange.com/questions/21527418/Problems-compiling-custom-wrapper-CRCW-code-using-C-interop.html

...which was resolved there by an Expert.

This Question shall now be requested to be closed.
ASKER CERTIFIED SOLUTION
Avatar of CetusMOD
CetusMOD
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial