Closed 3628800 closed 3 years ago
Thank you for your comment.
I'm afraid that I'm not the developer of macrodefinition.h. Another developer added this file as a pull request to improve the usability. So, WORLD_API is not used in the source code in the main algorithm as you suggested. The users can use the test program without these definitions and also use them if needed.
Ok. If you think it would be useful to others, I could create a pull request to that effect; otherwise, we could close this.
Hi, I am trying to link libWorld.dylib into another project and get linker errors such as the following:
The project links successfully when I add WORLD_API in front of declarations in the header files, eg:
I compiled libWorld.dylib with WORLD_SRC and WORLD_LIBRARIES_EXPORTS defined, as suggested in macrodefinitions.h. ~~ Disclaimer: my project -does- link when I compile libWorld.dylib with the CMakeLists.txt provided in the World repo; however, that seems to dump all symbols into the global namespace: ie, from
nm libWorld.dylib
I get:where probably only
_InitializeDioOption
etc are meant to be exported... I also wanted more control over the build parameters, and wanted to create an exported CMake target for my project to use, so I was using my own CMakeLists.txt; hence the link errors. I usually prefer to compile withCXX_VISIBILITY_PRESET hidden
and explicitly mark in the source code all symbols that are meant to be part of the public interface; it looked like the infrastructure for that was already in macrodefinitions.h, but I didn't actually see WORLD_API being used anywhere--is it intentionally unused? Thanks