Dear Attie,
First of all, thank you for providing us all this great library.
I managed to make and install it on ArchLinux without any problems.
Provided examples for xbeeZB work like a charm (at, remote_at, data, etc.)
Now I am trying to make use of other libraries in conjunction with libxbee as part of a larger project.
I have included in my project the following things:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h> //I/O system handling
#include <time.h> //system time
#include <fcntl.h> //open function
#include <unistd.h> //close function
#include "sqlite3.h"
#include "nmea.h"
#include <xbee.h>
#include <event.h> //even manager - libevent
I issue the following command when compiling with gcc:
gcc STrackU.c -o STrackU -I /usr/local/include/sqlcipher -L /usr/local/lib/libsqlcipher.a -lsqlcipher -I ~/nmealib/include/nmea/ -L ~/nmealib/lib/libnmea.a -lnmea -lxbee -lpthread -lrt
I am running into a compilation error:
In file included from /usr/include/fcntl.h:68:0,
from STrackU.c:82:
/usr/include/bits/stat.h:72:21: error: field 'st_atim' has incomplete type
struct timespec st_atim; /* Time of last access. */
^
/usr/include/bits/stat.h:73:21: error: field 'st_mtim' has incomplete type
struct timespec st_mtim; /* Time of last modification. */
^
/usr/include/bits/stat.h:74:21: error: field 'st_ctim' has incomplete type
struct timespec st_ctim; /* Time of last status change. */
^
In file included from STrackU.c:90:0:
/usr/include/xbee.h:101:2: error: unknown type name 'time_t'
time_t lastRxTime;
^
In file included from STrackU.c:90:0:
/usr/include/xbee.h:142:18: error: field 'timestamp' has incomplete type
struct timespec timestamp;
I have noticed that it is a common error with struct timespec, basically several re-definitions of the same structure appear across various header files.
Even in xbee.h there is an #if !defined for protection against it.
How could I successfully mitigate such error in my own code?
Best regards,
Bogdan
--
You received this message because you are subscribed to the Google Groups "libxbee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libxbee+u...@googlegroups.com.
To post to this group, send email to lib...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/libxbee/4d02a4af-7a23-4ed3-89a0-dfa2d92f8896%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <termios.h> //I/O system handling#include <time.h> //system time#include <fcntl.h> //open function#include <unistd.h> //close function
//#include "sqlite3.h"//#include "nmea.h"#include <xbee.h>//#include <event.h> //even manager - libeventint main(int argc, char *argv[]) {struct timespec st_atim;return 0;}
To view this discussion on the web, visit https://groups.google.com/d/msgid/libxbee/609cb4bc-f715-4005-b1f0-f8b3b8c70365%40googlegroups.com.
gcc STrackU.c -o STrackU -I /usr/local/include/sqlcipher -L /usr/local/lib/libsqlcipher.a -lsqlcipher -I ~/nmealib/include/nmea/ -L ~/nmealib/lib/libnmea.a -lnmea -lxbee -lpthread -lrt
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <termios.h> //I/O system handling#include <time.h> //system time#include <fcntl.h> //open function#include <unistd.h> //close function#include <sqlite3.h>
#include <nmea/nmea.h>
#include <xbee.h>#include <event.h> //even manager - libevent
gcc STrackU.c -o STrackU -L /usr/local/lib/libsqlcipher.a -lsqlcipher -I ~/nmealib/include -L ~/nmealib/lib/libnmea.a -lnmea -lxbee -lpthread -lrt
To view this discussion on the web, visit https://groups.google.com/d/msgid/libxbee/f0badad7-d3f4-4a7b-9a18-83ed0d60ed4f%40googlegroups.com.
$ makegcc libmy/my.c -o libmy/libmy.o -c -fPICgcc -shared -Wl,-soname,libmy.so libmy/libmy.o -o libmy/libmy.sogcc -Llibmy -Ilibmy/include test.c -lmy -o testgcc -Llibmy -Ilibmy/include test.c -lmy -o test2 -Wl,-rpath,/home/attie/t/rpath_demo/libmy$ ./test./test: error while loading shared libraries: libmy.so: cannot open shared object file: No such file or directory$ LD_LIBRARY_PATH=./libmy ./testHello World!$ ./test2Hello World!
To view this discussion on the web, visit https://groups.google.com/d/msgid/libxbee/534ce333-6163-438b-a6ba-5c5d8faf4fef%40googlegroups.com.