undefined reference to functions declared in lindo.h
Asked Answered
W

1

0

I have the same problem described in this post:

undefined reference to function declared in *.h file

I am writing a C/C++ project Using Eclipse.

How can I solve the same problem?

I have tried going to: Project -> properties -> c c++ build -> settings -> Tool Settings->Gcc c++ libraries -> libraries -> libraries (-l)

and adding the libraries in /lindoappi/bin/linux34.

but it does not work. I added the directory to:

Project -> properties -> c c++ build -> settings -> Tool Settings->Gcc c++ libraries -> libraries -> library search path

The console output is:

**** Build of configuration Debug for project LINDO_test ****

make all Building target: LINDO_test Invoking: GCC C++ Linker g++ -L/home/mario/lindoapi/bin/linux32 -o"LINDO_test" ./src/LINDO_test.o ./src/test_001.o -lliblindo /usr/bin/ld: cannot find -lliblindo collect2: ld returned 1 exit status make: *** [LINDO_test] Error 1

The folowing is a related post too: error while loading shared libraries

Any other suggestions? Thanks a lot.

Walther answered 17/4, 2013 at 5:23 Comment(0)
W
0

Go to:

Project -> properties -> c c++ build -> settings -> Tool Settings->Gcc c++ linker -> libraries -> libraries (-l)

add the libraries as: lindo64 mosek64 and whatever you need.

Then add: Project -> properties -> c c++ build -> settings -> Tool Settings->Gcc c++ linker

Make sure .../lindoapi/bin/linux64 is in Project -> properties -> c c++ build -> settings -> Tool Settings->Gcc c++ linker -> libraries -> Library search path (-L)

edit the command line pattern to: ${COMMAND} ${OUTPUT} ... -Wl,-rpath=/opt/lindoapi/bin/linux64 ${INPUTS}

for some reason Eclipse only allows -soname, --out-implib, and --output-def for Wl, so you have to do it manually in this way. Is not clean, but it works.

I hope this is useful to other users too.

happy coding.

Walther answered 18/4, 2013 at 18:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.