Author Topic: The "-export-dynamic" flag...  (Read 6495 times)

okonkole

  • Guest
The "-export-dynamic" flag...
« on: July 18, 2007, 09:31:48 am »
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).

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
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

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: The "-export-dynamic" flag...
« Reply #1 on: July 18, 2007, 09:37:28 am »
"Build options->Linker settings->Other linker options"
Be patient!
This bug will be fixed soon...

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: The "-export-dynamic" flag...
« Reply #2 on: July 18, 2007, 09:39:08 am »
Specify as -Wl,-export-dynamic at linker option.

Edit: Corrected linker option.
« Last Edit: July 19, 2007, 09:09:59 am by Biplab »
Be a part of the solution, not a part of the problem.

okonkole

  • Guest
Re: The "-export-dynamic" flag...
« Reply #3 on: July 18, 2007, 10:13:44 pm »
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 !