undefined reference to tmx::Map::Map() | undefined reference to vtable for tmx::ObjectGroup
#154
-
|
I've used the sln file to build tmxlite into both debug and release modes, as well as tried the cmake compilation, and all three ways have been successful. The issue comes when attempting to use tmxlite in my own project. In both Visual Studio Code(with Makefile) and CLion(with CMake), I can't seem to get linking to work. Maybe I'm not compiling tmxlite correctly, or something isn't right in my CMake and Makefile configurations. Below I've pasted screenshots demonstrating the error in CLion, in VSC when building my library, and again in VSC when building my program, respectively. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Hard to say as I've never really used either. Possibly:
For the last point you could try building tmxlite as a static library, or check here to make sure |
Beta Was this translation helpful? Give feedback.



I can't say I've experienced this personally. It sounds like a mismatch in libstdc++ linked when building the library vs building your project. EG tmxlite was built and linked to a version of libstdc++ which does have it (and then itself uses it) but your project is trying to link to a version of libstdc++ which doesn't have it - and you get the linker error. As libstdc++ is used by gcc/g++ it would probably occur more on linux than windows, simply because gcc is more prevalent there.
First I'd double check all your project settings to make sure you're using consistent linking between projects. Alternatively you might be able to hack around the problem by building with exceptions disabled…