Juan Camargo
Juan Camargo

Reputation: 3

Linking CPR C++ library with OMNET++

I have succesfully installed OMNET++ and now I want to link OMNET with a REST API library called CPR. Usually, in Eclipse (Which OMNET++ is based on) I would do the linking something like project properties->C/C++ build->Settings->GCC C++ Linker->Libraries->[-l section]. Now in OMNET I have tried linking it by going to Project -> Properties -> Makemake -> Options -> Additional Libraries to link with (-l option) and include: cpr.

But it returns an error:

ld.lld error: unable to find library -lcpr

Thanks a lot for your help.

Upvotes: 0

Views: 435

Answers (2)

Juan Camargo
Juan Camargo

Reputation: 3

Well, in case anyone else is wondering this. I just copied the library dependencies (The .so, .zlib-ng and .1 files) into my usr/lib directory. After that, I included the library through `

Project properties -> Omnet++ -> Makemake -> Makemake Options -> link

` and include "cpr" in the -l option. And now it's working.

Probably not the best answer but it works for me.

Upvotes: 0

Rudi
Rudi

Reputation: 6681

The cpr library should be on your library path (i.e. usually on /usr/lib). Otherwise you must specify also the -L option to specify the directory where that given library is.

Upvotes: 2

Related Questions