By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,996 Members | 896 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,996 IT Pros & Developers. It's quick & easy.

Using managed extensions with C++ - link problems

P: n/a
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
Mar 19 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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==?= <an******@newsgroups.nospam>
Subject: Using managed extensions with C++ - link problems
Date: Sun, 19 Mar 2006 04:22:28 -0800
Lines: 20
Message-ID: <E8**********************************@microsoft.co m>
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) usingVisual 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 worksand 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 Studio2003 - everything links fine.

Any ideas why this happens?

Best wishes,

Andreas


Mar 20 '06 #2

P: n/a
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"" wrote:
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==?= <an******@newsgroups.nospam>
Subject: Using managed extensions with C++ - link problems
Date: Sun, 19 Mar 2006 04:22:28 -0800
Lines: 20
Message-ID: <E8**********************************@microsoft.co m>
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


Mar 26 '06 #3

P: n/a
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==?= <an******@newsgroups.nospam>
References: <E8**********************************@microsoft.co m> <52**************@TK2MSFTNGXA03.phx.gbl>Subject: RE: Using managed extensions with C++ - link problems
Date: Sun, 26 Mar 2006 14:48:44 -0800
Lines: 81
Message-ID: <18**********************************@microsoft.co m>
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"" wrote:
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==?= <an******@newsgroups.nospam>
>Subject: Using managed extensions with C++ - link problems
>Date: Sun, 19 Mar 2006 04:22:28 -0800
>Lines: 20
>Message-ID: <E8**********************************@microsoft.co m>
>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
>



Mar 27 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.