User forums > Using Code::Blocks
The "-export-dynamic" flag...
(1/1)
okonkole:
Hi,
I'm using C::B (a Nightly build from 2 month) under Linux, using le GTK and the libglade.
When you use the libglade, you needs a flag (for gcc) to get the signals handlers.
LibGlade doc :
--- Quote ---Libglade can also automatically connect signal handlers in the user interface. It does this by matching handler names specified in the glade file with symbols in the executable looked up with the gmodule library (this requires that applications be linked with the --export-dynamic flag).
--- End quote ---
If i try with the command line :
--- Code: ---gcc -export-dynamic $(pkg-config --libs --cflags gtk+-2.0) $(pkg-config --libs --cflags libglade-2.0) main.c -o monAppliGlade
--- End code ---
There is no problem, it works perfectly !
My problem is that I don't know where to put this option on C::B.
I've try on the "Project \ Build options \ MyProjets (on the tree) \ Other options \ -export-dynamic"
The project compilation is ok. No errors. But when I lanch the prog... my prog doesn't cautch the signal.
So Where do you put such a flag into a C::B project ?
Thanks
mandrav:
"Build options->Linker settings->Other linker options"
Biplab:
Specify as -Wl,-export-dynamic at linker option.
Edit: Corrected linker option.
okonkole:
Ok Mandrav & Biplab, it works... but not only with your solution !
I put the "-export-dynamic" into "Build options->Linker settings->Other linker options", you were right : But it doesn't work :?
I try "-Wl,export-dynamic", but It doesn't pass the compilation.
So I look what I was really doing on the command line... The only difference is that my source file name had a .cpp extention in C::B and a .c extention on the command line ! I've rename my file in C::B and it works ! :P
So perhaps that's not the place for that question, but WHY it doesn't work with .cpp file ? (I know, there is no relation with C::B, but it's a good way to conclude !)
Thanks !
Navigation
[0] Message Index
Go to full version