g++ - compiling c++ with external library : lpsolve -


i trying compile program written in c++ using lpsolve external library. have written following line in .cpp :

#include</var/lib/lpsolve/lp_lib.h>

however, when i'm trying compile using g++, weird message :

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/liblpsolve55.so when searching -llpsolve55 /usr/bin/ld: skipping incompatible /usr/lib/../lib/liblpsolve55.so when searching -llpsolve55 /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/5/../../../liblpsolve55.so when searching -llpsolve55 /usr/bin/ld: skipping incompatible //usr/local/lib/liblpsolve55.so when searching -llpsolve55 /usr/bin/ld: skipping incompatible //usr/local/lib/liblpsolve55.a when searching -llpsolve55 /usr/bin/ld: skipping incompatible //usr/lib/liblpsolve55.so when searching -llpsolve55 /usr/bin/ld: cannot find -llpsolve55 /usr/bin/ld: cannot find -lcolamd collect2: error: ld returned 1 exit status  

i tried many different things... tried install library manually, downloading sourceforge taking care of right version (dev-ux64 in case) , seems none of solutions i've found on internet working ...

by way, using following command compile program :

g++ prog.cpp -llpsolve55 -lcolamd -ldl -o myexe 

edit : after specifying path librairies explicitly, :

/tmp/ccivopis.o: in function `main': flot_max.cpp:(.text+0x36): undefined reference `make_lp' flot_max.cpp:(.text+0xd7): undefined reference `set_int' flot_max.cpp:(.text+0x159): undefined reference `set_maxim' flot_max.cpp:(.text+0x16c): undefined reference `set_obj_fn' flot_max.cpp:(.text+0x1d6): undefined reference `add_constraint' flot_max.cpp:(.text+0x240): undefined reference `add_constraint' flot_max.cpp:(.text+0x2aa): undefined reference `add_constraint' flot_max.cpp:(.text+0x314): undefined reference `add_constraint' flot_max.cpp:(.text+0x37e): undefined reference `add_constraint' /tmp/ccivopis.o:flot_max.cpp:(.text+0x3e8): more undefined references `add_constraint' follow /tmp/ccivopis.o: in function `main': flot_max.cpp:(.text+0x6a4): undefined reference `solve' flot_max.cpp:(.text+0x6bd): undefined reference `get_objective' flot_max.cpp:(.text+0x704): undefined reference `get_variables' collect2: error: ld returned 1 exit status 

it looks library isn't loaded every function listed above part of library...


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -