Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking error c++ with Visual Studio .NET 2003

Status
Not open for further replies.

BAEK

Programmer
May 13, 2005
2
FI
I try to build the Intel CAMshift ColorTracker. This tool uses the so-called fsf-framework. The building output lists A LOT of linking errors.

The first one is copied into this posting. The strange thing is that using the verbose build output there is the message, that the external symbols were found while searching the library files (see below).

-------------------------------------------
[...]
Searching C:\Documents and Settings\hajohoff\My Documents\camshift etc\fsfdbg_0.7\FsfDbg\Debug\FsfDbg.lib:
Found "public: virtual bool __thiscall fsf::CActiveFilter<class fsf::CNode>::TestType(class fsf::CNode *)"

(?TestType@?$CActiveFilter@VCNode@fsf@@@fsf@@UAE_NPAVCNode@2@@Z)
Referenced in ColorTracking.obj
Referenced in ColorTrackingModule.obj
Referenced in DshLiveInputModule.obj
Loaded FsfDbg.lib(FsfDbg.dll)

[...]

ColorTracking.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall

fsf::CActiveFilter<class fsf::CTypeNode<struct CvBox2D> >::TestType(class fsf::CNode *)"

(?TestType@?$CActiveFilter@V?$CTypeNode@UCvBox2D@@@fsf@@@fsf@@UAE_NPAVCNode@2@@Z)

[...]
------------------------------------------------

I am using VisualStudio .net 2003

Does anybody have an idea what could be the reason for this kind of linking error?

thx for help
 
Possibly a diamond problem where it has picked the wrong virtual function. Try qualifying the call with the class name.
 
thank you for your hint, that might be the problem.

Additionally I figured out that all the symbols the linker couldn't find are pointing to templates. Is there anything special I have to consider regarding template classes? I'm quite new with c++ thus I don't now anything about templates :-(
 
If the template classes are included in a static library which is then included by a dynamic library, make sure they only occur in one dynamic library otherwise the linker will moan about multiple declarations.

The other very common problem is inline declarations. If you get multiple definition problems, just shift the whole lot into code and don't bother with inlining unless there is a major performance problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top