I'm building a small C library, which I'm using in C#. So far everything is working, but as soon as I add std::vector to my code, running it I get the following error:
Unhandled exception. System.DllNotFoundException: Unable to load DLL 'myLib' or one of its dependencies: The specified module could not be found. (0x8007007E)
Removing the vector and import makes it work again. This is my CMakeLists.txt:
cmake_minimum_required(VERSION 3.25)
project(myLib)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -v -static-libgcc -static-libstdc++")
add_subdirectory("portaudio")
add_library(karaokeMicLib SHARED library.cpp PortAudioWrapper.cpp PortAudioWrapper.h)
target_link_libraries(myLib portaudio)
add_dependencies(myLib portaudio)
Setting the flags should make it work from what I can gather, but the dependencies app says that libstdc++-6.dll is missing. I'm also using jetbrains clion. Any help to make the standard library work is greatly appreciated!