alexanderr wrote:
Hi!
I am having some problem to get a program written i GCC to communicate with
the serialport on my Ubuntu computer. The basic problem is the step of
adding a library. I am trying to get this example to work.
http://www.captain.at/howto-simple-serial-port-test-example.php
This is kind of a newbie question, i know.
There are three files to download, into files on the computer. One "ser.c"
that is the actual program, one that is "capser.h" and one "capser.c"
I have put capser.h into /usr/include and that seams to be right, but where
do i put the capser.c file? im not really familjar with the "makefile" since
i have mostly programed AVR-gcc wich has handeld that for me.
When i put the Capser.h in /usr/include and run "gcc -o ser ser.c" i got the
message "undefined reference to GetBaud", and four other similar messages.
What do i need to to with the Capser.c file?
Any help is highly appreciated!
//Alexander
It is usually bad practice to start copying files to /usr/include.
Looking at the C code, I see:
#include "captain/capser.h"
That means it is looking for the file casper.h in the captain subdirectory. So
it should start with a lower case 'c' and not be in /usr/include, which as I
said, one should not normally copy files to anyway.
Dave