Solved

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

Posted on 2006-06-30
10
1,170 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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 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 viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

617 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