SFML community forums

Help => General => Topic started by: Menthro on January 28, 2017, 09:11:13 am

Title: Installation with MinGW64
Post by: Menthro on January 28, 2017, 09:11:13 am
Okay guys and girls, I would really appreciate some help here. This is the first time I have ever needed to install a library for use. I am running MinGW64 but NOT code::blocks. Can anyone give me a helping hand on how to do this properly?
Title: Re: Installation with MinGW64
Post by: Laurent on January 28, 2017, 09:43:02 am
Quote
I am running MinGW64 but NOT code::blocks
It's helpful to know what you don't use, but it would be even more helpful to know what you use. Command line? Makefile? Another IDE?

Quote
Can anyone give me a helping hand on how to do this properly?
You should rather explain what's blocking you, because nobody's going to write a complete tutorial for you here ;)
Title: Re: Installation with MinGW64
Post by: Menthro on January 28, 2017, 08:03:31 pm
Quote
I am running MinGW64 but NOT code::blocks
It's helpful to know what you don't use, but it would be even more helpful to know what you use. Command line? Makefile? Another IDE?

Quote
Can anyone give me a helping hand on how to do this properly?
You should rather explain what's blocking you, because nobody's going to write a complete tutorial for you here ;)

I am using Sublime 3 to build and command line to run. What is blocking me is I just am not sure at all how to use the library, can I just throw it somewhere in C: and include it in the program somehow?
Title: Re: Installation with MinGW64
Post by: Mario on January 28, 2017, 11:07:47 pm
I'd suggest you use the (IMO) easiest approach:
This way all SFML files will land in the right folders for the MinGW components to find them just like it happens on Linux.

Let's assume MinGW is installed in "C:\MinGW", so I'd run the following commands:

cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=C:/MinGW C:/SFML/source
cmake --build . --config Debug --target install
cmake --build . --config Release --target install

Running these three lines will build and install both debug and release builds of SFML.
Title: Re: Installation with MinGW64
Post by: jamesL on January 29, 2017, 04:35:08 am
I'd suggest you use the (IMO) easiest approach:
  • Download SFML's source (either zipped or by cloning the repository).
  • Download and install CMake.
  • Create the proper makefiles to build SFML, but also set the installation folder to your MinGW folder.
  • Build and install SFML.
This way all SFML files will land in the right folders for the MinGW components to find them just like it happens on Linux.

Let's assume MinGW is installed in "C:\MinGW", so I'd run the following commands:

cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=C:/MinGW C:/SFML/source
cmake --build . --config Debug --target install
cmake --build . --config Release --target install

Running these three lines will build and install both debug and release builds of SFML.

why not just download the prebuilt GCC 6.1.0 MinGW (SEH) - 64-bit from here
http://www.sfml-dev.org/download/sfml/2.4.1/

I think that is far and away the easier approach

in your example
where do you run the cmake command from
C:\MinGW ?
the cmake installation folder ?
the sfml download folder ?
Title: Re: Installation with MinGW64
Post by: Mario on January 29, 2017, 11:26:02 am
From the folder including the SFML sources. You can just download precompiled SFML, if it works for you, but there's always the chance people pick the wrong one. :)

If you're grabbing the precompiled one, just extract it to your MinGW installation folder, i.e. SFML's "lib" should overlap with MinGW's "lib". Same for "include".