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.
CodePudding user response:
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.
CodePudding user response:
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.