I'm making a code in C++ that should use a library that is called Concorde to solve a well known problem called Traveling Salesman Problem. This library is available here
http://www.math.uwaterloo.ca/tsp/concorde/downloads/downloads.htm
I've compiled (in Ubuntu 13.10) by first running
./configure --with-cplex=<CPLEX_DIR> and then
make resulting in two main files concorde.a and concorde.h. In this way concorde is configure to run and use IBM Cplex as the exact solver.
I'm using Code::Blocks as IDE and in the build options I've added the library (concorde.a) under Link libraries and included the header in my code.
However when I try to compile my code in Code::Blocks IDE, it gives me and error indicating that it can't find the implementation of the concorde functions that I call and that are defined in the concorde.h file. In this case the error is "undefined reference to <function>".
Can anyone help me with that?
The last part of the build log of codeblocks is the following:
1 2 3 4 5 6 7
|
g++ -L/opt/ibm/ILOG/CPLEX_Studio1251/cplex/lib/x86-64_sles10_4.1/static_pic
-L/opt/ibm/ILOG/CPLEX_Studio1251/concert/lib/x86-64_sles10_4.1/static_pic
-L/opt/concorde -o bin/Debug/SVRPDSP obj/Debug/instance.o obj/Debug/lib/combo.o
obj/Debug/lib/IncumbentCallback2C.o obj/Debug/lib/lazyCallback2C.o
obj/Debug/lib/lazyCallbackGLS.o obj/Debug/lib/lib_algorithms.o
obj/Debug/lib/lib_general.o obj/Debug/solution.o -lrt -lilocplex -lcplex
-lconcert -lm -lpthread /opt/concorde/concorde.a
|
ps: I tried to change the name of concorde.a file to libconcorde.a, then only link the library as
-lconcert instead of linking to
/opt/concorde/concorde.a, but the result is the same