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 - glagan

#1
Installation help / Compiling TGUI for Android
12 October 2018, 22:13:29
Hi, i'm trying to build (well, link) TGUI version 0.8 for Android but i'm having a bit of trouble.
I'm on Windows 10 and using GCC-6.3.0-1.

I already compiled SFML for Android with success, using the armeab-v7a ABI architecture and the example application is working fine.
I used the tutorial they have on Github (https://github.com/SFML/SFML/wiki/Tutorial%3A-Building-SFML-for-Android).

I also used the NDK r17c since it wasn't working with r18b, and SFML is in the /third_party folder as it should be.

So, everything is set up (I followed your tutorial) and I used cmake:
cmake -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=/ndk -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_BUILD_TYPE=Debug .. -G "MinGW Makefiles"
-- Android: Targeting API '28' with architecture 'arm', ABI 'armeabi-v7a', and processor 'armv7-a'
-- Android: Selected GCC toolchain 'arm-linux-androideabi-4.9'
-- The C compiler identification is GNU 4.9.0
-- The CXX compiler identification is GNU 4.9.0
-- Check for working C compiler: /ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc.exe
-- Check for working C compiler: /ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++.exe
-- Check for working CXX compiler: /ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found SFML 2.5.0 in C:/SFML/lib/cmake/SFML
-- Configuring done
-- Generating done
-- Build files have been written to: /TGUI/armeabi-v7a


I shortened the ndk path but I used a good and working one. Everything is still fine, so I build TGUI.
mingw32-make
... everything compile ...
[97%] Linking CXX shared library ..\..\lib\libtgui-d.so
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-graphics-d-2.dll:1:3: invalid character
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-graphics-d-2.dll:1:3: syntax error, unexpected $end
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-graphics-d-2.dll: not an object or archive
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-window-d-2.dll:1:3: invalid character
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-window-d-2.dll:1:3: syntax error, unexpected $end
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-window-d-2.dll: not an object or archive
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-system-d-2.dll:1:3: invalid character
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-system-d-2.dll:1:3: syntax error, unexpected $end
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-system-d-2.dll: not an object or archive
collect2.exe: error: ld returned 1 exit status
src\TGUI\CMakeFiles\tgui.dir\build.make:2176: recipe for target 'lib/libtgui-d.so' failed
mingw32-make[2]: *** [lib/libtgui-d.so] Error 1
CMakeFiles\Makefile2:86: recipe for target 'src/TGUI/CMakeFiles/tgui.dir/all' failed
mingw32-make[1]: *** [src/TGUI/CMakeFiles/tgui.dir/all] Error 2
Makefile:128: recipe for target 'all' failed
mingw32-make: *** [all] Error 2


And that's the error, the .dll used when linking have "invalid character", but the .dll are working and I am using them, I also compiled them myself using the same compiler.
Am I supposed to build SFML with the same toolchain as the one used by the NDK, or do I need to pass the toolchain I used ?
Also, is the linker supposed to use the lib build for Windows and not those build for Android (in the ndk folder) ?

Thanks.
#2
Help requests / ChildWindow closed event
13 August 2018, 21:11:05
Hi, when you set a callback to the "closed" event of a ChildWindow, the program just crash.
This code doesn't work :
auto child = tgui::ChildWindow::create();
child->connect("closed", [&](tgui::ChildWindow::Ptr window) {
    std::cout << "callback" << std::endl;
});
gui.add(child); // Closing the window make the program crash.

However, this only happen when the "-O2" flag is set when compiling, when there is no "-O" flag and the "-g" flag is set the program works fine, so i can't enter debug mode either to know what's happening...  :-\
#3
Hi, I'm creating a menu that is hidden by default, and when i click a button, it is introduced with a nice showWithEffect().
The thing here is that the button is binded to the right of the menu, and it moves with it when it's showing. Everything is fine for now, the default width of the menu is it's real size and buttons are binded to 0% by default.
I also hide the menu with hideWithEffect(), and the problem is here, after hideWithEffect is called it's original position is set back, and so my buttons are to the right again, floating in the middle of nowhere.

So, i want the buttons to actually stay at 0%, on the left, after the animation is over.
To achieve that i created a tiny class "Timer" that execute an action after a set amount of time, and i use that to set the buttons position to 0 after the same amount of time as the animation.
My solution seems kind of overkill, so is there an easier solution that i just didn't think of or not ?  :-X

Here is what's happening on the first link, and what i want to achieve on the second link (working with my solution):
First gif https://gfycat.com/IdolizedOptimalCondor and the second gif https://gfycat.com/GleamingWavyGodwit

Also, i'm actually creating the menus (3 of them in the gif) individually, by that i mean that each menu is totally independent from the others.
I actually did that for a reason. On my first try, i did a "MenuContainer" where i would put menus inside and hide them at choice, but i couldn't scroll a ScrollablePanel inside a panel and so i create them "individually".
Does ignoreMouseEvents() could actually help me scroll in a panel inside another panel ? Or another option that i didn't see ? I'm actually asking before trying again because i don't want to try everything again if there is no solution :x

Thanks and sorry for the long post.
#4
Hi, when you add ToolTips to elements in a ScrollablePanel, the tooltip stay fixed, after scrolling the tooltip is at the same place.

Thanks.