Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Linker and Extra libraries: (6 Items)
   
Linker and Extra libraries  
Hi,
I am writing as I noticed in QNX IDE7.1, there is no option to select extra libraries from Linker as the one was 
available on IDE6.5. To elaborate more, I am running QNX on a Raspberry pi4(configuration: aarch64le) and trying to 
connect it via wireless, and I require to add a “socket” library from Linker.

Quick question:
Where is this option in IDE7.1?
http://www.qnx.com/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.ide.userguide%2Ftopic%2Fwizards_LinkerExtraLib_.
html
Re: Linker and Extra libraries  
No it is still there in you have recursive make managed project (see picture attached)
Attachment: Image Screenshot from 2021-07-15 09-13-45.png 66.91 KB
Re: Linker and Extra libraries  
I appreciate your help. 
I still have the problem as I couldn't find it in my IDE.
Please see the attached image.
Attachment: Image image_1.png 27.19 KB
Re: Linker and Extra libraries  
This is not the same type of project. In this type of project you edit makefile manually.
If this is default makefile  - if you open it it has commented out examples on how to add extra libraries
Re: Linker and Extra libraries  
Hi Elena,
following up on your instruction, I added the following line of code within my makefile:

LIBS += -L/C:\QNX\QNX_SDK\target\qnx7\aarch64le\usr\lib\perl5\5.32.0\aarch64-nto\auto\Socket -lSocket

I am not sure if I coded t correctly ( I used https://stackoverflow.com/questions/12054858/add-so-and-a-libraries-to-
makefile?answertab=active).
PS: I want to add a socket library and use the available codes in this library, such as "accept".
http://www.qnx.com/developers/docs/7.0.0/index.html#com.qnx.doc.neutrino.lib_ref/topic/a/accept.html

I got the following error when I build the project.


15:28:15 **** Incremental Build of configuration aarch64le-debug for project Lab2 ****
make -j8 all
q++ -Vgcc_ntoaarch64le_cxx -o build/aarch64le-debug/Lab2  
build/aarch64le-debug/src/csocket.o 
-L/C:\QNX\QNX_SDK\target\qnx7\aarch64le\usr\lib\perl5\5.32.0\aarch64-nto\auto\Socket -lSocket
C:\QNX\QNX_SDK\host\win64\x86_64\usr\bin\aarch64-unknown-nto-qnx7.1.0-ld: C:/QNX/QNX_SDK/target/qnx7/aarch64le/lib/crt1.
o: in function `_start':
/builds/workspace/710-SDP/build_aarch64/lib/c/startup/aarch64/crt1.S:80: undefined reference to `main'
cc: C:/QNX/QNX_SDK/host/win64/x86_64/usr/bin/aarch64-unknown-nto-qnx7.1.0-ld caught signal 1
make: *** [build/aarch64le-debug/Lab2] Error 1
Makefile:66: recipe for target 'build/aarch64le-debug/Lab2' failed
"make -j8 all" terminated with exit code 2. Build might be incomplete.

Any help is highly appreciated.
Re: Linker and Extra libraries  
Th solution is to add extra library in Makefile, find the commented out lines 

#LIBS += -L/path/to/my/lib/$(PLATFORM)/usr/lib -lmylib
#LIBS += -L../mylib/$(OUTPUT_DIR) -lmylib

then, for example, you can modify it as follows :


LIBS += -L /usr/lib/socket -lsocket


make sure the to put the library in the same address in your target -> /usr/lib.

the reason that I put l before the name of the library is explained here: https://stackoverflow.com/questions/12054858/
add-so-and-a-libraries-to-makefile?answertab=active