![]() |
liblocation, undefiend reference
Hello,
trying to compile example using: Code:
gcc -Wall `pkg-config --cflags glib-2.0, liblocation --libs glib-2.0, liblocation` -o gps gps.cpp Code:
/var/tmp/cc447Dm5.o: In function `main': maybe I'm tired, but I have no idea how to fix this :( I'm using final SDK for Maemo 5, same effect on both armel and x86. |
Re: liblocation, undefiend reference
Answering my own question:
adding Code:
extern "C" |
Re: liblocation, undefiend reference
Hi!
I encounter a similar problem and have long been looking for an answer to it, but no success so far. I get the same error message, even when trying it with the sample code. I am using the Virtual Image SDK and I am writing in C, though and the headers are of course included. Any hint on how to solve is very welcome. ES |
Re: liblocation, undefiend reference
Quote:
|
Re: liblocation, undefiend reference
Thanks for the heads-up, Joorin, surely nobody could help me with that little information, I understand.
Something had to be wrong with my first post... So, here goes, I am as well trying to compile the location API example code, as per the very first post in this thread. I am using the Virtual Image SDK in VMware on a Mac and I compile inside ESbox. Code:
gcc -O0 -g -o helloworldwithdebiansupport main.o -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgnomevfs-2 -lgconf-2 -lgthread-2.0 -lrt -lgmodule-2.0 -ldbus-glib-1 -ldbus-1 -lpthread -lgobject-2.0 -lglib-2.0 -pthread -lhildon-1 -lhildonfm -lgtk-x11-2.0 -lgnomevfs-2 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgconf-2 -lgthread-2.0 -lrt -lgmodule-2.0 -ldbus-glib-1 -ldbus-1 -lpthread -lgobject-2.0 -lglib-2.0 -losso -ldbus-glib-1 -ldbus-1 -lpthread -lgobject-2.0 -lglib-2.0 Code:
main.o: In function `on_changed': I hope that's sufficient information, please let me know if more is needed. |
Re: liblocation, undefiend reference
Quote:
Code:
-llocation |
Re: liblocation, undefiend reference
Quote:
|
Re: liblocation, undefiend reference
Thanks, Nicolai, that's what I "feel", too. And I have been trying to include this into the gcc-statement.
But I have no idea, how to add it. I assume(d) that ESbox would take care of the necessary libraries to include. If not, how can I add them manually to the compiler statement (in ESbox)? |
Re: liblocation, undefiend reference
Quote:
Code:
/* Includes */ Code:
src/main.c:63: error: expected ')' before '*' token |
Re: liblocation, undefiend reference
nicolai beat me to it.
Just as he pointed out, you have no instruction to the linker to look in liblocation for symbols that will satisfy the function calls in your code. The flag -l means "Add this library to the list of libraries to look for symbols in.". The flag -L means "Look in this directory for libraries to use while linking.". So, in this case, the combination Code:
-L/user/lib -llocation Happy (hacking|linking)! :) |
All times are GMT. The time now is 09:26. |
vBulletin® Version 3.8.8