Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML binaries and the latest code::blocks Mingw  (Read 9496 times)

0 Members and 2 Guests are viewing this topic.

Smithson

  • Newbie
  • *
  • Posts: 6
    • View Profile
SFML binaries and the latest code::blocks Mingw
« on: February 08, 2016, 09:16:06 pm »
Hi,
I am a self taught programmer using the code::blocks ide and the mingw compiler on a window7 machine.
After following the instructions on installing sfml in the tutorial I can't get the demo to compile.
Apparently the sfml binaries for the latest compiler that came with the code::blocks download are incompatible.
It was suggested I cmake my own binaries but really don't have the know how to follow the instructions which say do x,y and z but not how to do x,y and z.
Will SFML eventually make binaries available or make availbale an automatic project icon for code::blocks?
I have no trouble with console programs as all I do is click the console icon to set it up.
Also I have no trouble with more advanced languages which don't require a convoluted complicated set of actions to get a library working.
Any suggestions are welcome.

ramaskrik

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: SFML binaries and the latest code::blocks Mingw
« Reply #1 on: February 08, 2016, 09:50:13 pm »
Hi.

Apparently the sfml binaries for the latest compiler that came with the code::blocks download are incompatible.
What does it mean that "binaries are incompatible" ? Does compiler/linker/runtime give you any errors? If yes, what errors are they?
Did you follow this tutorial? http://www.sfml-dev.org/tutorials/2.3/start-cb.php


It was suggested I cmake my own binaries but really don't have the know how to follow the instructions which say do x,y and z but not how to do x,y and z.
There's a tutorial on compiling SFML with CMake. Where did you get stuck?

Smithson

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SFML binaries and the latest code::blocks Mingw
« Reply #2 on: February 08, 2016, 11:01:15 pm »
Thanks for your response ramaskrik. What I was hoping was the SFML team would provide the binaries or better still a project icon that works.  Code::blocks does have an outdated SFML project icon it just need updating.

Yes I did try and follow the tutorial which was written for the SFML-2.0

After many errors it finally "compiled" but would would not run and it was then I was told that the binaries were incompatible with the compiler being used.

=======================================================================================

I started up Code::Blocks and chose an empty project that I called graphic1 and followed the instructions which were to,
Add a "main.cpp" file to your project,
which I did by File > New > File ... >
and selecting a C/C++ source File icon calling it main.cpp as instructed and pasting in the given source code.


Then I tried to build/run it and keep getting a message box,
"It seems this that this project has not been built yet."
"Do you want to build it now?"

Selecting [yes] just keeps popping up the same message box.

The error output is:

-------------- Build: Debug in graphics1 (compiler: GNU GCC Compiler)---------------

Linking stage skipped (build target has no object files to link)
Nothing to be done (all items are up-to-date).


-------------- Run: Debug in graphics1 (compiler: GNU GCC Compiler)---------------

Checking for existence: C:\SFML-2.3.2\examples\graphics1\bin\Debug\graphics1.exe

No idea what to do with that information.
==================================================================================

Have downloaded CMake. Can't find any exe program to start it up.

Also it appears you must buy "Mastering CMake" and "CMake training course" to even begin understand how to use it.

For starters the tutorial to use Cmake writes,
Now you are ready to run CMake. In fact there are three different ways to run it:
cmake-gui

Managed to find,
cmake-gui.1.rst file
but it doesn't run a gui for cmake when I double click it.

The point is there is one complication added to another in trying to resolve this issue which could be resolved if the SFML team provided binaries or something like the dev-pak to just run and then any program with #include SFML would just work! It is like they only want computer science graduates to use the product not old self taught hobby programmers. I used TurboC++ on my old MSDOS machine but of course back then it was easy to program the graphics hardware yourself no libraries required.
.
My gripe with SFML is it shouldn't be this hard to use the library. I don't want to have to become an expert in the developmental environment of C++ to do something as simple as using a library when simply typing #include SFML should do the trick as it does with other advanced languages.
.
« Last Edit: February 08, 2016, 11:06:27 pm by Smithson »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: SFML binaries and the latest code::blocks Mingw
« Reply #3 on: February 09, 2016, 09:15:53 am »
The point is there is one complication added to another in trying to resolve this issue which could be resolved if the SFML team provided binaries or something like the dev-pak to just run and then any program with #include SFML would just work! It is like they only want computer science graduates to use the product not old self taught hobby programmers. I used TurboC++ on my old MSDOS machine but of course back then it was easy to program the graphics hardware yourself no libraries required.
.
My gripe with SFML is it shouldn't be this hard to use the library. I don't want to have to become an expert in the developmental environment of C++ to do something as simple as using a library when simply typing #include SFML should do the trick as it does with other advanced languages.
.
There has been a new release of Code::Blocks 10 days ago that ships a new compiler we've no package for yet. While we try to keep things uptodate all the time, we're also just humans and volunteers and can't just magically update everything within a few days. I'll make sure to look into it however. In the mean time it really is recommended for you to just build from source.

Using SFML is very easy and we provide a lot of information and guidance that you won't find for other libraries. The real problem here is your lack of experience with C++ libraries in general, i.e. how to link them, how to build them, what compiler versions exists, how the runtime libs need to be linked, etc.
That's not really a problem because everyone starts out somewhere, but it's unfair and wrong to blame other things just because one doesn't immediately understand things. ;)

You don't have to learn the ins and outs of CMake just to use it. Instead take a look at the tutorial we provide, which will explain all the various CMake variables you can change and then all you need to do is run the CMake GUI, adjust things and run mingw32-make install.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

ramaskrik

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: SFML binaries and the latest code::blocks Mingw
« Reply #4 on: February 09, 2016, 03:19:12 pm »

Yes I did try and follow the tutorial which was written for the SFML-2.0

After many errors it finally "compiled" but would would not run and it was then I was told that the binaries were incompatible with the compiler being used.
Make sure you're following SFML tutorial for the same version you're linking against.

I started up Code::Blocks and chose an empty project that I called graphic1 and followed the instructions which were to,
Add a "main.cpp" file to your project,
which I did by File > New > File ... >
and selecting a C/C++ source File icon calling it main.cpp as instructed and pasting in the given source code.


Then I tried to build/run it and keep getting a message box,
"It seems this that this project has not been built yet."
"Do you want to build it now?"

Selecting [yes] just keeps popping up the same message box.

The error output is:

-------------- Build: Debug in graphics1 (compiler: GNU GCC Compiler)---------------

Linking stage skipped (build target has no object files to link)
Nothing to be done (all items are up-to-date).


-------------- Run: Debug in graphics1 (compiler: GNU GCC Compiler)---------------

Checking for existence: C:\SFML-2.3.2\examples\graphics1\bin\Debug\graphics1.exe

No idea what to do with that information.
This seems like main.cpp hasn't been build. Try to follow this: http://hongouru.blogspot.sk/2012/02/s-o-l-v-e-d-codeblocks-it-seems-that.html
If that doesn't work, Google. If you you are not able to find the solution in 4-5 hours, then come back to the thread. One of the requirements of a good programmer is the ability to Google out (or find out otherwise) the information they need, which requires the ability to describe the problem and provide essential information. The truth usually is, that if you're having a problem with something, someone else had this problem already.

Have downloaded CMake. Can't find any exe program to start it up.

Also it appears you must buy "Mastering CMake" and "CMake training course" to even begin understand how to use it.

For starters the tutorial to use Cmake writes,
Now you are ready to run CMake. In fact there are three different ways to run it:
cmake-gui

Managed to find,
cmake-gui.1.rst file
but it doesn't run a gui for cmake when I double click it.

The point is there is one complication added to another in trying to resolve this issue which could be resolved if the SFML team provided binaries or something like the dev-pak to just run and then any program with #include SFML would just work! It is like they only want computer science graduates to use the product not old self taught hobby programmers. I used TurboC++ on my old MSDOS machine but of course back then it was easy to program the graphics hardware yourself no libraries required.
.
My gripe with SFML is it shouldn't be this hard to use the library. I don't want to have to become an expert in the developmental environment of C++ to do something as simple as using a library when simply typing #include SFML should do the trick as it does with other advanced languages.
.
Not true. I am a self-taught programmer, never went to a ComputerScience/SoftwareEngineering school of any kind and am able to link to SFML/other libs, compile it with CMake (wonderful tool, actually), etc.. I even use it for my own personal projects. It just has a learning curve you gotta get past, and then it's all a cake thing.

Programming is not just writing code. It also contains things like setting up an environment. I myself spent a week ago whole day setting up (install deps)/(download repo)/(compile repo) cycle on my VPS, using CMake and shell script. For both Windows and Linux (cross-compile). Now I just push to the repo and execute one file on VPS and I have compiled binaries for Linux and Windows on my FTP. It took me one day, but now I can use it for any SFML project I want (and with minor changes for others too).

On the other hand, if you want to make your life easier where you can, when programming, switch to Linux. That is my personal advice to you. Again, it has some learning curve, but once you're in, you never go back (except for testing your windows builds).

Smithson

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SFML binaries and the latest code::blocks Mingw
« Reply #5 on: February 09, 2016, 09:21:08 pm »
@eXpl0it3r,

Quote
While we try to keep things uptodate all the time, we're also just humans and volunteers and can't just magically update everything within a few days.

Of course and I don't expect anything more and appreciate that there are those able and willing to take on such projects. SFML was recommended and I am just disappointed I am unable to get it working. I am sure it is easy for 99% of other users I just lack the know how.

Quote
The real problem here is your lack of experience with C++ libraries in general,...


Zero experience. Yes that is the problem. As I wrote I am a part time self taught hobby programmer with very limited spare time and I would rather get on with coding a project than time learning how to set up the coding environment particularly as this is something software is capable of doing automatically as shown by the DevPak which I used many years ago with the Bloodshed DevC++ development environment and the console project icon I use with code::blocks.

Quote
... but it's unfair and wrong to blame other things just because one doesn't immediately understand things.

There is no blame intended just a signal to say that it acts as a barrier to non-professionals taking on C++ and instead using Java (yuck) or C# instead. If SFML is too hard for me I will probably just get back up to speed with the Window's API for my current project.
.

Smithson

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SFML binaries and the latest code::blocks Mingw
« Reply #6 on: February 09, 2016, 09:24:17 pm »
@ramaskrik,

Quote
Make sure you're following SFML tutorial for the same version you're linking against.

The only SFML tutorial I could find only covers SFML 2.0

Quote
... I am a self-taught programmer, never went to a ComputerScience/SoftwareEngineering school of any kind and am able to link to SFML/other libs, compile it with CMake (wonderful tool, actually), etc..

Programming and electronics has only been an occasional part time hobby for me so I really haven't had the spare time from the real world to learn all that stuff. With other advanced languages you don't need to. Why then do I want to use C++? C++ has a low learning curve for me because I used TurboC++ for DOS in ye olden days and I liked it. I have dabbled with Java and c#.

Quote
On the other hand, if you want to make your life easier where you can, when programming, switch to Linux.

I nearly did that a long time ago but Linux didn't have the hardware support I needed at the time. As time is always an issue I need good reason to go through another learning curve . Perhaps if I decide to buy a Raspberry Pi I might just have to learn Linux.
.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: SFML binaries and the latest code::blocks Mingw
« Reply #7 on: February 09, 2016, 09:33:20 pm »
@ramaskrik,

Quote
Make sure you're following SFML tutorial for the same version you're linking against.

The only SFML tutorial I could find only covers SFML 2.0
http://www.sfml-dev.org/tutorials/2.3/compile-with-cmake.php

http://www.sfml-dev.org/tutorials/2.3/start-cb.php

Find lots more here: http://www.sfml-dev.org/learn.php
It's linked from the front page - not like it's hidden or anything.

ramaskrik

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: SFML binaries and the latest code::blocks Mingw
« Reply #8 on: February 09, 2016, 10:18:50 pm »

Programming and electronics has only been an occasional part time hobby for me so I really haven't had the spare time from the real world to learn all that stuff. With other advanced languages you don't need to. Why then do I want to use C++? C++ has a low learning curve for me because I used TurboC++ for DOS in ye olden days and I liked it. I have dabbled with Java and c#.

C++ is one of the languages, which is (sometimes) hard to grasp even for people who have worked with it for some time (mainly talking about the new C++ stuff added in 11/14/17). Modern C++ is a bit further away from what it used to be (although the old stuff still works). It's even more complicated to hop in to C++ than to C# (based on spec page number). If you are not willing to spend some time learning new stuff, and still wanna make games, I advise you to go with either a binding of SFML (like Python for instance) or Löve2D. Löve2D has almost zero learning curve, and brings some amazing products.

Smithson

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SFML binaries and the latest code::blocks Mingw
« Reply #9 on: February 10, 2016, 02:28:44 am »
@Jesper Juhl,

Yes I worked through the tutorial but was unable to get the latest SFML version to work with the code::blocks and MingW as explained in previous posts. And I did download the CMake but couldn't find any GUI to run as mentioned in previous posts. I am not lazy I just haven't the knowledge to convert "do x,y and z" into "how to do x,y and z".
.

Smithson

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SFML binaries and the latest code::blocks Mingw
« Reply #10 on: February 10, 2016, 02:31:32 am »
@ramaskrik,

I don't write games my interest at the moment is interfacing to my own electronic hardware and needed graphics to make a nice GUI interface. I see the computer as a big programmable chip which happens to come with a limited set of input/outputs, namely, monitor, printer, keyboard, mouse and so on.

In fact I only use a limited number of C statements although I use cin cout and I might include using objects written by others. At the moment I am playing with the Arduino board and it is programmed in a C like language and it has libraries of objects of which Serial.println is an example.

It is an intellectual pass time to keep the old brain working. I just find electronics and programming more fun than doing cross word puzzles.
.