Errors out of the box with Ogre on Mac

Problems building or running the engine, queries about how to use features etc.
Post Reply
quiteballin
Gnoblar
Posts: 2
Joined: Wed Sep 28, 2022 11:51 pm

Errors out of the box with Ogre on Mac

Post by quiteballin »

Ogre Version: :?:
Operating System: :?:
Render System: :?:
Hey all,

I just started using Ogre and I am quite inexpereinced in building c++ files from source. I am getting these errors out of the box with this as my code:

Code: Select all

#include <iostream>
#include "submodules/ogre/sdk/include/OGRE/Ogre.h"
int main(int, char**) {
    std::cout << "Hello, world!\n";
}

Errors:

Code: Select all

[{
	"resource": "/Users/jake/Desktop/code/c++/metaBalls/submodules/ogre/sdk/include/OGRE/OgreMath.h",
	"owner": "makefile-tools",
	"severity": 8,
	"message": "unknown type name 'constexpr'",
	"source": "gcc",
	"startLineNumber": 361,
	"startColumn": 16,
	"endLineNumber": 361,
	"endColumn": 16
},{
	"resource": "/Users/jake/Desktop/code/c++/metaBalls/submodules/ogre/sdk/include/OGRE/OgreMath.h",
	"owner": "makefile-tools",
	"severity": 8,
	"message": "expected ';' at end of declaration list",
	"source": "gcc",
	"startLineNumber": 361,
	"startColumn": 30,
	"endLineNumber": 361,
	"endColumn": 30
},{
	"resource": "/Users/jake/Desktop/code/c++/metaBalls/submodules/ogre/sdk/include/OGRE/OgreMath.h",
	"owner": "makefile-tools",
	"severity": 8,
	"message": "unknown type name 'Real'; did you mean '::Ogre::Real'?",
	"source": "gcc",
	"startLineNumber": 363,
	"startColumn": 23,
	"endLineNumber": 363,
	"endColumn": 23
}]

Anyone have any idea what is going on? Let me know if you need anything else from me. I am on Mac using the most recent version of Ogre.

Last edited by quiteballin on Thu Sep 29, 2022 3:39 pm, edited 1 time in total.
quiteballin
Gnoblar
Posts: 2
Joined: Wed Sep 28, 2022 11:51 pm

Re: Errors out of the box with Ogre on Mac

Post by quiteballin »

I figured out the fix to this. The issue is that Mac uses an older version of clang out of the box for some reason which does not support the 'constexpr' keyword. In order to remedy this I had to compile with this argument: "/usr/bin/clang++ -std=c++11" which allows c++11 support.

Thanks to this thread: https://stackoverflow.com/questions/450 ... n-mac-os-x

Post Reply