link issues with web services

D

Doug Bailey

I have found a linker problem in .NET2003 when trying to build a web
service.

To replicate the problem, simply build a new web service project
FILE->NEW->PRROJECT… command.

In the "Hello World" web service example add the following 2 lines:

char test[20];
sprintf(test, "test");

In addition add:
#include <stdio.h>

at the top of the CPP file so it can compile.

When I build the service I get the following error:

testxxClass.obj : error LNK2001: unresolved external symbol "int
__cdecl sprintf(char *,char const *,...)" (?sprintf@@$$J0YAHPADPBDZZ)

When I add LIBCMTD.LIB to the library references and build the
project, the error changes to:

LIBCMTD.LIB(crt0.obj) : error LNK2019: unresolved external symbol
_main referenced in function _mainCRTStartup

Does anybody have any ideas?

I am currently migrating some legacy code into my application and
prefer not having to rewrite many of the handling functions to get
around these library reference errors.

Thanks
Doug Bailey
 
G

Guest

Not sure if anyone ever replied to you directly. And, it has been a while since you posted so you're probably ok by now. But I ran into the same issue - along with almost everyone else mixing managed and unmanaged code involving a C runtime library.

Anyway. The following MS KB article helped get my situtation resolved. Basically you need to start up the runtime library manually due to DLL loading issues which prevents it happening automatically.

See:
http://support.microsoft.com/?id=814472

Hope that helps,
R


I have found a linker problem in .NET2003 when trying to build a web
service.

To replicate the problem, simply build a new web service project
FILE->NEW->PRROJECT… command.

In the "Hello World" web service example add the following 2 lines:

char test[20];
sprintf(test, "test");

In addition add:
#include <stdio.h>

at the top of the CPP file so it can compile.

When I build the service I get the following error:

testxxClass.obj : error LNK2001: unresolved external symbol "int
__cdecl sprintf(char *,char const *,...)" (?sprintf@@$$J0YAHPADPBDZZ)

When I add LIBCMTD.LIB to the library references and build the
project, the error changes to:

LIBCMTD.LIB(crt0.obj) : error LNK2019: unresolved external symbol
_main referenced in function _mainCRTStartup

Does anybody have any ideas?

I am currently migrating some legacy code into my application and
prefer not having to rewrite many of the handling functions to get
around these library reference errors.

Thanks
Doug Bailey

User submitted from AEWNET (http://www.aewnet.com/)
 
G

Guest

Not sure if anyone ever replied to you directly. And, it has been a while since you posted so you're probably ok by now. But I ran into the same issue - along with almost everyone else mixing managed and unmanaged code involving a C runtime library.

Anyway. The following MS KB article helped get my situtation resolved. Basically you need to start up the runtime library manually due to DLL loading issues which prevents it happening automatically.

See:
http://support.microsoft.com/?id=814472

Hope that helps,
R


I have found a linker problem in .NET2003 when trying to build a web
service.

To replicate the problem, simply build a new web service project
FILE->NEW->PRROJECT… command.

In the "Hello World" web service example add the following 2 lines:

char test[20];
sprintf(test, "test");

In addition add:
#include <stdio.h>

at the top of the CPP file so it can compile.

When I build the service I get the following error:

testxxClass.obj : error LNK2001: unresolved external symbol "int
__cdecl sprintf(char *,char const *,...)" (?sprintf@@$$J0YAHPADPBDZZ)

When I add LIBCMTD.LIB to the library references and build the
project, the error changes to:

LIBCMTD.LIB(crt0.obj) : error LNK2019: unresolved external symbol
_main referenced in function _mainCRTStartup

Does anybody have any ideas?

I am currently migrating some legacy code into my application and
prefer not having to rewrite many of the handling functions to get
around these library reference errors.

Thanks
Doug Bailey

User submitted from AEWNET (http://www.aewnet.com/)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top