Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - knarf0

#1
Hi,

I would like to compile a project on Windows using mingw32, with both SFML and TGUI linked statically.

I Compile with :

Quoteg++ main.cpp -o main.exe -W -Wall -std=c++11 -DSFML_STATIC -DTGUI_USE_STATIC_STD_LIBS -ltgui-s -lsfml-graphics-s -lsfml-window-s -lsfml-network-s -lsfml-audio-s -lsfml-system-s

and I get :

Quotec:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x429): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x43d): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x524): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x590): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x5b2): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x629): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x68c): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x6c1): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x6e9): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x738): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x82c): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x83d): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x865): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x8a7): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x969): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0xca4): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0xccc): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0xd70): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0xdad): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0xe18): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0xe43): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x124c): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x1396): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x1404): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x142c): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x14eb): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x153b): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x161c): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x1630): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x1659): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x1670): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x1698): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x1853): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x18a3): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x18dc): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x1904): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x19ca): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x1ab1): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x1ac5): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x1aed): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x1bc0): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x1d06): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x1d1b): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x1d43): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x1eb5): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x1fdc): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x2001): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x2015): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x203d): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x20f6): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x2550): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x2575): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x259a): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x25c3): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x2834): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x285c): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x29a9): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x2a07): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x2a2c): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x2a44): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x2a6c): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x2bbd): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x2c29): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x2c4e): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x2c61): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x2c89): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x2d44): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x2d77): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x2d89): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x2dab): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x2e54): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x41f9): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x425a): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x4454): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x447f): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x4968): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x49f6): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x4a99): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x4ac1): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x4d7c): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x4de0): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x4e05): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x4ed8): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x4f00): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x4fa0): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x5039): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x5052): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x507d): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x50e0): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x5423): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x5448): undefined reference to `__gxx_personality_sj0'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x5479): undefined reference to `_Unwind_SjLj_Register'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x58c5): undefined reference to `_Unwind_SjLj_Unregister'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x854f): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj):Container.cpp:(.text+0x8572): undefined reference to `_Unwind_SjLj_Resume'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../libtgui-s.a(Container.cpp.obj): bad reloc address 0x24 in section `.rdata'
collect2.exe: error: ld returned 1 exit status

thanks for your help
#2
Hi,

I call bindCallback from a tgui::Button::Ptr with the trigger set to tgui::Button::ReturnKeyPressed, to close the window when the return key is pressed. It does not work and nothing is happening when I press the return key.

Here is the smallest code that show my problem :

#include <iostream>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <TGUI/TGUI.hpp>

int main()
{
sf::RenderWindow window(sf::VideoMode(800, 600), "Title");
tgui::Gui gui(window);

tgui::Button::Ptr button(gui);
button->load("widgets/Black.conf");
button->setSize(260, 60);
button->setPosition(270, 240);
button->bindCallback(&sf::Window::close, (sf::Window *)&window , tgui::Button::ReturnKeyPressed);

while (window.isOpen())
{
sf::Event event;

while (window.pollEvent(event))
{
gui.handleEvent(event);

if (event.type == sf::Event::Closed)
window.close();
}

window.clear();
gui.draw();
window.display();
}

return 0;
}



If I change tgui::Button::ReturnKeyPressed to tgui::Button::LeftMouseClicked the window close when I click the button.

Can someone please help me  :)