Solved

Log4CPlus Unresolved external - some difference in C++ name mangling(decoration)

Posted on 2006-06-30
10
1,132 Views
Last Modified: 2012-05-05
I have three dlls i try to link with Log4CPlus,
2 of them pass just fine, with the third one i get an unresolved external symbol.
I opened the dll with depends and saw that there is a slight difference with the C++ name decoration.

this is the error i get:
XvidDshowWrapper error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class log4cplus::Logger __stdcall log4cplus::Logger::getRoot(void)" (__imp_?getRoot@Logger@log4cplus@@SG?AV12@XZ) referenced in function "protected: virtual long __thiscall CVideoTransformFilter::Receive(struct IMediaSample *)" (?Receive@CVideoTransformFilter@@MAEJPAUIMediaSample@@@Z)

?getRoot@Logger@log4cplus@@SG?AV12@XZ  : The symbol missing
?getRoot@Logger@log4cplus@@SA?AV12@XZ  : the on exported by the dll

the one thing i thought might be the reason is calling convention.
it's a __thiscall function calling to a __stdcall dll - which sounds problematic
but i'm not sure it's the reason.

any idea?

tnx,
hed
0
Comment
Question by:hed
  • 4
  • 4
10 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 17024134
The calling convention should not matter here - how are you using it? 'getRoot()' is a static member of 'Logger', that should be like

Logger root = Logger::getRoot();

BTW, are you using VC6? This compiler sometimes has problems with constructs like that.
0
 

Author Comment

by:hed
ID: 17024637
indeed something like this:
Logger root = Logger::getRoot();

There is no compilation problem - only linking one. (+ with two other dlls everything is fine)
I'm using visual studio .NET

hed

0
 
LVL 86

Expert Comment

by:jkr
ID: 17024742
Hm, since the symbol names are slightly different - is there a chance that the headers and binaries differ in their versions or that the libs you have are for another compiler version?
0
 

Author Comment

by:hed
ID: 17024760
i compile them both with the same compiler looking on the same headers. (or so i believe)
the difference is in the way the projects are configured
some compiler configuration that is different between the two projects.

this is what i'm searching for: which compiler configuration.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 86

Expert Comment

by:jkr
ID: 17024816
Well, post the compiler options...
0
 

Author Comment

by:hed
ID: 17024839
it'll take me time to get to work: (it's 00:30 here)
but i will
0
 
LVL 86

Expert Comment

by:jkr
ID: 17024885
OK, take you time ;o)

Does not have to be today.
0
 

Author Comment

by:hed
ID: 17027404
ok,
it helped me to talk to someone - so tnx jkr
it was actually the calling convention - once i made them use both the same one
the symbols got identical.

I thought i tried it before i posted here - appearantly not too hard.
tnx.
points?
0
 

Accepted Solution

by:
CetusMOD earned 0 total points
ID: 17258161
PAQed with points refunded (125)

CetusMOD
Community Support Moderator
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now