probleme libserial linkage
Bonjour , je suis étudiant en BTS info et j’ai un soucis avec un tout petit programme :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
#include <SerialStream.h>
//
using namespace LibSerial ;
//
// Create a SerialStream instance.
//
int main ()
{
SerialStream my_serial_stream ;
//
// Open the serial port for communication.
//
my_serial_stream.Open( "/dev/ttyS0" ) ;
//
// The various available baud rates are defined in SerialStreamBuf class.
// This is to be changed soon. All serial port settings will be placed in
// in the SerialPort class.
//
my_serial_stream.SetBaudRate( SerialStreamBuf::BAUD_230400 ) ;
// Use 8 bit wide characters.
//
my_serial_stream.SetCharSize( SerialStreamBuf::CHAR_SIZE_8 ) ;
//
//Use one stop bit.
//
my_serial_stream.SetNumOfStopBits(1) ;
// write 'U'
my_serial_stream << 'U' ;
return 0;
} |
et le terminal me retourne l’erreur suivante :
g++ serie.cpp -o serie -lserial -lpthread/tmp/ccXavVlx.o: dans la fonction « main »:
serie.cpp:(.text+0x7c): référence indéfinie vers « LibSerial::SerialStream::Open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::_Ios_Openmode) »
collect2: error: ld returned 1 exit status
merci d’avance.