Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
Help requests / Issues with linking TGUI
« Last post by TheP4R4D0X on 05 April 2019, 23:25:59 »
Greetings,
So finally got SFML working now trying to get TGUI working.
Linux Mint - 19.1, 64-bit.
SFML: 2.5.1
TGUI: 0.8.4
g++ compiler, cmake and make - all up-to-date.

I tried installing TGUI from the PPA - however, it kept giving me warnings that it was trying to use an older version of SFML (2.4.1) which got installed as a requirement - however, I wanted to use the "latest" stuff (may or may not be a requirement - BUT I would prefer it).

I downloaded the source of both SFML and TGUI - successfully built both of them (to ensure they work together and with compiler).
now trying to create a project and having issues with an sf::String::operator.

I am using CMakeLists.txt to generate the project (just started to learn the basics for cmake): follows:
---------------------------------------------------------------------------------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.10.2)
project(PROJECTNAME_REMOVED_FOR_REASONS)

include_directories(../includes includes includes/gameManagement)

file(GLOB SOURCES "src/*.cpp" "src/gameManagement/*.cpp")

set(SFML_DIR "../Base/SFML-2.5.1/lib/cmake/SFML")
set(TGUI_DIR "../Base/TGUI-0.8.4")

find_package(SFML 2.5.1 COMPONENTS system window graphics REQUIRED)
find_package(TGUI 0.8.4 REQUIRED)
add_executable(EXEC_NAME ${SOURCES})
target_link_libraries(EXEC_NAME sfml-system sfml-window sfml-graphics tgui)
---------------------------------------------------------------------------------------------------------------------------------------------------------

the output I get is:
---------------------------------------------------------------------------------------------------------------------------------------------------------
-- Found SFML 2.5.1 in /home/USER/Desktop/SFML/Base/SFML-2.5.1/lib/cmake/SFML
-- Found TGUI 0.8.4 in /home/USER/Desktop/SFML/Base/TGUI-0.8.4
-- Configuring done
-- Generating done
-- Build files have been written to: /home/USER/Desktop/SFML/PROJECTNAME/build
Scanning dependencies of target EXEC_NAME
[ 25%] Building CXX object CMakeFiles/EXEC_NAME.dir/src/main.cpp.o
[ 50%] Building CXX object CMakeFiles/EXEC_NAME.dir/src/gameManagement/Engine.cpp.o
[ 75%] Building CXX object CMakeFiles/EXEC_NAME.dir/src/gameManagement/UserSettings.cpp.o
[100%] Linking CXX executable EXEC_NAME
/home/USER/Desktop/SFML/Base/TGUI-0.8.4/lib/libtgui.so.0.8.4: undefined reference to `sf::String::operator std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >() const'
collect2: error: ld returned 1 exit status
CMakeFiles/EXEC_NAME.dir/build.make:150: recipe for target 'EXEC_NAME' failed
make[2]: *** [EXEC_NAME] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/EXEC_NAME.dir/all' failed
make[1]: *** [CMakeFiles/EXEC_NAME.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
mv: cannot stat 'EXEC_NAME': No such file or directory
./EXEC_NAME: error while loading shared libraries: libtgui.so.0.8.4: cannot open shared object file: No such file or directory
---------------------------------------------------------------------------------------------------------------------------------------------------------

TLDR: /home/USER/Desktop/SFML/Base/TGUI-0.8.4/lib/libtgui.so.0.8.4: undefined reference to `sf::String::operator std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >() const'
Is what is giving me the issue... I saw someone else had this issue https://forum.tgui.eu/installation-help/undefined-reference-to-sfstringoperator/
However, that is not helpful for the current version. If all else fails - yes I can just download the versions of SFML and TGUI as found in the package manager >_>...

Thanks
22
General Discussion / Re: Menu with 3 level
« Last post by billarhos on 04 April 2019, 16:55:21 »
Hi

do something like that:

Code: [Select]
menu->addMenuItem({ "File", "Save", "Backup" });
23
General Discussion / Menu with 3 level
« Last post by asuchi on 04 April 2019, 10:47:27 »
Hello all,

I try to make a menu with 3 level ... Like  File>save>File or File>save>backup.

Tgui avec menu and item menu but i dont found the solution for my problem.

Sorry for my english ;)
24
Help requests / Re: button->connect member functions
« Last post by Simon on 24 March 2019, 17:16:23 »
Ah, the error was what you caught with the extra parameter while connecting the buttonGenerateRW, seems to work fine now.
Thanks for your help and for creating a great tool for making GUIs.

Simon.
25
Help requests / Re: button->connect member functions
« Last post by texus on 24 March 2019, 17:09:47 »
The parameters for generateRW don't match, in the connect function you pass one parameter too much, the m_ebChanceStartAlive.

The generateCA line looks fine, assuming the edit boxes are declared like this in the App class:
tgui::EditBox::Ptr m_ebNumSimulationSteps;

Can you show the full errors you get on the m_buttonGenerateCA->connect call?
26
Help requests / Re: button->connect member functions
« Last post by Simon on 24 March 2019, 17:04:49 »
Yes of course

Code: [Select]
App instance;

Code: [Select]
void generateRW(tgui::EditBox::Ptr ebMaxWalkers,
tgui::EditBox::Ptr ebFillPercentage,
tgui::EditBox::Ptr ebChanceToChangeDirection,
tgui::EditBox::Ptr ebChanceToDestroyWalker,
tgui::EditBox::Ptr ebChanceToSpawnNewWalker);
Code: [Select]

void generateCA(tgui::EditBox::Ptr ebNumSimulationSteps,
tgui::EditBox::Ptr ebBirthLimit,
tgui::EditBox::Ptr ebDeathLimit,
tgui::EditBox::Ptr ebChanceStartAlive);

Simon
27
Help requests / Re: button->connect member functions
« Last post by texus on 24 March 2019, 17:01:12 »
Can you show the declarations of generateRW, generateCA, instance and the other parameters you are passing?
28
Help requests / button->connect member functions
« Last post by Simon on 24 March 2019, 16:54:34 »
Hi, I'm creating a GUI for an application used to create random level layouts.

I'm trying to connect a button using member functions and member variables. I tried following some other topics and the introduction to signals post but to to avail.

Here is some code to show what I'm trying to do:
   
Code: [Select]
m_buttonGenerateRW->connect("pressed", &App::generateRW,
&instance,
m_ebMaxWalkers,
m_ebFillPercentage,
m_ebChanceToChangeDirection,
m_ebChanceStartAlive,
m_ebChanceToDestroyWalker,
m_ebChanceToSpawnNewWalker);

Code: [Select]
m_buttonGenerateCA->connect("pressed", &App::generateCA,
&instance,
m_ebNumSimulationSteps,
m_ebBirthLimit,
m_ebDeathLimit,
m_ebChanceStartAlive);

Any help would be greatly appreciated,

Simon
29
Help requests / Re: Grid
« Last post by nolimitee on 14 March 2019, 20:59:46 »
Ok, yeah for the instance I showed with only the grid in it, but in my program I have more than one :)

So I tested with the fix and it works great, thanks for your support !
30
Help requests / Re: Grid
« Last post by texus on 14 March 2019, 20:02:53 »
VerticalLayout spreads the entire height among all widgets inside it, in this case just the Grid. So the height of the VerticalLayout (100% of parent by default) will be passed to the Grid. So you can just limit the height of the vertical layout:
verticalLayout_->setSize("100%", 150);

But if you are only putting 1 widget in VerticalLayout then you don't need it and you can just add the Grid directly to the container and call that setSize function on the grid widget.
Pages: 1 2 [3] 4 5 ... 10