Skip to content

Unable to statically link in windows via CMake #1294

Answered by wirepair
wirepair asked this question in Q&A
Discussion options

You must be logged in to vote

I figured out my problem. I was calling libsodium from a library I built as part of the cmake, but that library did not link against libsodium, only the application that was linking to the library did, hence it was unable to find the symbols.

so top level cmake (as listed above) was fine, but in my library src directory i needed to add:

before:
...
target_link_libraries(pmo_library PRIVATE flecs fmt::fmt flatbuffers)
...
after:
...
target_link_libraries(pmo_library PRIVATE sodium flecs fmt::fmt flatbuffers)
...

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by wirepair
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant