Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Using dynamic library in QNX7: (2 Items)
   
Using dynamic library in QNX7  
Hello,

I get started with vsomeip library which is built & provided by QNX, & I am using QNX7. A simple application "service-example.cpp" is used as jump-start, it is attached & already available under the following link: 

https://github.com/GENIVI/vsomeip/wiki/vsomeip-in-10-minutes 

The problem is... When building the application, I get the following error message: 
"undefined reference to vsomeip::runtime::get()" 

* More details about the build environment: 
- I am using QNX executable > C/C++ 
- Shared library path is already set, via Window > Preferencess > QNX > Shared Libraries 
- The header files are copied to: /home/user/qnx700/target/qnx7/usr/include 
- Noting that: For QNX C/C++ executable, there is no linker options -l nor -L ?!

- When commenting out the line of creating the service
app = vsomeip::runtime::get()->create_application("Hello"); 
the program is built fine !

- the namespace of vsomeip is used: using namespace vsomeip; 
- The main header file is Included: #include <vsomeip/vsomeip.hpp> 


Thank you. 

Best regards, 
Ahmed
Attachment: Text server_vsomeip.cpp 306 bytes
Re: Using dynamic library in QNX7  
The problem must be related to the linker, not header files, because if they were not found then you would get a 
compiler error.
If vsomeip is a library, then surely it must be somewhere in the system, something like "libvsomeip.so.1" or so. You 
have to tell the linker that you explicitly wish it to be included in the link. Setting the shared library path alone is
 not sufficient. You can do this in the properties of the project, under the "QNX C/C++ Project" entry, tab "Linker", 
page "Libraries". Note that the preceding "lib" muat not appear there.

Regards,
Albrecht