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

Author Topic: [SOLVED] Help with SFML2.1 and Mingw-builds  (Read 2026 times)

0 Members and 1 Guest are viewing this topic.

NeomerArcana

  • Newbie
  • *
  • Posts: 12
    • View Profile
[SOLVED] Help with SFML2.1 and Mingw-builds
« on: November 22, 2013, 10:20:16 am »
Hi all,

I'm trying to successfully build SFML2.1 using the latest from http://code.google.com/p/mingw-builds/downloads/list. I'm doing this specifically because it supports std::thread on windows (I do not want to use boost or any other library).

I managed to build the libraries using cmake. But the when I compile a project using this new compiler and libraries I get a bunch of "multiple definition of" errors. (The project successfully compiles under sfml2.1 and gcc 4.7.0 (that comes with Code::Blocks 12.11))

The only thing I've noticed is that the configuration in cmake lists the code:blocks version of mingw32-make as the CMAKE_MAKE_PROGRAM. I'm unable to edit it due to the endless loop error you get for changing toolchain executables. I've tried changing the environment PATH to use my new google sourced compilers mingw32-make but it doesn't seem to pick it up.

Anyway, I'm not sure that's the problem.

Any help would be appreciated. If anyone can try building and compiling an SFML test project with the above mingw-build project it would help a lot.
« Last Edit: November 22, 2013, 11:14:25 pm by NeomerArcana »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Help with SFML2.1 and Mingw-builds from Google
« Reply #1 on: November 22, 2013, 10:33:53 am »
Note that the ones listed on Google Code doesn't have anything to do with Google itself and they are outdated! The project has since moved over the Sourceforge: http://sourceforge.net/projects/mingwbuilds/

If it finds the wrong toolchain then it's no wonder when things go wrong. ;)

Make sure your PATH only contains the path to the mingw builds compiler, you might have to relog to make sure the change takes full affect on the system, if you run cmake from a command line, make sure to restart the command line.
Next you need to delete the CMake cache. I always run CMake from a separate build directory, so if I need to rest CMake I can just delete that build directory, without having CMake spam your source directory.

That way it should work flawlessly.

For my setup with around 10 different compilers, I never have any set in PATH, but whenever I open a new command line for compiling I quickly set the environment variable: set PATH=C:\Dev\MinGW32-XYZ\bin;%PATH%
Then I run cmake-gui and make sure to let it generate its files in patch-to-source/build. Don't forget to set a valid install directory!
After generating is done you switch to the build directory and run mingw32-make install -j4
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

NeomerArcana

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Help with SFML2.1 and Mingw-builds from Google
« Reply #2 on: November 22, 2013, 11:28:23 am »
Thanks for the link to the updated library. I downloaded that using the installer.

I removed the code::blocks mingw from my Path variable and replaced it with the above installed directory. CMake picked up my new compiler easy. I built SFML2.1 using it no errors.

I then checked my toolchain and search directory settings in code::blocks, updated to my new ming2-build. Double checked it.

I'm getting the same error.

At this point, I see nothing wrong with the toolchain. Any other thoughts?

NeomerArcana

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Help with SFML2.1 and Mingw-builds from Google
« Reply #3 on: November 22, 2013, 11:14:00 pm »
Problem was solved:

I don't quite understand why. But I placed all the generated .dll files in the project directory and it worked. I overwrote some old .dll files that were in there. I thought this would only affect the .exe during execution, not compile time, but maybe code::blocks looks in the project directory for files before it goes looking in the seach directories?