Answer the question
In order to leave comments, you need to log in
CLion: program cannot be started, missing dll; How to decide?
I'm trying to write a mini-programming line in C++, and I came across a problem with the build. When you start from the IDE, everything is OK, but you can’t run the exe separately , it swears at the lack of libraries.
CMakeLists:
cmake_minimum_required(VERSION 3.6)
project(proxyyy)
set(CMAKE_CXX_STANDARD 11)
set(SOURCE_FILES test.cpp)
add_executable(proxyyy ${SOURCE_FILES})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc")
Answer the question
In order to leave comments, you need to log in
You can include everything explicitly. Read about static assembly.
I don’t know what you are building with, but you can add something like, for gcc: , to the linker flags -static-libstdc++ -static-libgcc
. Perhaps under Windows something else will have to be linked statically. The size of the executable file will increase, of course.
And if you want to achieve results like in CodeBlocks, then just look at what flags this IDE adds to the Makefile and add the same.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question