TGUI Forum

General Category => Installation help => Topic started by: johnhoth on 10 May 2018, 13:46:57

Title: Code::Blocks
Post by: johnhoth on 10 May 2018, 13:46:57
Hi, i am new at sfml and tgui.

I haven't any expirience in project programming only in programming competitions (codeforces.com).

My school project is local network sfml chat.

But i can't build my project using tgui.

I am interested in instuction how to make codeblocks gui project (it should do nothing).

Thank you for answering.

P.S. sorry for my french english i am from Moscow
Title: Re: Code::Blocks
Post by: texus on 10 May 2018, 13:54:38
Quote
But i can't build my project using tgui.
You should provide more details about what isn't working exactly. If the problem is with setting up codeblocks then have a look at the following tutorial: https://tgui.eu/tutorials/v0.7/codeblocks-precompiled/

In case you have problems with building the library:
SFML 2.5 was just released and comes with a precompiled library for TDM GCC 5.1 (which is the compiler that Code::Blocks 17.12 uses by default). There should be a corresponding precompiled TGUI library on my download page later today, but for now you can download it directly from this link: TGUI-0.7.7-mingw-5.1.0-tdm-32bit-for-SFML-2.5.0.zip (https://github.com/texus/TGUI/releases/download/0.7.7/TGUI-0.7.7-mingw-5.1.0-tdm-32bit-for-SFML-2.5.0.zip)
Title: Re: Code::Blocks
Post by: johnhoth on 10 May 2018, 16:06:59
1) Should i make an empty project?

2) Is your link for non-dll stuff?
Title: Re: Code::Blocks
Post by: texus on 10 May 2018, 16:17:57
1)
Yes, just create an empty project and add a new file to it (e.g. using File > New > Empty File in the menu bar).
Then go into the settings (Project > "Build Options..." in menu bar) and configure it to find SFML and TGUI as described in https://www.sfml-dev.org/tutorials/2.5/start-cb.php and the link I gave earlier.

2)
The link is for either. For TGUI the only difference is the "-s" behind the filename. For SFML (see link in previous part of this post) it makes a bigger difference, but that tutorial also explains what you must do. If you link statically (no dlls) then you must also add the SFML dependencies (list is in the tutorial) to the linker options. When linking dynamically (with dlls) you must copy the sfml and tgui dlls next to the executable in order to run it.
Title: Re: Code::Blocks
Post by: johnhoth on 17 May 2018, 16:20:42
Hello everyone, get in here.

Today I am continue my misadventures.

Here is some screenshots of my codeblocks project.

Also i should say that sfml is working.

My thanks for any help.

https://www.dropbox.com/s/zls1d0htk2cq28g/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202018-05-17%2017.09.51.png (https://www.dropbox.com/s/zls1d0htk2cq28g/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202018-05-17%2017.09.51.png)

https://www.dropbox.com/s/mnj6738cgmw6r39/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202018-05-17%2017.10.25.png (https://www.dropbox.com/s/mnj6738cgmw6r39/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202018-05-17%2017.10.25.png)

https://www.dropbox.com/s/clz0bm6tc34fahk/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202018-05-17%2017.12.16.png (https://www.dropbox.com/s/clz0bm6tc34fahk/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202018-05-17%2017.12.16.png)

https://www.dropbox.com/s/45ppgeakzqos7eb/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202018-05-17%2017.15.46.png (https://www.dropbox.com/s/45ppgeakzqos7eb/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202018-05-17%2017.15.46.png)

Also you can stay in touch with my by Telegram. @179johnhoth, remove 179 from beginning to get my nickname (it is protection from bots)
Title: Re: Code::Blocks
Post by: texus on 17 May 2018, 17:55:31
The most important thing to check for these errors is under the "Linker settings" tab. Based on the errors I would guess you are linking to static SFML libraries (ending with -s but with dynamic TGUI libs, or the other way around). Make sure both SFML and TGUI have the same suffixes (combinations of "-s" and "-d") and that SFML_STATIC is defined under "Compiler settings" > "#defines" when linking to SFML and TGUI statically.
Title: Re: Code::Blocks
Post by: johnhoth on 18 May 2018, 20:08:24
Hi!

Let's begin with BIG THANKS to texus, i fixed those errors by his method

And I have some another yummy - about 6 errors (not in my project) with substing "_Unwind_Resume".

I am using last at (18 of may 2018) Code::Blocks, TGUI-0.8-dev and SFML-2.4.2

Thanks for any reply.

Title: Re: Code::Blocks
Post by: texus on 18 May 2018, 20:17:47
_Unwind_Resume indicates that the libraries were build for a different compiler version. Since SFML 2.4.2 had libraries build for TDM GCC 4.9 and the latest codeblocks uses TDM GCC 5.1 by default, that might be the issue.
Title: Re: Code::Blocks
Post by: johnhoth on 18 May 2018, 21:08:35
I have devolved my codeblocks to 16.01.

Now there some compiler errors, it is crying about syntaxis

Also i've add "#define _GLIBCXX_USE_CXX11_ABI 0".

https://drive.google.com/file/d/1DqxRwMJG5n6g8n0L7n1sRtjc2aykin3G (https://drive.google.com/file/d/1DqxRwMJG5n6g8n0L7n1sRtjc2aykin3G)

Pls help me.
Title: Re: Code::Blocks
Post by: texus on 18 May 2018, 22:22:27
Is "Enable c++14" (or "Enable c++1y") checked in the compiler settings?
Make sure to use an SFML and TGUI version that match each other and the compiler. SFML 2.5 only provides a build for GCC 5.1, similar to the TGUI 0.8 alpha version. If you use GCC 4.9 (from codeblocks 16.04) then you not only have to use the SFML 2.4.2 package but also a TGUI version that was build with SFML 2.4.2 and GCC 4.9 (like the pre-alpha versions). If you can't find matching versions then you could always build SFML and TGUI yourself with whatever compiler you want to use.

I would suggest just getting CodeBlocks 17.12, SFML 2.5 and TGUI 0.8-alpha, all using TDM GCC 5.1 (SJLJ).
Title: Re: Code::Blocks
Post by: johnhoth on 19 May 2018, 06:03:16
I have reinstalled codeblocks, sfml, tgui.

And it is working.

Thank you for everything.

Your TGUI is AMAZING