grame-cncm / guidolib

Guido project - music score layout engine - music description language
http://guido.grame.fr
Mozilla Public License 2.0
152 stars 34 forks source link

Symbol visibility issues on Windows #166

Open benthevining opened 1 year ago

benthevining commented 1 year ago

Compiling with CMake on Windows, with this in the CMakeLists.txt:

set (STATICLIB yes)

add_subdirectory (guidolib)

add_executable (myApp)

target_link_libraries (myApp PRIVATE SGUIDOEngine64)

It compiles fine but I get a bunch of undefined symbol errors during linking.

If I manually edit the GUIDOExport.h file to contain:

#define class_export class
#define GUIDOAPI

then the last remaining linker error is a missing symbol from Msimg32.lib -- I also needed to manually link my app to Msimg32.lib.

dfober commented 1 year ago

I assume that your target is your own application, isn't it? In this case, make sure that GUIDOExport is not defined.

benthevining commented 1 year ago

My target is not defining GUIDOExport. Using just the minimal CMake file above, you should be able to reproduce this issue.