Originally posted by: Laci Ladanyi
On linux the order in which you list the libraries to be linked with matters. The linker goes from left to right, examining every library trying to find symbols that it has already encountered but have not yet been defined. You have the order as " -lstdc++ -lcplex -lilocplex -lconcert -lcp -lcplexdistmip -lm -lpthread", and end up with a number of undefined symbols. Let's pick one, say, CPXLgetpnorms. In this case libcplex.a does define CPXLgetpnorms, but when -lcplex is encountered CPXLgetpnorms was not yet needed, so it does not get picked up. When later on CPXLgetpnorms is needed by a function in another library it's too late, the linker will not go back. So to find all symbols all you need to do is to properly reorder the libraries. I believe it'd be "-lconcert -lilocplex -lcplexdistmip -lcplex -lm -lpthread -ldl" (as it is in the cplex/examples/x86-64_linux/static_pic/Makefile.distmip). I don't think you need to specify -lstdc++, that will be used automatically by g++ (oh yes, to link a code that uses C++ you should really use g++ and not gcc to make sure everything is picked up correctly).
--Laci
#CPLEXOptimizers#DecisionOptimization