Hello,
I build a library which uses other libraries.
I've encountered a linking error which I could not solve it in a simple manner.
I've downloaded TinyObjLoader which is a only header obj loader.
I've put the header in an api source folder which the project configuration references. (Include section)
Then you have to specifcy #define Tinyobject_Implementation to include the implementation in the header only.
The library build and link goes well, the issue is referencing it from another project.
I have a test project which defines a program.cpp (Main here) and it reference a "ClassRenderer.h" which includes my render object, this file includes the "MeshLoader" which includes the TinyObjLoader header.
The output is "ClassRenderer.obj" and "program.obj". (After compilation)
The issue is in the linker, it tries to link program.obj but fails because functions from tinyobjloader are already defined in ClassRenderer.obj.
So I solved it by making a new project from the tinyobjloader and creating a static library and removing the #define tinyobject_Implementation preprocessor definition.
Now the test project also links against TinyObjectLoader.lib, which I find unnessecery in a header only library.
How can I solve this without using a .lib or .dll file?
I'm using Visual studio 2013 Community edition.
Thanks !