I have trouble with my C++ project which I created and compiled successfully within Visual Studio 2013 on a Windows machine. Currently I'm migrating the source to Unix platforms (my issue had been confirmed on Mac and CentOs). My project depends on the OpenMP (multithread support) library. Hence Apples LLVM compiler (version 6.0) does not support OpenMp sufficiently I decided to compile my project using g++-5
.
After handling some syntax errors when moving from windows compiler to GNU's gcc/g++ (Homebrew gcc 5.2.0) I'm experiencing the following issue in the linking process:
The linker can not find symbols for my architecture and lists nearly every class/object which is created and included by me - what's curious, it does not list every of my classes/object.
I'm compiling with this command:
g++-5 myProject.cpp -o myProject -fopenmp -std=c++11 -L/usr/local/lib -I/usr/local/Cellar/libiomp/20150701/include/libiomp -Wall
Am I missing something stupid in my compiler call? Whats the reason for my linker issues? As mentioned above, the same issue occurs on Mac and CentOs too.
EDIT (according to some comments): According to this question I've activated all warning flags and the compiler is definitely happy with my code. But the linker is saying the following:
Undefined symbols for architecture x86_64:
"FileHelper::createFileName[abi:cxx11](char const*, char const*)", referenced from:
_main in ccZAvFqT.o
"Statistics::writeStats(char const*)", referenced from:
_main in ccZAvFqT.o
"Statistics::newSimulationRun()", referenced from:
_main in ccZAvFqT.o
"Statistics::newSimulationIteration()", referenced from:
_main in ccZAvFqT.o
"Statistics::Instance()", referenced from:
_main in ccZAvFqT.o
"Statistics::writeAvg()", referenced from:
_main in ccZAvFqT.o
"Statistics::~Statistics()", referenced from:
_main in ccZAvFqT.o
"GraphHelper::Graph::writeGraph(std::vector<IPeer*, std::allocator<IPeer*> >*, std::vector<Connection*, std::allocator<Connection*> >*)", referenced from:
[...] and so on and so on...