Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Siméon
Novice
391 Views

Adding a library when compiling a demo

Jump to solution

Hello,  

I compiled the human_pose_estimation demo on my RPi thanks to that post I did:
https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Human-pose-estimation-model-on-Raspber...

But now I want to modify the demo quite a bite to add a library in order to send data. Normally to compile a project that use that lib, I should do it that way:

g++ main.cpp -o test -lzmq

With the -lzmq parameter. I don't know where to add it. I tried to add it inside the CMakeLists.txt of the project in the DEPENDENCIES line, without sucess. Then I added the parameter to cmake command, no more sucess. I'm not familiar with compiling in command line on Linux. That's why I ask your help.

 

Thanks in advance,  
Siméon

 

0 Kudos
1 Solution
OKI__HIdetaka
New Contributor I
322 Views

Hi, just FYI about cmake;

Adding "target_link_libraries(${IE_SAMPLE_NAME} PRIVATE zmq)" line to CMakeLists.txt will work to add a library as a linker option.
You can find added -lzmq option in <build_dir>/<sample_program>/CMakeFiles/<sample_program>.dir/link.txt generated by cmake.

Best Regards,

View solution in original post

6 Replies
Iffa_Intel
Moderator
369 Views

Greetings,


Instead of importing library in that manners, why not use data logger instead.

Here is the example of it: https://www.linuxtopia.org/online_books/programming_books/c++_practical_programming/c++_practical_pr...


(In case) python: https://www.instructables.com/id/Experiments-in-Advanced-Data-Logging-Using-Python-/


Sincerely,

Iffa





Siméon
Novice
364 Views

The problem, I need the data in real time. That's why I use that library. It's used by another program (NEP: https://enriquecoronadozu.github.io/NEP/) to send the data to others script of my project.
I need to use it. Usually I use NEP in Python.

Regards,
Siméon

Iffa_Intel
Moderator
334 Views

The data logger can be used for Real Time data collection, you can even do some tweaking to send it through MQTT protocol(just a suggestion) and direct send it to database.


Most RTOS(embedded system) specific in achieving real time application have this kind of implementation also.


Sincerely,

Iffa


OKI__HIdetaka
New Contributor I
323 Views

Hi, just FYI about cmake;

Adding "target_link_libraries(${IE_SAMPLE_NAME} PRIVATE zmq)" line to CMakeLists.txt will work to add a library as a linker option.
You can find added -lzmq option in <build_dir>/<sample_program>/CMakeFiles/<sample_program>.dir/link.txt generated by cmake.

Best Regards,

View solution in original post

Siméon
Novice
284 Views

Thanks for your answer ! It works perfectly !

Sorry for the late reply, I was busy by my apartment move.

 

Best regards,
Siméon

Iffa_Intel
Moderator
307 Views

Greetings,


Intel will no longer monitor this thread since we have provided a solution. If you need any additional information from Intel, please submit a new question. 


Sincerely,

Iffa


Reply