C Socket Programming - Missing Libraries

This forum is for topics dealing with problems with software specifically in the ARMv6h repo.

C Socket Programming - Missing Libraries

Postby FallDownT » Thu Jul 02, 2015 11:32 am

I am attempting to write a UDP server and client in C as a proof of concept project. Being pretty new to socket programming, I am using a couple sites as tutorials for this task:
Both of these guides have include statements that fail for me because they reference several libraries that I do not have in my $LD_LIBRARY_PATH, nor do I know how to install them. Notably, these include statements are:
$this->bbcode_second_pass_code('', '#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>')
My $LD_LIBRARY_PATH is set as follows
$this->bbcode_second_pass_code('', '$LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/opt/vc/lib')
where my /usr/local/lib is empty and /opt/vc/lib is included for camera module integration. Within my /usr/lib, there is no sys or arpa directory.
My Arch Linux OS runs on a Raspberry Pi with an armv61 processor.

While my immediate problem is that I don't have the libraries I need to create my UDP sockets in C, the underlying problem is that I don't know where to look to install them. If anyone has experience with this and can help me, it would be greatly appreciated.

Thanks in advance!
FallDownT
 
Posts: 2
Joined: Thu Jul 02, 2015 11:20 am

Re: C Socket Programming - Missing Libraries

Postby WarheadsSE » Thu Jul 02, 2015 2:04 pm

library paths are to .so's, not header files. You should be using -I to add paths for headers.

If the headers (use find to locate them) are not actually on your system, then I suggest making use of the pkgfile command (see the pkgfile package and https://wiki.archlinux.org/index.php/Pkgfile)
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: C Socket Programming - Missing Libraries

Postby FallDownT » Fri Jul 03, 2015 11:06 am

Ahh yes, I did some research and I realize that I had include files and libraries confused. After looking through the /usr/include directory, I found the file I need under /usr/include/sys/socket.h. I'm all set now, thanks!

Thanks for the clarification on libraries vs headers.
FallDownT
 
Posts: 2
Joined: Thu Jul 02, 2015 11:20 am


Return to ARMv6h

Who is online

Users browsing this forum: No registered users and 7 guests