Solved

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

Posted on 2006-06-30
10
1,145 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
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 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.
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.

803 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