Abnormal unresolved external symbol error - c++

I have a project that used to compile just fine, using the freetype library.
Since then my OS has been reinstalled and therefore so has Visual Studio 2010.
I have re-included and reinstalled all of the .lib .dll and header files. For some reason now if I run the program with the release configuration it runs just fine. But if I switch over to the debug config, it gives me unresolved external symbol errors from the linker, on the freetype library functions.
Now I'm sure my C++ directories for both configurations are identical as I re-set them using the all-configurations tab in the solution settings. As well as this, so are both configurations "additional directories/additional dependancies settings", set identically in the same way.
The only difference I could find between the release and debug folders in the project folder, is the presence of a file in the debug folder called "vc100.idb", which is a minimum rebuild dependancy file. This looked promising, but removing it yielded no results, so I put it back.
Do you have any ideas of what could be causing this difference between the configurations compiling?
Worst come to worst, I can continue programming on the release config, but I'd rather not continue down this road as I'd really like to know the root of this problem.
Thanks in advance,
Guy
The errors:
1>freetype.obj : error LNK2019: unresolved external symbol _FT_Glyph_To_Bitmap referenced in function "void __cdecl freetype::make_dlist(struct FT_FaceRec_ *,char,unsigned int,unsigned int *)" (?make_dlist#freetype##YAXPAUFT_FaceRec_##DIPAI#Z)
1>freetype.obj : error LNK2019: unresolved external symbol _FT_Get_Glyph referenced in function "void __cdecl freetype::make_dlist(struct FT_FaceRec_ *,char,unsigned int,unsigned int *)" (?make_dlist#freetype##YAXPAUFT_FaceRec_##DIPAI#Z)
1>freetype.obj : error LNK2019: unresolved external symbol _FT_Load_Glyph referenced in function "void __cdecl freetype::make_dlist(struct FT_FaceRec_ *,char,unsigned int,unsigned int *)" (?make_dlist#freetype##YAXPAUFT_FaceRec_##DIPAI#Z)
1>freetype.obj : error LNK2019: unresolved external symbol _FT_Get_Char_Index referenced in function "void __cdecl freetype::make_dlist(struct FT_FaceRec_ *,char,unsigned int,unsigned int *)" (?make_dlist#freetype##YAXPAUFT_FaceRec_##DIPAI#Z)
1>freetype.obj : error LNK2019: unresolved external symbol _FT_Done_FreeType referenced in function "public: void __thiscall freetype::font_data::init(char const *,unsigned int)" (?init#font_data#freetype##QAEXPBDI#Z)
1>freetype.obj : error LNK2019: unresolved external symbol _FT_Done_Face referenced in function "public: void __thiscall freetype::font_data::init(char const *,unsigned int)" (?init#font_data#freetype##QAEXPBDI#Z)
1>freetype.obj : error LNK2019: unresolved external symbol _FT_Set_Char_Size referenced in function "public: void __thiscall freetype::font_data::init(char const *,unsigned int)" (?init#font_data#freetype##QAEXPBDI#Z)
1>freetype.obj : error LNK2019: unresolved external symbol _FT_New_Face referenced in function "public: void __thiscall freetype::font_data::init(char const *,unsigned int)" (?init#font_data#freetype##QAEXPBDI#Z)
1>freetype.obj : error LNK2019: unresolved external symbol _FT_Init_FreeType referenced in function "public: void __thiscall freetype::font_data::init(char const *,unsigned int)" (?init#font_data#freetype##QAEXPBDI#Z)
Edit: OK well this is strange. I've removed ALL of the freetype directory information rom the include and library directory setting in the release config, as well as the additional dependancies. And the released config version still works!
This is leading me to believe there is something missing (vs config-wise) from moving my files over.

I had the same problem.
I solved it by compiling the freetype( freetype-2.5.2\builds\windows\vc2010\freetype.sln ) solution for the x64 platform (or win32 if you use it).
You will get the .libs for this platform.

Related

Unable to link QtFFmpegWrapper sample on Win7 with VS 2012

I am trying to incorporate QtFFmpegWrapper in my program, but both my program and the provided sample won't link with ffmpeg:
QVideoEncoder.obj:-1: Error: LNK2019: unresolved external symbol _avcodec_init referenced in function "protected: bool __thiscall QVideoEncoder::initCodec(void)" (?initCodec#QVideoEncoder##IAE_NXZ)
QVideoDecoder.obj:-1: Error: LNK2001: unresolved external symbol _avcodec_init
QVideoEncoder.obj:-1: Error: LNK2019: unresolved external symbol _avcodec_thread_init referenced in function "public: bool __thiscall QVideoEncoder::createFile(class QString,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int)" (?createFile#QVideoEncoder##QAE_NVQString##IIIII#Z)
QVideoEncoder.obj:-1: Error: LNK2019: unresolved external symbol _avcodec_open referenced in function "public: bool __thiscall QVideoEncoder::createFile(class QString,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int)" (?createFile#QVideoEncoder##QAE_NVQString##IIIII#Z)
and 10 or so more like these ...
Why do these pop up when linking ? The libs are all there and found, it just seems like the linker has issues with them ...
I use the following setup for my project:
Latest QtFFmpegWrapper from https://code.google.com/p/qtffmpegwrapper/
qt-opensource-windows-x86-msvc2012_opengl-5.3.0
Visual Studio 2012 Professional
Qt Creator 3.1.2
ffmpeg builds from http://ffmpeg.zeranoe.com/builds/:
ffmpeg-20140717-git-fa6716c-win32-dev
ffmpeg-20140717-git-fa6716c-win32-shared
Everything is 32Bit.

WinPCap setup giving "unresolved external symbol" linker errors

I'm working with a project made professionally by someone else, so the code should be bug-free. The problems I'm having with it is most likely to do with the project configurations.
The project I'm trying to compile has C and C++ source files kept within the following folders, all within the project directory: Hardware, Header Files, Source Files, TCP/IP, uTasker and WinSim. When I attempt to compile, it returns the following build log:
1>------ Build started: Project: uTasker, Configuration: Debug Win32 ------
1>LPC17XX.obj : error LNK2019: unresolved external symbol _fnOpenDefaultHostAdapter referenced in function _fnConfigEthernet
1>WinSim.obj : error LNK2001: unresolved external symbol _iWinPcapSending
1>WinSim.obj : error LNK2019: unresolved external symbol _fnWinPcapSendPkt referenced in function _fnSimulateEthTx
1>WinSimMain.obj : error LNK2019: unresolved external symbol "void __cdecl fnDoEthereal(int,char *)" (?fnDoEthereal##YAXHPAD#Z) referenced in function _WinMain#16
1>WinSimMain.obj : error LNK2001: unresolved external symbol "int iTxActivity" (?iTxActivity##3HA)
1>WinSimMain.obj : error LNK2001: unresolved external symbol "int iRxActivity" (?iRxActivity##3HA)
1>WinSimMain.obj : error LNK2019: unresolved external symbol "void __cdecl fnWinPcapStopLink(struct HWND__ *)" (?fnWinPcapStopLink##YAXPAUHWND__###Z) referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc##YGJPAUHWND__##IIJ#Z)
1>WinSimMain.obj : error LNK2019: unresolved external symbol "void __cdecl fnWinPcapSelectLAN(int)" (?fnWinPcapSelectLAN##YAXH#Z) referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc##YGJPAUHWND__##IIJ#Z)
1>WinSimMain.obj : error LNK2019: unresolved external symbol "void __cdecl fnWinPcapOpenAdapter(void)" (?fnWinPcapOpenAdapter##YAXXZ) referenced in function "long __stdcall SetNIC(struct HWND__ *,unsigned int,unsigned int,long)" (?SetNIC##YGJPAUHWND__##IIJ#Z)
1>WinSimMain.obj : error LNK2019: unresolved external symbol "void __cdecl fnWinPcapClose(void)" (?fnWinPcapClose##YAXXZ) referenced in function "long __stdcall SetNIC(struct HWND__ *,unsigned int,unsigned int,long)" (?SetNIC##YGJPAUHWND__##IIJ#Z)
1>WinSimMain.obj : error LNK2019: unresolved external symbol "int __cdecl fnShowNICs(struct HWND__ *)" (?fnShowNICs##YAHPAUHWND__###Z) referenced in function "long __stdcall SetNIC(struct HWND__ *,unsigned int,unsigned int,long)" (?SetNIC##YGJPAUHWND__##IIJ#Z)
1>.\Debug\uTasker.exe : fatal error LNK1120: 11 unresolved externals
LPC17XX.c is kept within the Hardware/LPC17XX folder.
WinSim.c and WinSimMain.cpp are kept within the WinSim folder.
I'm not sure how to configure my linker to fix these problems, any help would be appreciated.
Edit: I'm using Visual Studio 2010 to build the project.
The documentation on WinPCap is a little out of date from what I've been able to find, but there are some pretty important setup instructions, particularly the pre-processor macros that should be defined to get things properly setup for a good link.
The latest setup docs I could find are here. I hope they help get you going.

How do I solve "unresolved external symbol" errors in a DirectX 11 program?

I am working on a DirectX 11 project for school and I followed the book thoroughly when doing this. I keep thinking that maybe something is labeled wrong but I double checked all my files, all my class names are fine (I believe they are fine) and double checked how all my header files are setup and everything should be okay and I still get this error output:
1>BlankDemo.obj : error LNK2019: unresolved external symbol "public: __thiscall DemoBase::DemoBase(void)" (??0DemoBase##QAE#XZ) referenced in function "public: __thiscall BlankDemo::BlankDemo(void)" (??0BlankDemo##QAE#XZ)
1>BlankDemo.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall DemoBase::~DemoBase(void)" (??1DemoBase##UAE#XZ) referenced in function "public: virtual __thiscall BlankDemo::~BlankDemo(void)" (??1BlankDemo##UAE#XZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall DemoBase::Shutdown(void)" (?Shutdown#DemoBase##QAEXXZ) referenced in function _wWinMain#16
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall DemoBase::Initialize(struct HINSTANCE__ *,struct HWND__ *)" (?Initialize#DemoBase##QAE_NPAUHINSTANCE__##PAUHWND__###Z) referenced in function _wWinMain#16
1>C:\Users\vaughn\documents\visual studio 2010\Projects\BlankWindow\Debug\BlankWindow.exe : fatal error LNK1120: 4 unresolved externals
How do I solve this?
Evidently, you either haven't implemented a handful of methods from the DemoBase class (including its constructor and destructor), or you haven't included the implementation file in the list of files to compile or link with your program. Implement them, and then make sure you've included the source file in your project.

Unresolved external symbols in Visual Studio 2010

I am coming from Xcode, trying to compile a project in Visual Studio 2010, and I get the following errors:
2>ofxCLeye.obj : error LNK2019: unresolved external symbol "struct _GUID __cdecl CLEyeGetCameraUUID(int)" (?CLEyeGetCameraUUID##YA?AU_GUID##H#Z) referenced in function "public: static int __cdecl ofxCLeye::listDevices(void)" (?listDevices#ofxCLeye##SAHXZ)
2>ofxCLeye.obj : error LNK2019: unresolved external symbol "int __cdecl CLEyeGetCameraCount(void)" (?CLEyeGetCameraCount##YAHXZ) referenced in function "public: static int __cdecl ofxCLeye::listDevices(void)" (?listDevices#ofxCLeye##SAHXZ)
2>ofxCLeye.obj : error LNK2019: unresolved external symbol "bool __cdecl CLEyeCameraGetFrameDimensions(void *,int &,int &)" (?CLEyeCameraGetFrameDimensions##YA_NPAXAAH1#Z) referenced in function "public: void __thiscall ofxCLeye::grabFrame(void)" (?grabFrame#ofxCLeye##QAEXXZ)
2>ofxCLeye.obj : error LNK2019: unresolved external symbol "bool __cdecl CLEyeCameraGetFrame(void *,unsigned char *,int)" (?CLEyeCameraGetFrame##YA_NPAXPAEH#Z) referenced in function "public: void __thiscall ofxCLeye::grabFrame(void)" (?grabFrame#ofxCLeye##QAEXXZ)
2>ofxCLeye.obj : error LNK2019: unresolved external symbol "bool __cdecl CLEyeDestroyCamera(void *)" (?CLEyeDestroyCamera##YA_NPAX#Z) referenced in function "public: virtual void __thiscall ofxCLeye::close(void)" (?close#ofxCLeye##UAEXXZ)
2>ofxCLeye.obj : error LNK2019: unresolved external symbol "bool __cdecl CLEyeCameraStop(void *)" (?CLEyeCameraStop##YA_NPAX#Z) referenced in function "public: virtual void __thiscall ofxCLeye::close(void)" (?close#ofxCLeye##UAEXXZ)
... etc etc...
2>bin\clEye_debug.exe : fatal error LNK1120: 10 unresolved externals
I imagine that the compiler is trying to link CLEyeMulticam.lib but not finding it. I think that I have configured it properly.
Could you point me with the needed steps to include a library in VS2010 ?
Thank you,
marc
Apologies if this is overly pedantic. If this is a pre-built library (not built as part of the project/solution) then make sure you
a) #include the correct header
b) #define any requisite macros
c) speciy additional .lib dependencies as shown below.
You will need to specify a fully qualifed path (d:\src\project\libs\camera.lib) unless the libary file is in the LIB environment variable.
In the Property Pages for your project, navigate to Configuration > Linker > Input and add the lib file to the Additional Dependencies setting. This applies to VC++ 2008, probably likewise to 2010.

error LNK2019: unresolved external symbol "public:

I am creating an torrent application using libtorrent in VS 2008. I tried the example given in the link http://www.rasterbar.com/products/libtorrent/examples.html
BUt it is showing me these error....how to solve them?
Linking...
main.obj : error LNK2019: unresolved external symbol "public: __thiscall libtorrent::torrent_info::~torrent_info(void)" (??1torrent_info#libtorrent##QAE#XZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: __thiscall libtorrent::torrent_info::torrent_info(struct libtorrent::lazy_entry const &)" (??0torrent_info#libtorrent##QAE#ABUlazy_entry#1##Z) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "class std::basic_ostream > & __cdecl libtorrent::operator<<(class std::basic_ostream > &,struct libtorrent::lazy_entry const &)" (??6libtorrent##YAAAV?$basic_ostream#DU?$char_traits#D#std###std##AAV12#ABUlazy_entry#0##Z) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "int __cdecl libtorrent::lazy_bdecode(char const *,char const *,struct libtorrent::lazy_entry &,int)" (?lazy_bdecode#libtorrent##YAHPBD0AAUlazy_entry#1#H#Z) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: void __thiscall libtorrent::lazy_entry::clear(void)" (?clear#lazy_entry#libtorrent##QAEXXZ) referenced in function "public: __thiscall libtorrent::lazy_entry::~lazy_entry(void)" (??1lazy_entry#libtorrent##QAE#XZ)
main.obj : error LNK2019: unresolved external symbol "void __cdecl libtorrent::to_hex(char const *,int,char *)" (?to_hex#libtorrent##YAXPBDHPAD#Z) referenced in function "class std::basic_ostream > & __cdecl libtorrent::operator<<(class std::basic_ostream > &,class libtorrent::big_number const &)" (??6libtorrent##YAAAV?$basic_ostream#DU?$char_traits#D#std###std##AAV12#ABVbig_number#0##Z)
main.obj : error LNK2019: unresolved external symbol "public: struct libtorrent::peer_request __thiscall libtorrent::file_storage::map_file(int,__int64,int)const " (?map_file#file_storage#libtorrent##QBE?AUpeer_request#2#H_JH#Z) referenced in function "public: struct libtorrent::peer_request __thiscall libtorrent::torrent_info::map_file(int,__int64,int)const " (?map_file#torrent_info#libtorrent##QBE?AUpeer_request#2#H_JH#Z)
C:\Users\photoshop3\Documents\Visual Studio 2008\Projects\Lib2\Debug\Lib2.exe : fatal error LNK1120: 7 unresolved externals
The .lib is not included in your project. Make sure you are linking it in;
Configuration Properties -> Linker -> Input -> Additional Dependencies
Another altnerative is to simply copy the .lib to your project folder but don't, it's bound to create problems later on.
Sometimes the .lib is not shipped with the library, so you need to compile it yourself.
The README will tell you this. If this is the case, they usually ship with a .sln file you can open and the just compile it into a .lib file which you then reference in your main application, as I wrote above
Have you added the path of header files in the "Configuration Properties" --> "C/C++“ --> "General" --> "Additional Include Directories"?
The link gives you only the sources (including headerfiles) of libtorrent. You should compile this sources to get a .lib file. Add this .lib file to your client:
Configuration Properties/Linker/Input -> Additional Dependencies: libtorrent-rasterbar.lib
The best starting point for compiling should be the README file.
public: isn't the unresolved symbol. It's just there because the linker it trying to tell you that (most) of the unresolved symbols are public member functions.
It looks like you've included the header for "libtorrent", but not linked to the "libtorrent" library.
You have probably not linked with the torrent library or specified the wrong path to it so that the linker cannot find it.
If the input libraries are of 32bit and your are using them in building a 64bit it might be one of the reasons
For me, I had it included in my project, but it turned out that it was a plugin that was designed to not create an instance of in my unit test.