473,385 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

link issues with web services

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
Nov 17 '05 #1
2 953
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/)
Nov 17 '05 #2
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/)
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Derek | last post by:
As I understand it there is a good amount of link compatibility among C compilers. For example, I can compile main.c with GCC and func.c with Sun One and link the objects using either linker (GNU...
0
by: Ken North | last post by:
Microsoft's Dan Rogers will be one of the panel members in an important discussion of Web services security. On August 10, the San Diego Software Industry Council (SDSIC) is sponsoring a panel...
3
by: Michael Hoehne | last post by:
Hi, I'm currently facing a problem with a mixed environment using .NET 1.1 and ..NET 2.0 web services. We have a client application (the "client", system 1) running on .NET 2.0/WinXP, calling...
3
by: Jason | last post by:
Hi, I built a vb.Net application that creates ICS calendar files dynamically and then sends them to the client browser as a downloadable file. Works perfectly except in the following situation....
4
by: musosdev | last post by:
Hi I need to extend the contents of the src element of the <link relcss tags in the <headsection of my masterpage. From code, how can I access the <link elements within the <head? Cheers
8
by: Bern McCarty | last post by:
We have a large mixed dll that I can never seem to get to link incrementally. Below is the console output. For simplicity I've eliminated some stuff that we normally do when we really link this...
7
by: =?Utf-8?B?c3VwcG9ydGRldg==?= | last post by:
Hi, Is it possible in visual studio 2005 at design time to link a control on Form 1 to another control on Form 2. Regards Charles Mifsud Shireburn Software Ltd.
4
by: Charles Zhang | last post by:
I have a windows form created in C#, there is web link inside it. I would like the default browser being launched if the link is clicked on. Does anyone know the easiest way to do so? Thanks ...
1
by: djcronos | last post by:
Hi all, I'm using an open source template from oswd.org and I wanted to change the color of one of the links to make it stand out from the others. Here's the CSS code: .nav3-grid...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.