Undefined reference to vtable

The GCC FAQ has an entry on it: The solution is to ensure that all virtual methods that are not pure are defined. Note that a destructor must be defined even if it is declared pure-virtual [class.dtor]/7. Therefore, you need to provide a definition for the virtual destructor:

make: g++: Command not found

You need to install the development tools from GNU. I assume you’re on windows, in which case you have two options: cygwin and mingw. The former includes g++ out of the box. I’m less familiar with mingw, but the C++ Standard library appears to, also, be available. See these installation instructions, I’d recommend starting from step 1, if at all possible.

Undefined reference to vtable

So, I’ve figured out the issue and it was a combination of bad logic and not being totally familiar with the automake/autotools world. I was adding the correct files to my Makefile.am template, but I wasn’t sure which step in our build process actually created the makefile itself. So, I was compiling with an old … Read more

How does #include work in C++?

It is basically a header file that also includes every standard library and STL include file. The only purpose I can see for it would be for testing and education. Se e.g. GCC 4.8.0 /bits/stdc++.h source. Using it would include a lot of unnecessary stuff and increases compilation time. Edit: As Neil says, it’s an implementation for … Read more

C++ undefined reference to defined function

The declaration and definition of insertLike are different In your header file: void insertLike(const char sentence[], const int lengthTo, const int length, const char writeTo[]); In your ‘function file’: void insertLike(const char sentence[], const int lengthTo, const int length,char writeTo[]); C++ allows function overloading, where you can have multiple functions/methods with the same name, as long as they … Read more

What is the difference between g++ and gcc?

gcc and g++ are compiler-drivers of the GNU Compiler Collection (which was once upon a time just the GNU C Compiler). Even though they automatically determine which backends (cc1 cc1plus …) to call depending on the file-type, unless overridden with -x language, they have some differences. The probably most important difference in their defaults is … Read more