Using managed extensions with C++ - link problems

G

Guest

Hi!

I'm currently developing a DLL that makes use of C++ and .net (mixed) using
Visual Studio 2003.

Now, as I wanted to move to the new Visual Studio 2005, I converted this
project into the new format (compiling with /clr:OldSyntax): everything works
and compiles fine.
Unfortunately, I cannot link to the newly created DLL from any other
application/DLL: LNK2019: unresolved external symbol. I've checked the DLL
generated by 'dumpbin /exports' - the function I try to export is listed.
Another strange thing: When I replace the *.lib file of my DLL created by
Visual Studio 2005 with the correspondant *.lib file created by Visual Studio
2003 - everything links fine.

Any ideas why this happens?

Best wishes,

Andreas
 
T

TerryFei

Hi Andreas,
Welcome to MSDN Newsgroup!

Based on my knowledge, the cause for this problem is the lib and the dll is
mismatched. The lib includes information about the dll. If the lib mismatch
with the dll, the link error will occur.

I hope the above information is helpful for you. Thanks and have a nice day!

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
 
G

Guest

Thanks for replying!

But, the lib file and the DLL are both created by the same compiler/linker
in the same process of compilation/linking...how can they mismatch?

How is it possible that a machting lib file, that was created with VS2003
links correctly?

Thanks,
Andreas

"TerryFei" said:
Hi Andreas,
Welcome to MSDN Newsgroup!

Based on my knowledge, the cause for this problem is the lib and the dll is
mismatched. The lib includes information about the dll. If the lib mismatch
with the dll, the link error will occur.

I hope the above information is helpful for you. Thanks and have a nice day!

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
Thread-Topic: Using managed extensions with C++ - link problems
thread-index: AcZLT8lu50hgdG40Qo6hd2G8mfRsaw==
X-WBNR-Posting-Host: 84.169.242.176
From: =?Utf-8?B?QW5kcmVhcw==?= <[email protected]>
Subject: Using managed extensions with C++ - link problems
Date: Sun, 19 Mar 2006 04:22:28 -0800
Lines: 20
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
Newsgroups: microsoft.public.dotnet.general
Path: TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA03.phx.gbl microsoft.public.dotnet.general:191522
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
X-Tomcat-NG: microsoft.public.dotnet.general

Hi!

I'm currently developing a DLL that makes use of C++ and .net (mixed) using
Visual Studio 2003.

Now, as I wanted to move to the new Visual Studio 2005, I converted this
project into the new format (compiling with /clr:OldSyntax): everything works
and compiles fine.
Unfortunately, I cannot link to the newly created DLL from any other
application/DLL: LNK2019: unresolved external symbol. I've checked the DLL
generated by 'dumpbin /exports' - the function I try to export is listed.
Another strange thing: When I replace the *.lib file of my DLL created by
Visual Studio 2005 with the correspondant *.lib file created by Visual Studio
2003 - everything links fine.

Any ideas why this happens?

Best wishes,

Andreas
 
T

TerryFei

Hi Andreas,
Thanks for your feedback!

Based on my understanding, in most case, lib file created in VS2005
mismatch with one created in VS2003

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
Thread-Topic: Using managed extensions with C++ - link problems
thread-index: AcZRJ29V9x/6gT4gTcqo3htonLD+cA==
X-WBNR-Posting-Host: 84.169.255.47
From: =?Utf-8?B?QW5kcmVhcw==?= <[email protected]>
References: <[email protected]>
Subject: RE: Using managed extensions with C++ - link problems
Date: Sun, 26 Mar 2006 14:48:44 -0800
Lines: 81
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
Newsgroups: microsoft.public.dotnet.general
Path: TK2MSFTNGXA01.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.general:191896
NNTP-Posting-Host: TK2MSFTNGXA01.phx.gbl 10.40.2.250
X-Tomcat-NG: microsoft.public.dotnet.general

Thanks for replying!

But, the lib file and the DLL are both created by the same compiler/linker
in the same process of compilation/linking...how can they mismatch?

How is it possible that a machting lib file, that was created with VS2003
links correctly?

Thanks,
Andreas

"TerryFei" said:
Hi Andreas,
Welcome to MSDN Newsgroup!

Based on my knowledge, the cause for this problem is the lib and the dll is
mismatched. The lib includes information about the dll. If the lib mismatch
with the dll, the link error will occur.

I hope the above information is helpful for you. Thanks and have a nice day!

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
Thread-Topic: Using managed extensions with C++ - link problems
thread-index: AcZLT8lu50hgdG40Qo6hd2G8mfRsaw==
X-WBNR-Posting-Host: 84.169.242.176
From: =?Utf-8?B?QW5kcmVhcw==?= <[email protected]>
Subject: Using managed extensions with C++ - link problems
Date: Sun, 19 Mar 2006 04:22:28 -0800
Lines: 20
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
Newsgroups: microsoft.public.dotnet.general
Path: TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA03.phx.gbl microsoft.public.dotnet.general:191522
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
X-Tomcat-NG: microsoft.public.dotnet.general

Hi!

I'm currently developing a DLL that makes use of C++ and .net (mixed) using
Visual Studio 2003.

Now, as I wanted to move to the new Visual Studio 2005, I converted this
project into the new format (compiling with /clr:OldSyntax): everything works
and compiles fine.
Unfortunately, I cannot link to the newly created DLL from any other
application/DLL: LNK2019: unresolved external symbol. I've checked the DLL
generated by 'dumpbin /exports' - the function I try to export is listed.
Another strange thing: When I replace the *.lib file of my DLL created by
Visual Studio 2005 with the correspondant *.lib file created by Visual Studio
2003 - everything links fine.

Any ideas why this happens?

Best wishes,

Andreas
 

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