OMNET++ integration with CPR API REST

109 views
Skip to first unread message

JuanC

unread,
Apr 19, 2022, 3:57:01 AM4/19/22
to OMNeT++ Users
Dear all,

I have a simulation in OMNET++ that needs to make a request from an external API server running. I have used a C++ library called CPR that I have tested in Eclipse directly and works fine (After linking the proper directories and executables through Project properties->C/C++ build->Settings->GCC C++ Linker->Libraries->[-l section] and then add the CPR library). However, I don't know how to do the same linking process of the library while using OMNET++ (It should be possible as OMNET is based on the Eclipse IDE). I am running OMNET++ 6.0pre11 in Ubuntu 20.04 LTS. 

Could someone explain me how to link the libraries properly please? 

Thanks in advance

Alfonso Ariza Quintana

unread,
Apr 19, 2022, 6:21:36 AM4/19/22
to omn...@googlegroups.com
If you are using inet, the easier is to modify the makefrag file.
INCLUDE_PATH += -ImyPath
LIBS += -lmyLib


De: 'JuanC' via OMNeT++ Users <omn...@googlegroups.com>
Enviado: martes, 19 de abril de 2022 9:57
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: [Omnetpp-l] OMNET++ integration with CPR API REST
 
--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/c43d3d68-0e28-467c-a239-db4bb0649805n%40googlegroups.com.

JuanC

unread,
Apr 29, 2022, 4:44:44 AM4/29/22
to OMNeT++ Users
Got it, but should I modify the makefrag from the Simu5G, from INET or from the CPR library? 

Additionally, the letter is an L or an I ??. I'm asking because usually the -I in Include Path is a capital I as in INDIANA and the -l in LIBS is a lowercase l as in lower case lima. 

PD. I modified the makefrag from the SIMU5G and now it cannot find the SIMU5G library. 

<!> Error: Cannot load library '../../../../src//libsimu5g.so': ../../../../src//libsimu5g.so: undefined symbol: _ZN3cpr7SessionC1Ev


Alfonso Ariza Quintana

unread,
May 2, 2022, 7:19:36 AM5/2/22
to omn...@googlegroups.com

If you are using the library in simu5G, you need to include the library in the Simu5G project. You can include additional libraries in the Project properties->OMNeT++->Makemake-> “Makemake options” -> Link

 

 

 

 

Enviado desde Correo para Windows

 

De: 'JuanC' via OMNeT++ Users
Enviado: viernes, 29 de abril de 2022 10:44
Para: OMNeT++ Users
Asunto: Re: [Omnetpp-l] OMNET++ integration with CPR API REST

 

Got it, but should I modify the makefrag from the Simu5G, from INET or from the CPR library? 

 

Additionally, the letter is an L or an I ??. I'm asking because usually the -I in Include Path is a capital I as in INDIANA and the -l in LIBS is a lowercase l as in lower case lima. 

 

PD. I modified the makefrag from the SIMU5G and now it cannot find the SIMU5G library. 

 

<!> Error: Cannot load library '../../../../src//libsimu5g.so': ../../../../src//libsimu5g.so: undefined symbol: _ZN3cpr7SessionC1Ev

El martes, 19 de abril de 2022 a las 12:21:36 UTC+2, Alfonso Ariza Quintana escribió:

If you are using inet, the easier is to modify the makefrag file.

INCLUDE_PATH += -ImyPath

LIBS += -lmyLib

 

De: 'JuanC' via OMNeT++ Users <omn...@googlegroups.com>
Enviado: martes, 19 de abril de 2022 9:57
Para: OMNeT++ Users <omn...@googlegroups.com>
Asunto: [Omnetpp-l] OMNET++ integration with CPR API REST

 

Dear all,

 

I have a simulation in OMNET++ that needs to make a request from an external API server running. I have used a C++ library called CPR that I have tested in Eclipse directly and works fine (After linking the proper directories and executables through Project properties->C/C++ build->Settings->GCC C++ Linker->Libraries->[-l section] and then add the CPR library). However, I don't know how to do the same linking process of the library while using OMNET++ (It should be possible as OMNET is based on the Eclipse IDE). I am running OMNET++ 6.0pre11 in Ubuntu 20.04 LTS. 

 

Could someone explain me how to link the libraries properly please? 

 

Thanks in advance

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/c43d3d68-0e28-467c-a239-db4bb0649805n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.

JuanC

unread,
May 4, 2022, 10:51:04 AM5/4/22
to OMNeT++ Users
Ahh, ok got it. I tested it and eventually it worked. But first I had to copy the library files (.so) to my root file (usr/lib) because they were in (usr/local/lib). But in any case, it is safe and sound now, thanks a lot. 
Reply all
Reply to author
Forward
0 new messages