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

Author Topic: CMake (Code::Blocks MinGW) configuration error  (Read 8002 times)

0 Members and 2 Guests are viewing this topic.

Chris Curry

  • Newbie
  • *
  • Posts: 4
    • View Profile
CMake (Code::Blocks MinGW) configuration error
« on: February 08, 2014, 11:06:00 pm »
I am attempting to compile SFML on Windows 7 with Code::Blocks MinGW.  When configuring CMake (following the tutorial http://www.sfml-dev.org/tutorials/2.1/compile-with-cmake.php), I receive with the following error (in the error log):
Code: [Select]
Run Build Command:C:/PROGRA~2/CODEBL~1/MinGW/bin/mingw32-make.exe "cmTryCompileExec2280712720/fast"
C:/PROGRA~2/CODEBL~1/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTryCompileExec2280712720.dir\build.make CMakeFiles/cmTryCompileExec2280712720.dir/build

mingw32-make.exe[1]: Entering directory `C:/Program Files (x86)/SFML-2.1/SFML-2.1-built/CMakeFiles/CMakeTmp'

mingw32-make.exe[1]: Leaving directory `C:/Program Files (x86)/SFML-2.1/SFML-2.1-built/CMakeFiles/CMakeTmp'

mingw32-make.exe[1]: *** No rule to make target `x86)/SFML-2.1/SFML-2.1-built/CMakeFiles/CheckTypeSize/SIZEOF_VOID_PTR.c)', needed by `CMakeFiles/cmTryCompileExec2280712720.dir/SIZEOF_VOID_PTR.c.obj'.  Stop.

mingw32-make.exe: *** [cmTryCompileExec2280712720/fast] Error 2

Ironically (or not), it then pastes the entire file mentioned into the error log as well.  I assume there's something wrong with the CMake file, or my configuration, but I've no idea what to do from here...help?

Here's the CMake gui log:
Code: [Select]
The C compiler identification is GNU 4.7.1
The CXX compiler identification is GNU 4.7.1
Check for working C compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/gcc.exe
Check for working C compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/gcc.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - failed
Check for working CXX compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/g++.exe
Check for working CXX compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/g++.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Looking for sys/types.h
Looking for sys/types.h - found
Looking for stdint.h
Looking for stdint.h - found
Looking for stddef.h
Looking for stddef.h - found
Check size of void*
Check size of void* - failed
CMake Error at cmake/Config.cmake:13 (message):
  Unsupported architecture
Call Stack (most recent call first):
  CMakeLists.txt:20 (include)


Configuring incomplete, errors occurred!
See also "C:/Program Files (x86)/SFML-2.1/SFML-2.1-built/CMakeFiles/CMakeOutput.log".
See also "C:/Program Files (x86)/SFML-2.1/SFML-2.1-built/CMakeFiles/CMakeError.log".
« Last Edit: February 09, 2014, 01:32:45 am by Chris Curry »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: CMake (Code::Blocks MinGW) configuration error
« Reply #1 on: February 08, 2014, 11:26:42 pm »
Sounds like either CMake is broken or your MinGW version is.
You should try to reinstall CMake and if that doesn't help, upgrade your compiler (GCC 4.7.1 is already a bit dated to be honest).
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Chris Curry

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: CMake (Code::Blocks MinGW) configuration error
« Reply #2 on: February 08, 2014, 11:32:22 pm »
It's a fresh install of CMake and Code::Blocks.  I will install the latest MinGW version and point things there instead of to the version that came with Code::Blocks.

Note for others who may experience this issue:  the MinGW version packaged with Code::Blocks was the issue.  I had to install MinGW manually, then point the CMake gui to the correct native compilers.  Even though I removed the Code::Blocks compiler directory from my path and added the MinGW compiler directory, CMake found the Code::Blocks compilers and used them instead.

The fix:
Install MinGW from http://www.mingw.org/  (you'll need at least mingw-developer-toolkit, mingw32-base (c compiler), mingw32-gcc-g++ (c++ compiler), msys-base)
Close and open CMake gui
File -> Delete Cache
Set up according to above link, pointing to the SFML source and binary (output from CMake) directories
Click Configure
Use the MinGW Makefiles option (not the CodeBlocks - MinGW Makefiles option as it can cause further issues)
Click the Specify native compilers radio button
for c, specify %MinGW Installation Directory%/bin/gcc.exe
for c++, specify %MinGW Installation Directory%/bin/g++.exe
Click finish

continue to follow the tutorial above.
« Last Edit: February 09, 2014, 12:16:29 am by Chris Curry »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: CMake (Code::Blocks MinGW) configuration error
« Reply #3 on: February 09, 2014, 12:06:52 am »
How fresh can it be when the current Code::Blocks version comes with a newer compiler (TDM 4.8.1)? ;)

And no, I don't recommend getting the compiler from mingw.org. Their version has issues as well and it's not as actively maintained as the MinGW-w64 project, which also provides the option to create x64 applications. My go to compiler are the MinGW Builds.
« Last Edit: February 09, 2014, 12:09:12 am by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Chris Curry

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: CMake (Code::Blocks MinGW) configuration error
« Reply #4 on: February 09, 2014, 12:07:49 am »
I installed it 1 hour & 15 minutes ago.  Downloaded from their site...

(http://prdownload.berlios.de/codeblocks/codeblocks-13.12mingw-setup.exe)

Chris Curry

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: CMake (Code::Blocks MinGW) configuration error
« Reply #5 on: February 09, 2014, 12:49:12 am »
Thanks, by they way.

I never would have figured that out by myself.

I've got everything configured for code::blocks to use the official compiler.  If I have trouble with it (now that I've done this once), I can re-compile and make SFML and point the IDE to the correct compiler.