-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LNK 2019 error unresolved external symbol #30
Comments
Assuming you haven't built the library already, open the sln file from the download and build each version you require (debug, release etc). Once you have the resulting .lib files follow the linking instructions here: #20 |
I opened the .sln file with visual studio and built the tmxlite project which is part of the tmxlite solution. It only created one .lib file though: 'libtmxlite-s.lib'. Do I need the other file, 'libtmxlite-s-d.lib', to use tmxlite for being able to parse my Tiled map? |
Typically, yes, you would use libtmxlite-s-d.lib in your debug build, although it's not strictly necessary. Use the configuration drop down at the top of visual studio to select 'debug' then rebuild tmxlite to get the debug version. |
So I was able to create the debug .lib file as in your previous instructions. I followed the directions from your #20 link. I made the file path to the include folder "C:\Program Files (x86)\tmxlite\tmxlite\include". For the Linker->General->Additional Library Directories, when I built the tmxlite project, it only created 2 .lib files and each was in a separate folder. "libtmxlite-s.lib" in "C:\Program Files (x86)\tmxlite\tmxlite\bin\ReleaseStatic" and "libtmxlite-s-d.lib" in "C:\Program Files (x86)\tmxlite\tmxlite\bin\DebugStatic". So I chose the ReleaseStatic. And lastly, I chose libtmxlite-s.lib, for Linker->Input->Additional Dependencies. I have attached a snapshot of what happens when I then try to build the SFML example code from the download. I'm sorry to be so much trouble but I really want to make this work. |
OK, still a linker problem, this time it can't find the sfml libs. General rule of thumb with unresolved external errors is to look at the function name after _thiscall and find the library to which it belongs. In this case all the functions start with sf:: - so you just need to link sfml to your project in the same way as tmxlite. There are guides for visual studio on the sfml website. |
Man I finally got it working. So my issue was that I was using the tmxlite static release library, not the debug library. And I also had to run the code in debug mode, not release. I knew something was weird because I had the exact same SFML settings with another project but I wasn't getting the linker errors. Thank you for all of your help |
I am trying to use tmxlite for the first time and I keep getting this error:
LNK2019 unresolved external symbol _mz_inflateInit referenced in function "bool __cdecl tmx::decompress(char const *,class std::vector<unsigned char,class std::allocator > &,int,int)" (?decompress@tmx@@YA_NPBDAAV?$vector@EV?$allocator@E@std@@@std@@hh@Z)
I'm using Visual Studio 2017.
I am using the SFML example from the download:
Can you explain a bit more in detail how to get it up and running with VS Community 2017?
The text was updated successfully, but these errors were encountered: