libstdc++-6.dll is missing
已回答
I have just downloaded CLion and tried to test it. My code runs without any errors.
I would like to execute the test.exe file without CLion. So I build it with Strg+F9 and then I find the test.exe file in: C:\Users\name\CLionProjects\opl\cmake-build-debug
The problem is if I execute that file, I will get an error from Windows that the file libstdc++-6.dll is missing. What am I doing wrong?
请先登录再写评论。
If you are using MingW to compile C++ code on Windows, you may like to add the options
-static-libgcc
and-static-libstdc++
to link the C and C++ standard libraries statically and thus remove the need to carry around any separate copies of those. Version management of libraries is a pain in Windows.Thank you for your answer. How exactly do I add -static-libgcc and -static-libstdc++? Sorry, I am very new to this.
You can add them to `CMAKE_<LANG>_FLAGS` (See e.g here https://ecrafter.wordpress.com/2012/04/24/cmake-tutorial-part-2/) or add `<path_to_mingw>\bin` to the PATH before running binary.
i had the same problem
adding
to the cmakelists fixed it .
For CMake3.X+, use this instead
I added target_link_libraries(your_target_name -static) to cmakelists.txt and now I no longer get the libstdc++-6.dll is missing error when running the .exe (windows 11 console program) but the console program starts up, prompts the first prompt and then dies - process disappears from Windows task manager.
Please help.
Mike Gold sorry for the delay in response. Do you still experience the issue? Is it possible that the program just finishes?
Thanks @... *kiss* *kiss* *muuahh* luv u :3.