Opened 2 years ago

Last modified 14 months ago

#67 new installation issue

"Undefined reference"-error when compiling example project

Reported by: felixp Owned by: ferreau
Priority: normal Milestone:
Component: C++ core Version: 3.2.1
Keywords: Cc:

Description

When running

 g++ -static example1.cpp ../src/BLASReplacement.cpp ../src/LAPACKReplacement.cpp  -I ../include/ -o statically_linked -L ../bin/ -l qpOASES

in the example folder as stated in https://projects.coin-or.org/qpOASES/ticket/31 I get the following error:

../example1.cpp|66|undefined reference to `qpOASES::QProblem::QProblem(int, int, qpOASES::HessianType, qpOASES::BooleanType)'|

the executable examples that were automatically created when executing make run perfectly, though.

Any suggestions?

Kind regards,
Felix

Change History (1)

comment:1 Changed 14 months ago by zhaodong

Hello,Felix:

maybe you can run it as following:

g++ example1.cpp -o example1 -I ../include -DUSE_LONG_INTEGERS -L../bin/ -Wl,-R../bin/ -lqpOASES

Note: See TracTickets for help on using tickets.