Solved

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

Posted on 2006-06-30
10
1,151 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

756 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