User forums > Using Code::Blocks
Erreur compiling
Metallica:
Hi all
i'm a novic here. :D
i was using shell to compile my C files
so i wrote a dbus programm with c and i was compiling it like this:
gcc `pkg-config --libs --cflags dbus-1 dbus-glib-1 glib-2.0` dbus-ping-listen.c
and it works.
but when i use codeblocks i have this error
Compiling: /home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:1:18: erreur:
glib.h : Aucun fichier ou répertoire de ce type
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:2:23: erreur: dbus/dbus.h : Aucun fichier ou répertoire de ce type
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:3:28: erreur: dbus/dbus-glib.h : Aucun fichier ou répertoire de ce type
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:4: erreur: «DBusHandlerResult" does not name a type
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c: In function «int main(int, char**)":
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:8: erreur: «GMainLoop" was not declared in this scope
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:8: erreur: «loop" was not declared in this scope
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:9: erreur: «DBusConnection" was not declared in this scope
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:9: erreur: «bus" was not declared in this scope
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:10: erreur: «DBusError" was not declared in this scope
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:10: erreur: expected `;' before «error"
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:11: erreur: «NULL" was not declared in this scope
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:11: erreur: «FALSE" was not declared in this scope
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:11: erreur: «g_main_loop_new" was not declared in this scope
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:12: erreur: «error" was not declared in this scope
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:12: erreur: «dbus_error_init" was not declared in this scope
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:13: erreur: «DBUS_BUS_SESSION" was not declared in this scope
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:13: erreur: «dbus_bus_get" was not declared in this scope
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:15: erreur: «g_warning" was not declared in this scope
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:16: erreur: «dbus_error_free" was not declared in this scope
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:19: erreur: «dbus_connection_setup_with_g_main" was not declared in this scope
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:21: erreur: «dbus_bus_add_match" was not declared in this scope
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:22: erreur: «signal_filter" was not declared in this scope
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:22: erreur: «dbus_connection_add_filter" was not declared in this scope
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:23: erreur: «g_main_loop_run" was not declared in this scope
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c: At global scope:
/home/hamdi/Desktop/exempleconexion/exemple ping/dbus-ping-listen.c:26: erreur: «DBusHandlerResult" does not name a type
Process terminated with status 1 (0 minutes, 1 seconds)
25 errors, 0 warnings :shock:
i must insert pkg-config --libs --cflags dbus-1 dbus-glib-1 glib-2.0 somewher but i dont know where :?
Help please
thanks
Biplab:
Add
--- Code: ---pkg-config --cflags dbus-1 dbus-glib-1 glib-2.0
--- End code ---
to Project > Compiler settings > Other options.
Then add
--- Code: ---pkg-config --libs dbus-1 dbus-glib-1 glib-2.0
--- End code ---
to Project > Other linker options.
That should solve your problem. :)
Metallica:
i didnt find "compiler setting" in the project onglet :?
i use code blocks svn build rev 4439!!
what is the problem :(!!!
Biplab:
--- Quote from: Metallica on October 10, 2007, 01:03:19 pm ---i didnt find "compiler setting" in the project onglet :?
i use code blocks svn build rev 4439!!
what is the problem :(!!!
--- End quote ---
Translate Compiler settings to your language and then look for it. I don't speak your language and I can help you in English only. :)
Metallica:
--- Quote from: Biplab on October 10, 2007, 01:27:15 pm ---
--- Quote from: Metallica on October 10, 2007, 01:03:19 pm ---i didnt find "compiler setting" in the project onglet :?
i use code blocks svn build rev 4439!!
what is the problem :(!!!
--- End quote ---
Translate Compiler settings to your language and then look for it. I don't speak your language and I can help you in English only. :)
--- End quote ---
no!!! i has an english version!! but in the onglet "project " there is no compiler setting for exemple!!
anyway i found it insettings >compiler and debugger>compiler setings> other option :o
the problem now is that after i put the options i can't save it!!!!!
starnge!!!but i cant save the modification!!
any idea?!
Navigation
[0] Message Index
[#] Next page
Go to full version