diff --git a/CMakeLists.txt b/CMakeLists.txt index 70d1e4e..05dcf70 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,11 @@ project(synumpy VERSION 1.9.7 LANGUAGES CXX) include(GNUInstallDirs) +# Automatically export symbols on Windows when building a shared library +if(WIN32 AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + option(SYNUMPY_BUILD_EXAMPLE "Build the example executable" ON) add_library(synumpy synumpy.cpp) diff --git a/example.cpp b/example.cpp index 178ca35..bdbd2d1 100644 --- a/example.cpp +++ b/example.cpp @@ -58,7 +58,7 @@ void printShape(const syNumpy::NpyArray& array) { std::cout << array.shape()[i]; } std::cout << ")\n"; -} // namespace +} template void printValues(const std::vector& values, const char* label) { @@ -69,7 +69,7 @@ void printValues(const std::vector& values, const char* label) { std::cout << "\n"; } -} +} // namespace int main() { try {