gtk+ compiling error by include iostream

i wrote program that uses gtk and gstreamer
when i try to compile it and it has header iostream i see this error:
/tmp/ccWyxYzY.o: In function `__static_initialization_and_destruction_0(int, int)':
test.cpp:(.text+0x8ec): undefined reference to `std::ios_base::Init::Init()'
test.cpp:(.text+0x8f1): undefined reference to `std::ios_base::Init::~Init()'
collect2: ld returned 1 exit status

when i remove iostream its ok.
whats my problem?

m command to compile it is:
gcc test.cpp -o program `pkg-config --cflags --libs gstreamer-interfaces-0.10 gtk+-3.0 gstreamer-0.10` -fpermissive
Last edited on
Try using g++ instead of gcc.
is there another way to solve problem?cause i really want to compile it with gcc
The problem is that gcc does not automatically link the C++ standard libraries so you have to pass -lstdc++ to gcc to make it work.
Last edited on
thanks man.problem solved
You may be interested in this project which allows you to create GTK+ GUIs using iostream style code... like so :

Labels label;
label<<"Load this label and show it in a horizontal box.";

HBox hBox<<label;;

Check more here :
Topic archived. No new replies allowed.