So I've got the following CMakeLists.txt file to try and build my main.cpp file.
project(shell)
set(extra_flags = -std=c++11 -Werror -Wall -Wextra)
set(CMAKE_CXX_FLAGS $(CMAKE_CXX_FLAGS) $(extra_flags))
add_executable(shell main.cpp)
At this point, I am just trying to build it with a Hello World program just to make sure everything works. But the flags are there for the rest of the program that I need to write. The actual process of calling cmake .
works just fine, but when I use make
I get the following error:
[100%] Building CXX object CMakeFiles/shell.dir/main.cpp.o
c++: fatal error: no input files
compilation terminated.
/bin/sh: 1: -o: not found
CMakeFiles/shell.dir/build.make:54: recipe for target 'CMakeFiles/shell.dir/main.cpp.o' failed
make[2]: *** [CMakeFiles/shell.dir/main.cpp.o] Error 127
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/shell.dir/all' failed
make[1]: *** [CMakeFiles/shell.dir/all] Error 2
Makefile:72: recipe for target 'all' failed
make: *** [all] Error 2
I'm new to Ubuntu and the command line, so any help would be greatly appreciated.