472,789 Members | 1,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Misc linker errors when moving to /clr

A project compiles fine under VS 2005 RC without the /clr
option. However, when /clr is turned on several errors appear:

- A symbol exported from a DLL is not found by another
DLL referencing it.

The name of the symbol present in the DLL, as shown by
depends.exe is ?Apply@ScreenContext@@SGPAV1@PAUHWND__@@@Z

But the name of the symbol the linker looks for when
it tries to build the DLL depending on it is
?Apply@ScreenContext@@$$FSGPAV1@PAUHWND__@@@Z

Strangely enough, the two symbol have exactly the same
undecorated name

- The second error is the following
mfcs80ud.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined
in msvcrtd.lib(dllmain.obj)

http://support.microsoft.com/default...;en-us;q148652
seems to talk about it, but there is no way I could get
to make its workarounds solve the problem (the instructions don't apply
to VS2005). But why would it manifest itself only in /clr mode ?
Any clue is much appreciated !

Cheers,
Ralph

Nov 17 '05 #1
3 3228
I had a similar (maybe the same ?) issue but with VS 2005 Beta 2.
It is described here:
http://lab.msdn.microsoft.com/produc...4-54741ae3f773

Now it also says there this bug is resolved in a later build after Beta
2. Now I am quite shocked that this might not be the case since you are
using VS 2005 RC. However it seems that I found a workaround wich I
reported here:
http://lab.msdn.microsoft.com/Produc...ID=FDBK27870#1

ra************@hotmail.com schrieb:
A project compiles fine under VS 2005 RC without the /clr
option. However, when /clr is turned on several errors appear:

- A symbol exported from a DLL is not found by another
DLL referencing it.

The name of the symbol present in the DLL, as shown by
depends.exe is ?Apply@ScreenContext@@SGPAV1@PAUHWND__@@@Z

But the name of the symbol the linker looks for when
it tries to build the DLL depending on it is
?Apply@ScreenContext@@$$FSGPAV1@PAUHWND__@@@Z

Strangely enough, the two symbol have exactly the same
undecorated name

- The second error is the following
mfcs80ud.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined
in msvcrtd.lib(dllmain.obj)

http://support.microsoft.com/default...;en-us;q148652
seems to talk about it, but there is no way I could get
to make its workarounds solve the problem (the instructions don't apply
to VS2005). But why would it manifest itself only in /clr mode ?
Any clue is much appreciated !

Cheers,
Ralph

Nov 17 '05 #2
Thanks for this, bonk. The workaround did not work for
me but the comments helped me get a version to compile
....in Release Mode. All the issues have disappeared.

So the linker problems seem to apply to Debug Mode only.

For information, in Debug Mode I also had other
unresolved tokens, for symbols that happened to
be #included through header files but actually
not referenced in the code. Putting the linker
in verbose mode revealed that it was looking for
those symbols during a "Search transition" phase.
Thus possibly the linker is trying to resolve more
symbols than required in Debug Mode.

Cheers,
Ralph

bonk wrote:
I had a similar (maybe the same ?) issue but with VS 2005 Beta 2.
It is described here:
http://lab.msdn.microsoft.com/produc...4-54741ae3f773

Now it also says there this bug is resolved in a later build after Beta
2. Now I am quite shocked that this might not be the case since you are
using VS 2005 RC. However it seems that I found a workaround wich I
reported here:
http://lab.msdn.microsoft.com/Produc...ID=FDBK27870#1

ra************@hotmail.com schrieb:
A project compiles fine under VS 2005 RC without the /clr
option. However, when /clr is turned on several errors appear:

- A symbol exported from a DLL is not found by another
DLL referencing it.

The name of the symbol present in the DLL, as shown by
depends.exe is ?Apply@ScreenContext@@SGPAV1@PAUHWND__@@@Z

But the name of the symbol the linker looks for when
it tries to build the DLL depending on it is
?Apply@ScreenContext@@$$FSGPAV1@PAUHWND__@@@Z

Strangely enough, the two symbol have exactly the same
undecorated name

- The second error is the following
mfcs80ud.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined
in msvcrtd.lib(dllmain.obj)

http://support.microsoft.com/default...;en-us;q148652
seems to talk about it, but there is no way I could get
to make its workarounds solve the problem (the instructions don't apply
to VS2005). But why would it manifest itself only in /clr mode ?
Any clue is much appreciated !

Cheers,
Ralph


Nov 17 '05 #3

Ahem, I'd like to recall my previous message, because
the /clr option was not applied to all subprojects in
Release Mode (probably my mistake)...

The issues are the same in Release Mode as in Debug Mode.

Cheers,
Ralph

Nov 17 '05 #4

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

Similar topics

0
by: TGF | last post by:
Hello, I am creating a console app. I try to link a static library by including it in the Linker-Input-Additional Dependencies field under the Project properties. Then I specify the path to...
1
by: Laszlo | last post by:
Hi all, As a novice I installed PostgreSQL 7.2.1 on Win32 and works, Borland C++Builder Enterprise Suite 5.0 (build 12.34) what works too. I decided to combine these two programs and develop a...
0
by: Tom McDermott | last post by:
I am having linker errors : error LNK2022: metadata operation failed (80131188) : Inconsistent field declarations in duplicated types This code linked sucessfully in C++.NET 2002, but does...
4
by: Saran | last post by:
Hi All, I'm getting the following linker error when I try to build a library. nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv nafxcw.lib(appcore.obj) : error...
3
by: ac2806 | last post by:
Hi I want to use the static MFC within a dll, but I get the following errors when linking: nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv nafxcwd.lib(appcore.obj)...
3
by: Chucker | last post by:
Hi Folks, I got a Wrapper Dll around a native C++ static library. In .NET 1.1 this worked fine. When moving to .NET 2.0 I get a couple of unresolved externals / linker errors: Error 16 error...
0
by: VivekR | last post by:
I have a MFC application developed using VC++ 5. Recently I ported that to VC++ 7.1 and now I am trying to compile the MFC application with /CLR under VC++ 7.1. And I get linker errors referring to...
5
by: Mark | last post by:
Sorry for creating such a newbish topic, but I just can't seem to figure out what the problem is here. // main.cpp #include <cstdlib> #include <iostream> #include "Vector.h" using namespace...
2
by: Markus Dehmann | last post by:
What to do if an external library is header-files-only (but you have to use it), and you get lots of linker errors? You will necessarily get linker errors "multiple definition of ..." if you try...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.