martinling / libserialport

Unofficial personal repository for libserialport - see git://sigrok.org/libserialport for official repo
http://sigrok.org/wiki/Libserialport
GNU Lesser General Public License v3.0
65 stars 34 forks source link

Cannot compile Ubuntu Server #15

Closed david1191 closed 8 years ago

david1191 commented 8 years ago

I have installed libserialport with the instructions provided. Upon installing, I copied the example program from here. When I try to compile that with gcc example.c I get the errors:

/tmp/cc8fDDwV.o: In function `main':
example.c:(.text+0x10): undefined reference to `sp_list_ports'
example.c:(.text+0x35): undefined reference to `sp_get_port_name'
example.c:(.text+0x70): undefined reference to `sp_free_port_list'
collect2: error: ld returned 1 exit status

Any help with this would be greatly appreciated.

david1191 commented 8 years ago

Fixed with: gcc example.c -lserialport