Skip to content
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

Symbol visibility issues on Windows #166

Open
benthevining opened this issue Nov 13, 2022 · 2 comments
Open

Symbol visibility issues on Windows #166

benthevining opened this issue Nov 13, 2022 · 2 comments

Comments

@benthevining
Copy link

benthevining commented Nov 13, 2022

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
Copy link
Member

dfober commented Nov 13, 2022

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

@benthevining
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants