0

I have two C++ projects which each form a library to be referenced by a third project all as part of a Visual Studio solution.

The two libraries were written by someone else who also provided his own VS solution which included a project which acts as a demo for some of the library functions. I have successfully gotten these to compile and run. I am trying to develop a Windows application using Windows Forms which will make use of the libraries. Upon including the two necessary headers,

#include "corelib.h"
#include "corbit.h"

and trying to build the code, I receive 2 link errors:

SatTrack_v0.1.obj : error LNK2028: unresolved token (0A000010) "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __clrcall Zeptomoby::OrbitTools::cGeo::ToString(void)const " (?ToString@cGeo@OrbitTools@Zeptomoby@@$$FUBM?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "void __clrcall `dynamic initializer for 'const Zeptomoby::OrbitTools::cGeo::`vftable'''(void)" (???__E??_7cGeo@OrbitTools@Zeptomoby@@6B@@@YMXXZ@?A0xc222cabd@@$$FYMXXZ)

SatTrack_v0.1.obj : error LNK2019: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __clrcall Zeptomoby::OrbitTools::cGeo::ToString(void)const " (?ToString@cGeo@OrbitTools@Zeptomoby@@$$FUBM?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "void __clrcall `dynamic initializerfor 'const Zeptomoby::OrbitTools::cGeo::`vftable'''(void)" (???__E??_7cGeo@OrbitTools@Zeptomoby@@6B@@@YMXXZ@?A0xc222cabd@@$$FYMXXZ)

C:\Users\Satellite Tracking\Software\SatTrack_v0.1\Win32\(Configuration)\SatTrack_v0.1.exe : fatal error LNK1120: 2 unresolved externals

I've read through What is an undefined reference/unresolved external symbol error and how do I fix it? and I thought I linked the necessary libraries. I've gone to the project Properties | Framework and References and added the libraries. I've also added the Additional Include Directories under Properties | Configuration Properties | C/C++ | General. Also, under Linker | General I've included the proper location in Additional Library Directories and I think I have the proper Additional Dependencies under Linker | Input. In general, I've gone through many of the project properties and tried to match them to the property settings of the working demo project, but the linker problem remains.

Am I simply still missing a link somewhere or is the problem more complicated than that? Because I do have the the demo solution compiling, is there a better way to take the link settings than manually going through all of them and trying to match those which are appropriate? I've been stuck on this problem for a couple days and can't figure out what I'm missing. Where should I go from here?

Community
  • 1
  • 1
EP_Guy
  • 95
  • 7
  • did you include ? – 4pie0 May 13 '13 at 01:39
  • Besides the two header files mentioned above, I also included ``, ``, and `"Form1.h"` for my Windows Form. – EP_Guy May 13 '13 at 02:11
  • Have you looked at the file that it's referring to? It looks to me that a function `ToString()` that was referenced in another function, "the dynamic initializer" for "vftable" is what is unresolved. Sorry if that's pointing out the obvious. – ChiefTwoPencils May 13 '13 at 02:34

0 Answers0