Reputation:
I'm trying to make use of libserial
for my project in qt. I've installed the library and added it to my .pro file
using LIBS += -L/usr/local/lib/ -lserial
I have a class
class SerialComm
{
public:
SerialStream node;
SerialComm()
{
node.SetBaudRate(SerialStreamBuf::BAUD_9600);
node.SetCharSize(SerialStreamBuf::CHAR_SIZE_8);
node.Open("/dev/ttyACM0");
}
};
However when I build it, I get the following error: undefined reference to `LibSerial::SerialStream::Open(std::__cxx11::basic_string, std::allocator >, std::_Ios_Openmode)'
At first I thought it was something to do with libserial but the error doesn't come up for
node.SetBaudRate(SerialStreamBuf::BAUD_9600);
node.SetCharSize(SerialStreamBuf::CHAR_SIZE_8);
Any ideas why this is happening?
Upvotes: 0
Views: 220