Closed funvill closed 5 years ago
To answer my own question.
This is how you build the libraries as static libraries https://github.com/wjwwood/serial/issues/190
The output of the build is placed in \build\devel\lib\libserial.a
I renamed the library to \build\devel\lib\libserialstatic.a
Then rebuilt the application using the following command
g++ serial_example.cc -lserialstatic -L../build/devel/lib/ -I../include -o test_serial
Everything works as expected.
I am having trouble compiling the serial_example.cc. I expect that this is a issue with my understand of the g++ static and shared library and not the serial library.
Clone, make and install (no errors)
Build the example using the following command (builds with no issues)
g++ serial_example.cc -lserial -L/tmp/usr/local/lib/ -I../include -o test_serial
When I try to run the example
I get the following error
But when following the instructions in this issue https://github.com/wjwwood/serial/issues/191 and running the example using this command
The test_serial application runs without error.
How can I run this example executable without having to include this section
LD_LIBRARY_PATH=
pwd/../build/devel/lib
?How do I compile the serial_example with a statically linked serial library?
Thank you