0

Trying to run the example program from the serialib serial communication library.

Library: http://serialib.free.fr/html/files.html

Example Code: http://serialib.free.fr/html/_example1_8cpp_source.html

I compile from the command line with

g++ Example1.cpp -o example

and get several errors for undefined reference

Example1.cpp:(.text+0x24): undefined reference to `serialib::serialib()'
Example1.cpp:(.text+0x40): undefined reference to `serialib::Open(char const*, unsigned int)'
Example1.cpp:(.text+0x83): undefined reference to `serialib::WriteString(char const*)'

My #include statements find the library .h file, but for some reason it is still throwing this error.

Any ideas why this is happening? I am pretty new at C/C++ and could really use some help.

cirea22
  • 25
  • 7
  • 1
    possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – deviantfan Nov 08 '14 at 03:45
  • 1
    it looks like one of two things, 1) the gcc ... line is missing either a) L -lseriallib or b) -I. -I infact, it seems to be missing both sets of parameters. – user3629249 Nov 08 '14 at 09:29

0 Answers0