#include <iostream>using namespace std; struct foo{ void func(); }; void func(){ // Definiert eine freie Funktion foo} int main() { foo f; f.func(); // ruft eine memberfunktion foo auf, die ist aber nicht definiert}
Standard input is empty
/home/gpwXcA/ccFoilXB.o: In function `main': prog.cpp:(.text.startup+0x11): undefined reference to `foo::func()' collect2: error: ld returned 1 exit status
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!