473,406 Members | 2,259 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,406 software developers and data experts.

LNK2001 error after conversion fro FX 1.1 to FX 2.0

Hi

I have a C++ interop project, which links fine with VS2003, but after
converting it to VS2005, it compiles everything withour errors/warnugs, but
I get the following linker message.

DBRDMUM.obj : error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ"
(?.cctor@@$$FYMXXZ)

I definitely don't have a method named like this, so it must be some
compiler created symbol, but I really don't know what to look for. Any
hints? Thanks a lot.

Urs
Dec 1 '05 #1
2 4064
"Urs Vogel" <uv****@msn.com> wrote

I have a C++ interop project, which links fine with VS2003, but after
converting it to VS2005, it compiles everything withour errors/warnugs,
but I get the following linker message.

DBRDMUM.obj : error LNK2001: unresolved external symbol
"?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ)

That's the module initializer. (In fact, it's the mangled name for
void __clrcall __identifier(".cctor")(); )
It is like static constructor but not associated with a particular
class. The module initializer is executed, once the assembly is
loaded (It's similar to DllMain)

VC uses it for dynamic initialization. E.g.:

// global scope
int foo();
int i = foo();

i is initialized at load time. The compiler creates a special
function (the dynamic initializer for i). Additionally it will
emit a "/include" linker directive for the module
initializer in the object file and the /DEFAULTLIB for the
managed CRT.

When the linker sees the directive, it includes the module
initializer even if it is not otherwise referenced. It is
defined in the managed CRT.

So what you need is the correct libraries. In VC 8 it is
no longer necessary to use /NOENTRY, /NODEFAULTLIB
(linker) or /Zl (compiler) etc. Just let the tool chain figure it out.

Dumpbin /DIRECTIVES should reveal the implied
linker switches for a given object file.

If that doesn't help can you post linker warnings and
the result of dumpbin /DIRECTIVES along with
the command line switches for the linker and compiler?

-hg

Dec 1 '05 #2
Found it out. Removed /Zl, removed msvcrt.lib from dependecies, removed /noentry. Works now. Your hints brought me on path. Thanks.
"Urs Vogel" <uv****@msn.com> schrieb im Newsbeitrag news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi Holger

Thanks for your hints. Dind't really help me any farther, dumpbin
/Directoves list and build log are in the attachment.

Any tips are appreciated ... Thanks.

"Holger Grund" <ho**********@remove.ix-n.net> schrieb im Newsbeitrag
news:u5**************@TK2MSFTNGP15.phx.gbl...
"Urs Vogel" <uv****@msn.com> wrote

I have a C++ interop project, which links fine with VS2003, but after
converting it to VS2005, it compiles everything withour errors/warnugs,
but I get the following linker message.

DBRDMUM.obj : error LNK2001: unresolved external symbol
"?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ)

That's the module initializer. (In fact, it's the mangled name for
void __clrcall __identifier(".cctor")(); )
It is like static constructor but not associated with a particular
class. The module initializer is executed, once the assembly is
loaded (It's similar to DllMain)

VC uses it for dynamic initialization. E.g.:

// global scope
int foo();
int i = foo();

i is initialized at load time. The compiler creates a special
function (the dynamic initializer for i). Additionally it will
emit a "/include" linker directive for the module
initializer in the object file and the /DEFAULTLIB for the
managed CRT.

When the linker sees the directive, it includes the module
initializer even if it is not otherwise referenced. It is
defined in the managed CRT.

So what you need is the correct libraries. In VC 8 it is
no longer necessary to use /NOENTRY, /NODEFAULTLIB
(linker) or /Zl (compiler) etc. Just let the tool chain figure it out.

Dumpbin /DIRECTIVES should reveal the implied
linker switches for a given object file.

If that doesn't help can you post linker warnings and
the result of dumpbin /DIRECTIVES along with
the command line switches for the linker and compiler?

-hg


Dec 1 '05 #3

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

Similar topics

10
by: Bil Muh | last post by:
Hello Developers, I use VC++ .NET v2003. By using Windows Forms .NET, I am developing an application which will work with TCP/IP functions. I can Build my application in Debug Mode normally, but,...
3
by: We need more power captain | last post by:
Hi, I know less than a noob, I've been asked to do some compiles in VC++ 6 without knowing too much at all. (I'm a COBOL program normally so this is all too much for me) I open VC++6, open...
5
by: eberesche | last post by:
Hello, as a novice in ASN.1 I have me to a project in C ++ under use of ASN.1 - structures risquély. One of my colleagues means, this would deal something with masochism ;-). Result should be a DLL...
2
by: Angus | last post by:
Hello I am using some classes from a third party and have included them in my projecxt and am compiling and linking with them. Everything compiles ok but I get these link errors: I added...
2
by: Maydogg6 | last post by:
I need a hand with some stubborn link errors. I'm trying to recreate and old program from 6.0 into .NET, but for some reason when I try to compile I'm getting linking errors for all my function...
6
by: sadegh | last post by:
Hi I have a problem with my program in VC++6 When I compile it, the following errors are listed. I spend a lot of time on the groups.google.com to find its reason, but none of comments could...
5
by: bonnielym84 | last post by:
Im new here..didnt noe whether is this the rite way to post my problem..Really need help here..i've been stucked in this error from last wk..My problem is like this..Im using VC++ 6.0 to compile my C...
0
by: bonnielym84 | last post by:
Im new here and im not sure whether is this the right place for me to post my question..anyway..hope that you can help me..i have been stucked in this problem since last wk..My problem is..I'm using...
1
by: mahricky | last post by:
i have the following error msg when i buid one of my cpp projects in visual studio 6. pls help me, it's very urgent. extures.obj : error LNK2001: unresolved external symbol "public: __thiscall...
0
by: Ryan Gaffuri | last post by:
hlink72@hotmail.com (Eric) wrote in message news:<ab8d8b14.0308220550.54fb5f22@posting.google.com>... LNK1120 is a standard C++ error. you using Visual C++? Means your references a class that...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.