Code::Blocks

Started by johnhoth, 10 May 2018, 13:46:57

johnhoth

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

texus

QuoteBut 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

johnhoth

1) Should i make an empty project?

2) Is your link for non-dll stuff?

texus

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.

johnhoth

#4

texus

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.

johnhoth

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.


texus

_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.

johnhoth

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

Pls help me.

texus

#9
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).

johnhoth

I have reinstalled codeblocks, sfml, tgui.

And it is working.

Thank you for everything.

Your TGUI is AMAZING