How to make the linker to include Sockets library?

  • From: "jstuardo" < >
  • To:
  • Subject: How to make the linker to include Sockets library?
  • Date: Mon, 20 Feb 2012 21:53:41 +0000

Hello... I have created a simple C++ project in NetBeans for Linux. I am 
creating an application that makes use of sockets, so I need  to include 
Sockets library. I know that I need to add -lSockets to the compiler option 
in Makefile, but when I do so in Additional Options in project properties 
(adding -lSockets), I get the error when I build the application.

/usr/bin/ld: cannot find -lSockets

 How can I do it? I need to also include -lpthread. 

I show you the whole build output:


"/usr/bin/gmake" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= 
.build-conf
gmake[1]: Entering directory 
`/home/jstuardo/development/workspace/projects/bst/agd/DbSock'
"/usr/bin/gmake"  -f nbproject/Makefile-Debug.mk 
dist/Debug/GNU-Linux-x86/dbsock
gmake[2]: Entering directory 
`/home/jstuardo/development/workspace/projects/bst/agd/DbSock'
mkdir -p dist/Debug/GNU-Linux-x86
g++ -lSockets -o dist/Debug/GNU-Linux-x86/dbsock 
build/Debug/GNU-Linux-x86/main.o build/Debug/GNU-Linux-x86/StoreSocket.o 
../../../../../lib/Sockets-2.3.9.7/libSockets.a 
/usr/bin/ld: cannot find -lSockets
collect2: ld returned 1 exit status
gmake[2]: *** [dist/Debug/GNU-Linux-x86/dbsock] Error 1
gmake[2]: Leaving directory 
`/home/jstuardo/development/workspace/projects/bst/agd/DbSock'
gmake[1]: *** [.build-conf] Error 2
gmake[1]: Leaving directory 
`/home/jstuardo/development/workspace/projects/bst/agd/DbSock'
gmake: *** [.build-impl] Error 2


BUILD FAILED (exit value 2, total time: 241ms)

 Any help will be greatly appreciated
Thanks

Jaime[/code]






How to make the linker to include Sockets library?

jstuardo 02/20/2012

Project Features

About this Project

CND was started in November 2009, is owned by Leonid Lenyashin, and has 130 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close