-
Notifications
You must be signed in to change notification settings - Fork 13
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
add msvc support and other bugs #38
Comments
I printed the variable: message("Python_LIBRARIES:${Python_LIBRARIES}") so this is where the "optimized"comes from. I guess it should be "release" instead? |
If I directly link my project to python3XX.lib, it works: but now I have to specify the specific path - not an option when collaborating with others. |
Thank you, I will try adding a CI for MSVC so I can check compatibility. |
Thank you a lot! |
According to my research, I need the following change to get it to build with cmake on windows, python 3.13 and MSVC: |
This project is most useful, but lacks generality. It seems its optimized for g++ only. I would like to have microsoft visual studio c++ compiler (msvc) support for it as well. Furthermore, I found some different things that might be a bug.
My build-system: CMake 3.31.0, c++ 20, MSVC 19.41.34123.0.
All references are from commit 4d025b5 of master.
MSVC-Support:
I recommend to change common.h line 9 as follows, as visibility is not supported by msvc
#ifdef _MSC_VER
#define DECL_STRUCT_ATTR
#else
#define DECL_STRUCT_ATTR attribute((visibility("hidden")))
#endif
CMakeLists.txt line 44 gave an error as it said that the word "optimized" is used - seems to be in ${Python3_LIBRARIES}. I tried to exchanged it with this:
target_link_libraries(matplotlibcpp17::matplotlibcpp17 INTERFACE ${Python3_LIBRARIES} pybind11::embed)
But then python3XX.lib is not found during linking. I could not find a solution.
Snippet of my CMakeLists.txt for comparison:
set(pybind11_DIR "path/to/pybind11")
add_subdirectory(ExtLibs/matplotlibcpp17)
target_link_libraries(projectname PRIVATE matplotlibcpp17::matplotlibcpp17)
I would highly appreciate if the author(s) of this repo would check their code for compatibility with msvc and check the issues I had.
The text was updated successfully, but these errors were encountered: