ubuntu - C++ CodeBlocks compile two source files -


i have tried compile files codeblocks have downloaded here:

https://git.gnome.org/browse/gtkmm-documentation/tree/examples/book/frame?h=master

when try compile code blocks error:

main.cpp|8|undefined reference `examplewindow::examplewindow()'|

but compile terminal works:

g++ main.cc examplewindow.cc -o simple `pkg-config gtkmm-3.0 --cflags --libs` 

is there idea how make code blocks compile 2 source files ? enter image description here

-------------- build: debug in youtube (compiler: gnu gcc compiler)---------------

g++ -wall -fexceptions -g -std=gnu++11 -pthread -i/usr/include/gtkmm-3.0 -i/usr/lib/x86_64-linux-gnu/gtkmm-3.0/include -i/usr/include/atkmm-1.6 -i/usr/include/giomm-2.4 -i/usr/lib/x86_64-linux-gnu/giomm-2.4/include -i/usr/include/pangomm-1.4 -i/usr/lib/x86_64-linux-gnu/pangomm-1.4/include -i/usr/include/gtk-3.0 -i/usr/include/cairomm-1.0 -i/usr/lib/x86_64-linux-gnu/cairomm-1.0/include -i/usr/include/gdk-pixbuf-2.0 -i/usr/include/gtk-3.0/unix-print -i/usr/include/gdkmm-3.0 -i/usr/lib/x86_64-linux-gnu/gdkmm-3.0/include -i/usr/include/atk-1.0 -i/usr/include/glibmm-2.4 -i/usr/lib/x86_64-linux-gnu/glibmm-2.4/include -i/usr/include/glib-2.0 -i/usr/lib/x86_64-linux-gnu/glib-2.0/include -i/usr/include/sigc++-2.0 -i/usr/lib/x86_64-linux-gnu/sigc++-2.0/include -i/usr/include/pango-1.0 -i/usr/include/cairo -i/usr/include/pixman-1 -i/usr/include/freetype2 -i/usr/include/libpng12 -i/usr/include/at-spi2-atk/2.0 -i/usr/include/gio-unix-2.0/ -i/usr/include/harfbuzz -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lgtk-3 -lglibmm-2.4 -lcairomm-1.0 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lsigc-2.0 -lgobject-2.0 -lglib-2.0 -i/usr/include/ -i/usr/lib/x86_64-linux-gnu/ -c /home/bahaa/programming/c++/youtube/main.cpp -o obj/debug/main.o g++ -o bin/debug/youtube obj/debug/main.o -l/usr/lib/mysql -lmysqlclient -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lgtk-3 -lglibmm-2.4 -lcairomm-1.0 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lsigc-2.0 -lgobject-2.0 -lglib-2.0 obj/debug/main.o: in function main': /home/bahaa/programming/c++/youtube/main.cpp:8: undefined reference toexamplewindow::examplewindow()' /home/bahaa/programming/c++/youtube/main.cpp:8: undefined reference examplewindow::~examplewindow()' /home/bahaa/programming/c++/youtube/main.cpp:8: undefined reference examplewindow::~examplewindow()' collect2: error: ld returned 1 exit status process terminated status 1 (0 minutes, 1 seconds) 3 errors, 0 warnings (0 minutes, 1 seconds)

https://www.youtube.com/watch?v=3v3kovnb7hu&feature=youtu.be

the command put in terminal looks different command codeblocks executing, fact different logic. in case of undefined reference means forgetting include somewhere. examplewindow declared/defined? in included in main through 1 of 2 includes doing?


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -