This is wrong:
g++ -c src/CNumber.cpp src/CNumber.h -o src/CNumber.o
You shouldn’t “compile” .h files. Doing so will create precompiled header files, which are not used to create an executable. The above should simply be
g++ -c src/CNumber.cpp -o src/CNumber.o
Similar for compiling the other .cpp files
Related Posts:
- gcc makefile error: “No rule to make target …”
- gcc makefile error: “No rule to make target …”
- How does #include
work in C++? - What is the difference between gcc/g++ and cc1/cc1plus?
- File format not recognized; treating as linker script using GCC
- What is the difference between g++ and gcc?
- Undefined reference to vtable
- How do I install gcc on cygwin?
- what is stack smashing (C)?
- Undefined reference to vtable
- libpthread.so.0: error adding symbols: DSO missing from command line
- fatal error: Python.h: No such file or directory
- Fatal error: iostream: No such file or directory in compiling C program using GCC
- How do I force make/GCC to show me the commands?
- Compiling a C++ program with gcc
- Visual C++ find line causing “Debug Assertion failed”
- gcc/g++: “No such file or directory”
- error: use of deleted function
- (.text+0x20): undefined reference to `main’ and undefined reference to function
- Interpreting valgrind error Invalid write of size 4
- ‘strcmp’ was not declared in this scope
- Compiling a .C file: Undefined symbols for architecture x86_64
- gcc error : undefined reference to `itoa’
- How to repair warning: missing braces around initializer?
- Update GCC on OSX
- gcc error: wrong ELF class: ELFCLASS64
- How do I compile the asm generated by GCC?
- make -j 8 g++: internal compiler error: Killed (program cc1plus)
- C Unknown type name ‘my_structure’
- Make Error 127 when running trying to compile code
- Gcc error: gcc: error trying to exec ‘cc1’: execvp: No such file or directory
- gcc 4.8 on MAC OS X 10.8 throws “Undefined symbols for architecture x86_64: “
- Fatal error: iostream: No such file or directory in compiling C program using GCC
- Make / gcc cryptic error 2: how to have more information?
- Linker error: “linker input file unused because linking not done”, undefined reference to a function in that file
- What is the difference between gmake and make?
- I don’t understand -Wl,-rpath -Wl,
- Compiler gcc:error; no such file or directory
- Differences between arm64 and aarch64
- g++ ld: symbol(s) not found for architecture x86_64
- C++ undefined reference to defined function
- What is a build tool?
- How to make a SIMPLE C++ Makefile
- What are the differences between make clean, make clobber, make distclean, make mrproper and make realclean?
- Error – Android resource linking failed (AAPT2 27.0.3 Daemon #0)
- Error – Android resource linking failed (AAPT2 27.0.3 Daemon #0)
- Expected initializer before function name
- Inheriting constructors
- Inheriting constructors
- How to install “make” in ubuntu?
- Still getting warning : Configuration ‘compile’ is obsolete and has been replaced with ‘implementation’
- gcc: error: unrecognized command line option
- “g++” is not recognized as an internal or external command, MinGW
- undefined reference to ‘std::cout’
- how to “execute” make file
- Gradle does not find tools.jar
- Undefined reference to class constructor, including .cpp file fixes
- node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ‘;’ expected error after installation of Angular 6
- Makefile:2: *** missing separator. Stop
- Eclipse C++ : “Program “g++” not found in PATH”
- What is the “Illegal Instruction: 4” error and why does “-mmacosx-version-min=10.x” fix it?
- How do I enable C++11 in gcc?
- error: This is probably not a problem with npm. There is likely additional logging output above
- Undefined reference to constructor
- Installing GCC on macOS Catalina
- Make error: missing separator
- difference between
and - What are Makefile.am and Makefile.in?
- extra qualification error in C++
- Compiling C++ on remote Linux machine – “clock skew detected” warning
- Warning/error “function declaration isn’t a prototype”
- Error: initializer element is not computable at load time
- com.android.ide.common.process.ProcessException: Failed to execute aapt! What can I do?
- warning: initializer element is not computable at load time
- Debug vs Release in CMake
- Removing trailing newline character from fgets() input
- gcc: undefined reference to
- Why do I get “cast from pointer to integer of different size” error?
- C++ compile time error: expected identifier before numeric constant
- I get this error: “glibc detected”
- What does this GCC error “… relocation truncated to fit…” mean?
- Undefined reference to class constructor, including .cpp file fixes
- C++ Not Installed In Cygwin
- Undefined reference to main – collect2: ld returned 1 exit status
- How do I include a path to libraries in g++
- GCC -fPIC option
- error: unknown type name ‘bool’
- Where is the
header file on Linux? Why can’t I find ? - What’s the opposite of ‘make install’, i.e. how do you uninstall a library in Linux?
- Warning : overflow in implicit constant conversion
- Maven build Compilation error : Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Maven
- How to install g++ in Cygwin?
- How to Check the Version of my gcc?
- How to get a shell environment variable in a makefile?
- Telling gcc directly to link a library statically
- Compiling C++11 with g++
- Makefile on Cygwin
- How to compile C program on command line using MinGW?
- Link error “undefined reference to `__gxx_personality_v0′” and g++ [duplicate]
- What does “all” stand for in a makefile?