gcc errors in linux

Started by wmbuRn, 08 July 2013, 21:04:18

wmbuRn

So i downloaded 0.6-dev from the site since 0.4.2 or 0.4.4 wont work at all :)
so i tried to compile Tgui-master [i used cmake first ofc [gui cmake]] and everythig went well with cmake(as it should), but when i typed "sudo make install" i got these errors:

Scanning dependencies of target tgui
[  2%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/TGUI.cpp.o
[  5%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Callback.cpp.o
[  8%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Transformable.cpp.o
[ 10%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Widgets.cpp.o
[ 13%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Label.cpp.o
/home/hidden/TGUI-master/src/TGUI/Label.cpp: In member function 'const sf::Font* tgui::Label::getTextFont() const':
/home/hidden/TGUI-master/src/TGUI/Label.cpp:152:31: error: cannot convert 'const sf::Font' to 'const sf::Font*' in return
/home/hidden/TGUI-master/src/TGUI/Label.cpp:153:5: warning: control reaches end of non-void function [-Wreturn-type]
make[2]: *** [src/TGUI/CMakeFiles/tgui.dir/Label.cpp.o] Error 1
make[1]: *** [src/TGUI/CMakeFiles/tgui.dir/all] Error 2
make: *** [all] Error 2


so, i will try 0.5 version and will report back. If anyone got a solution how to make this to work please reply. Thank you.
Btw nice gui lib!

wmbuRn

Thi is the log of 0.5.2 compiling. So i tied every possible sollution. Every time i delete old source and unpack source so that all the test are fresh]

tied, sudo make same error. tried sudo make install [on fresh srouce] sam eror. tried sudo ./install.sh same error, tried cmake gui first after make install same error:
Thi is from 0.5.2

[  2%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Label.cpp.o
/home/hidden/TGUI-0.5/src/TGUI/Label.cpp: In member function 'virtual const sf::Font* tgui::Label::getTextFont() const':
/home/hidden/TGUI-0.5/src/TGUI/Label.cpp:129:31: error: cannot convert 'const sf::Font' to 'const sf::Font*' in return
/home/hidden/TGUI-0.5/src/TGUI/Label.cpp:130:5: warning: control reaches end of non-void function [-Wreturn-type]
make[2]: *** [src/TGUI/CMakeFiles/tgui.dir/Label.cpp.o] Error 1
make[1]: *** [src/TGUI/CMakeFiles/tgui.dir/all] Error 2
make: *** [all] Error 2


this is output of cmake gui:

The C compiler identification is GNU
The CXX compiler identification is GNU
Check for working C compiler: /usr/bin/gcc
Check for working C compiler: /usr/bin/gcc -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler: /usr/bin/c++
Check for working CXX compiler: /usr/bin/c++ -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Found SFML: /usr/include
Looking for XOpenDisplay in /usr/lib/i386-linux-gnu/libX11.so;/usr/lib/i386-linux-gnu/libXext.so
Looking for XOpenDisplay in /usr/lib/i386-linux-gnu/libX11.so;/usr/lib/i386-linux-gnu/libXext.so - found
Looking for gethostbyname
Looking for gethostbyname - found
Looking for connect
Looking for connect - found
Looking for remove
Looking for remove - found
Looking for shmat
Looking for shmat - found
Looking for IceConnectionNumber in ICE
Looking for IceConnectionNumber in ICE - found
Found X11: /usr/lib/i386-linux-gnu/libX11.so
Found OpenGL: /usr/lib/i386-linux-gnu/libGL.so
Configuring done

wmbuRn

#2
So anyone got and idea what am i doing wrong ? And how to fix it ?

additional info:
kernel: 3.2.0-48-generic-pae #74-Ubuntu SMP
os: Elementary os luna beta 2
sfml: 2.0  and sfml 2.0 tested, everything sfml 2.0 related works. Also tested 1.6 code which didnt work [ just to be shure i have sfml 2.0]. If need more info ask and i will reply.

netrick

#3
Maybe you are using outdated SFML2 version? Download sfml2 current sources and compile it using:

cmake .
make
sudo make install


Also make sure you use the same commands to compile tgui.

(just a guess, I never encountered something like that with tgui on linux)

wmbuRn

I found .deb files from ppa lauchpad from. There was sfml 2.0 and tgui 0.4.2-2 , so my sfml version is definatly current. 0.4.2 wasnt tested enought since formbuilder wont start. window just flashes and nothing happends. Will download sfml and will compile it and will report in few minutes.

netrick

#5
It could have been sfml 2.0 rc in launchpad or some mismatch in libs (your os may be a bit different from regular ubuntu). Generally it's better to compile libs on your own on linux, it's so damn easy and can avoid many problems usually.

Edit:
If you can't compile sfml then run:

sudo apt-get install libpthread-stubs0-dev libgl1-mesa-dev libxrandr-dev libfreetype6-dev libglew-dev libjpeg8-dev libsndfile1-dev libopenal-dev

It will install dependencies needed.

wmbuRn

It was stable branch and it contained 2.0.1 of sfml, [ not a RC] so i will try sfml from development and if thats not working will compile source myself and will report back. Thank you for your answer

wmbuRn

All to the newest version according to apt :) also all versions are OK since i installed sfml from .deb file.

netrick

Okay. Tell me if dev version from ppa or compiling sfml from source helped.

The error you get while compiling TGUI seems to me like it's using SFML header of some older version. Maybe it's a bug in .deb package? I'm almost sure that compiling sfml from source should solve it.

texus

The sfml package from the ppa is the sfml2-RC version which only works with tgui v0.4.

The development version in the ppa contains the real sfml2 and tgui v0.5.

The errors about 'sf::Font' conversion to 'sf::Font*' do mean that the sfml version is not up-to-date and is still the RC version.

And tgui v0.4 is indeed very buggy, it shouldn't be used.

netrick

So I was right. Simply use development version of SFML from ppa and you can easily compile TGUI 0.6 that way (or use 0.5 from ppa).

wmbuRn

#11
I updated sfml, and 97% went fine of make. Here is the short log:

[ 67%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Container.cpp.o
/home/hidden/TGUI-master/src/TGUI/Container.cpp: In copy constructor 'tgui::Container::Container(const tgui::Container&)':
/home/hidden/TGUI-master/src/TGUI/Container.cpp:44:47: warning: declaration of 'copy' shadows a member of 'this' [-Wshadow]

[ 70%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/ContainerWidget.cpp.o
/home/hidden/TGUI-master/src/TGUI/ContainerWidget.cpp: In copy constructor 'tgui::ContainerWidget::ContainerWidget(const tgui::ContainerWidget&)':
/home/hidden/TGUI-master/src/TGUI/ContainerWidget.cpp:43:65: warning: declaration of 'copy' shadows a member of 'this' [-Wshadow]

[ 72%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Panel.cpp.o
/home/hidden/TGUI-master/src/TGUI/Panel.cpp: In copy constructor 'tgui::Panel::Panel(const tgui::Panel&)':
/home/hidden/TGUI-master/src/TGUI/Panel.cpp:50:35: warning: declaration of 'copy' shadows a member of 'this' [-Wshadow]

[ 75%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/ChildWindow.cpp.o
/home/hidden/TGUI-master/src/TGUI/ChildWindow.cpp: In copy constructor 'tgui::ChildWindow::ChildWindow(const tgui::ChildWindow&)':
/home/hidden/TGUI-master/src/TGUI/ChildWindow.cpp:59:53: warning: declaration of 'copy' shadows a member of 'this' [-Wshadow]

[ 78%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Grid.cpp.o
/home/hidden/TGUI-master/src/TGUI/Grid.cpp: In copy constructor 'tgui::Grid::Grid(const tgui::Grid&)':
/home/hidden/TGUI-master/src/TGUI/Grid.cpp:46:32: warning: declaration of 'copy' shadows a member of 'this' [-Wshadow]


[ 91%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/MessageBox.cpp.o
/home/hidden/TGUI-master/src/TGUI/MessageBox.cpp: In copy constructor 'tgui::MessageBox::MessageBox(const tgui::MessageBox&)':
/home/hidden/TGUI-master/src/TGUI/MessageBox.cpp:48:50: warning: declaration of 'copy' shadows a member of 'this' [-Wshadow]
Linking CXX shared library ../../lib/libtgui.so
[ 91%] Built target tgui
Scanning dependencies of target FormBuilder


make[2]: *** No rule to make target `/usr/lib/i386-linux-gnu/libGL.so', needed by `src/TGUI/FormBuilder/FormBuilder'.  Stop.
make[1]: *** [src/TGUI/FormBuilder/CMakeFiles/FormBuilder.dir/all] Error 2
make: *** [all] Error 2

everything else compiled without single warning or error

that was 0.6-dev version , will try to build 0.5.2 version

netrick

It seems strange. Are you sure that "sudo apt-get install libgl1-mesa-dev" says it's up to date?

Anyway, you can download tgui 0.5 from development ppa. That must work.

wmbuRn

I am knowm murphy. [murphy law :) ]

here is full output of compiling 0.5.2 : [ i can use pastebin if needed]

Scanning dependencies of target tgui
[  2%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/TGUI.cpp.o
[  5%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Objects.cpp.o
[  8%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Label.cpp.o
[ 11%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Picture.cpp.o
[ 14%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Button.cpp.o
[ 17%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Checkbox.cpp.o
[ 20%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/RadioButton.cpp.o
[ 23%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/EditBox.cpp.o
[ 26%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Slider.cpp.o
[ 29%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Scrollbar.cpp.o
[ 32%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/ListBox.cpp.o
[ 35%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/LoadingBar.cpp.o
[ 38%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/ComboBox.cpp.o
[ 41%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/TextBox.cpp.o
[ 44%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/SpriteSheet.cpp.o
[ 47%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/AnimatedPicture.cpp.o
[ 50%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/AnimatedButton.cpp.o
[ 52%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/SpinButton.cpp.o
[ 55%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Slider2D.cpp.o
[ 58%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Tab.cpp.o
[ 61%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/ChatBox.cpp.o
[ 64%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/InfoFileParser.cpp.o
[ 67%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/EventManager.cpp.o
[ 70%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/TextureManager.cpp.o
[ 73%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Group.cpp.o
[ 76%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/GroupObject.cpp.o
[ 79%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Panel.cpp.o
[ 82%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/ChildWindow.cpp.o
[ 85%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Grid.cpp.o
[ 88%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Window.cpp.o
[ 91%] Building CXX object src/TGUI/CMakeFiles/tgui.dir/Form.cpp.o
Linking CXX shared library ../../lib/libtgui.so
[ 91%] Built target tgui
Scanning dependencies of target FormBuilder
[ 94%] Building CXX object src/TGUI/FormBuilder/CMakeFiles/FormBuilder.dir/main.cpp.o
[ 97%] Building CXX object src/TGUI/FormBuilder/CMakeFiles/FormBuilder.dir/Properties.cpp.o
[100%] Building CXX object src/TGUI/FormBuilder/CMakeFiles/FormBuilder.dir/FormBuilder.cpp.o
make[2]: *** No rule to make target `/usr/lib/i386-linux-gnu/libGL.so', needed by `src/TGUI/FormBuilder/FormBuilder'.  Stop.
make[1]: *** [src/TGUI/FormBuilder/CMakeFiles/FormBuilder.dir/all] Error 2
make: *** [all] Error 2

mesa:

sudo apt-get install libgl1-mesa-dev
[sudo] password for hidden:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libgl1-mesa-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

texus

Never saw that error before. Did you install  graphics drivers?

You should also try installing tgui 0.5 from the ppa as netrick already suggested. I guess it fits the best with the sfml version from the ppa.