Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-06-30
10
Medium Priority
?
1,206 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

670 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