Difficulty Building OGRE using CMAKE

Problems building or running the engine, queries about how to use features etc.
Post Reply
asterlacnala
Gnoblar
Posts: 3
Joined: Tue Feb 05, 2019 10:28 pm

Difficulty Building OGRE using CMAKE

Post by asterlacnala »

Ogre Version: 1.11.5
Operating System: Windows 7 64-bit SP 1

I'm getting back into C++ programming after some time away, and would consider myself an intermediate programmer - I'm familiar with the basics of C++, somewhat familiar with some more advanced topics, but I have never gotten into Windows or graphics programming; it has all been console text stuff so far.

From the research I have done, my end goal isn't to become a graphics programmer so I thought Ogre3D would let me skip the backbone stuff of working with DirectX and OpenGL, and focus more on actual graphics stuff that interests me. However, I'm getting stuck pretty early on.

I tried to follow the tutorial on building OGRE, downloaded CMake, created a build directory at C:\OGRE that was not my source directory. I'm using Code::Blocks with MinGW. (I tried Visual C++ but found it kind of a PitA, slow to load and wanting logon credentials.) From my understanding of the Building Ogre tutorial, OGRE should create necessary dependencies so I didn't download any. I ran CMake and hit Configure... selected Code::Blocks with MinGW... and got a crapton of error messages.

Specifically, I did this:

Image

And it gave me this error 11 different times:

Image

And finally gave me this error:

Image

Based on the log, it seems that CMake is having trouble with the compiler, but I have successfully compiled programs I have written in Code::Blocks, and run the executables outside the IDE so I know they compiled.

The output window in full reads:

Code: Select all

The C compiler identification is unknown
The CXX compiler identification is unknown
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 -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.13/Modules/CMakeTestCCompiler.cmake:52 (message):
  The C compiler

    "C:/Program Files (x86)/CodeBlocks/MinGW/bin/gcc.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: C:/OGRE/CMakeFiles/CMakeTmp
    
    Run Build Command:"C:/PROGRA~2/CODEBL~1/MinGW/bin/mingw32-make.exe" "cmTC_48d3b/fast"
    C:/PROGRA~2/CODEBL~1/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTC_48d3b.dir\build.make CMakeFiles/cmTC_48d3b.dir/build

    mingw32-make.exe[1]: Entering directory 'C:/OGRE/CMakeFiles/CMakeTmp'

    Building C object CMakeFiles/cmTC_48d3b.dir/testCCompiler.c.obj

    C:\PROGRA~2\CODEBL~1\MinGW\bin\gcc.exe    -o CMakeFiles\cmTC_48d3b.dir\testCCompiler.c.obj   -c C:\OGRE\CMakeFiles\CMakeTmp\testCCompiler.c

    CMakeFiles\cmTC_48d3b.dir\build.make:64: recipe for target 'CMakeFiles/cmTC_48d3b.dir/testCCompiler.c.obj' failed

    mingw32-make.exe[1]: *** [CMakeFiles/cmTC_48d3b.dir/testCCompiler.c.obj] Error 1

    mingw32-make.exe[1]: Leaving directory 'C:/OGRE/CMakeFiles/CMakeTmp'

    Makefile:120: recipe for target 'cmTC_48d3b/fast' failed

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

    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:45 (project)


Configuring incomplete, errors occurred!
See also "C:/OGRE/CMakeFiles/CMakeOutput.log".
See also "C:/OGRE/CMakeFiles/CMakeError.log".
The log files it references are cmakeerror.log:

Code: Select all

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/gcc.exe 
Build flags: 
Id flags:  

The output was:
1


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/gcc.exe 
Build flags: 
Id flags: -c 

The output was:
1


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/gcc.exe 
Build flags: 
Id flags: -Aa 

The output was:
1
<command-line>:0:1: error: missing '(' after predicate


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/gcc.exe 
Build flags: 
Id flags: -D__CLASSIC_C__ 

The output was:
1


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/gcc.exe 
Build flags: 
Id flags:  

The output was:
1


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/gcc.exe 
Build flags: 
Id flags: -c 

The output was:
1


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/gcc.exe 
Build flags: 
Id flags: -Aa 

The output was:
1
<command-line>:0:1: error: missing '(' after predicate


Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/gcc.exe 
Build flags: 
Id flags: -D__CLASSIC_C__ 

The output was:
1


Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler":
gcc.exe: fatal error: no input files
compilation terminated.
Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler":
gcc.exe: fatal error: no input files
compilation terminated.
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/g++.exe 
Build flags: 
Id flags:  

The output was:
1


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/g++.exe 
Build flags: 
Id flags: -c 

The output was:
1


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/g++.exe 
Build flags: 
Id flags: --c++ 

The output was:
1
g++.exe: error: unrecognized command line option '--c++'


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/g++.exe 
Build flags: 
Id flags: --ec++ 

The output was:
1
g++.exe: error: unrecognized command line option '--ec++'


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/g++.exe 
Build flags: 
Id flags:  

The output was:
1


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/g++.exe 
Build flags: 
Id flags: -c 

The output was:
1


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/g++.exe 
Build flags: 
Id flags: --c++ 

The output was:
1
g++.exe: error: unrecognized command line option '--c++'


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: C:/Program Files (x86)/CodeBlocks/MinGW/bin/g++.exe 
Build flags: 
Id flags: --ec++ 

The output was:
1
g++.exe: error: unrecognized command line option '--ec++'


Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":
g++.exe: fatal error: no input files
compilation terminated.
Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":
g++.exe: fatal error: no input files
compilation terminated.
Determining if the C compiler works failed with the following output:
Change Dir: C:/OGRE/CMakeFiles/CMakeTmp

Run Build Command:"C:/PROGRA~2/CODEBL~1/MinGW/bin/mingw32-make.exe" "cmTC_48d3b/fast"
C:/PROGRA~2/CODEBL~1/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTC_48d3b.dir\build.make CMakeFiles/cmTC_48d3b.dir/build

mingw32-make.exe[1]: Entering directory 'C:/OGRE/CMakeFiles/CMakeTmp'

Building C object CMakeFiles/cmTC_48d3b.dir/testCCompiler.c.obj

C:\PROGRA~2\CODEBL~1\MinGW\bin\gcc.exe    -o CMakeFiles\cmTC_48d3b.dir\testCCompiler.c.obj   -c C:\OGRE\CMakeFiles\CMakeTmp\testCCompiler.c

CMakeFiles\cmTC_48d3b.dir\build.make:64: recipe for target 'CMakeFiles/cmTC_48d3b.dir/testCCompiler.c.obj' failed

mingw32-make.exe[1]: *** [CMakeFiles/cmTC_48d3b.dir/testCCompiler.c.obj] Error 1

mingw32-make.exe[1]: Leaving directory 'C:/OGRE/CMakeFiles/CMakeTmp'

Makefile:120: recipe for target 'cmTC_48d3b/fast' failed

mingw32-make.exe: *** [cmTC_48d3b/fast] Error 2
And cmakeoutput.log:

Code: Select all

The system is: Windows - 6.1.7601 - AMD64
Any help here would be appreciated! If you need more information about my system I'm happy to provide!
paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: Difficulty Building OGRE using CMAKE

Post by paroj »

likely the bundled MinGW version is too old. Note that Ogre itself is only supports mingw-w64 - so you will have to switch to that toolchain.
Alternatively you can trigger MSVC via commandline and use whatever IDE you want. (vscode has particularly good support for that)
asterlacnala
Gnoblar
Posts: 3
Joined: Tue Feb 05, 2019 10:28 pm

Re: Difficulty Building OGRE using CMAKE

Post by asterlacnala »

Thank you. That got me a little bit further...

I installed MinGW64, set up Code::Blocks to use it, ran cmake and set that as my compiler... and I got farther, but I'm still getting an error.

Code: Select all

CMake Error at OgreMain/CMakeLists.txt:75 (include_directories):
  include_directories given empty-string as include directory.
The strange thing is that the file doesn't even exist - I looked in OgreMain and there are no text files at all. There's an empty CMakeFiles directory, and the file OgreMain_pch_dephelp.cxx - nothing else. Are there supposed to be other files here?

I do have an include directory,

Image

is this what it is referring to? Can I manually add this directory to a file to fix the problem?

Probably because it threw an error, there is no makefile so I can't try continuing to see what happens.
paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: Difficulty Building OGRE using CMAKE

Post by paroj »

it refers to this line: https://github.com/OGRECave/ogre/blob/v ... ts.txt#L75

i.e. zzip was not found
asterlacnala
Gnoblar
Posts: 3
Joined: Tue Feb 05, 2019 10:28 pm

Re: Difficulty Building OGRE using CMAKE

Post by asterlacnala »

Ah, so zziplib is required?
It is listed here as just being recommended.
Post Reply