2.0 build error on MSVC 2019 Community Edition

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


libolt
Greenskin
Posts: 126
Joined: Wed Jan 19, 2005 4:48 am
x 9

2.0 build error on MSVC 2019 Community Edition

Post by libolt »

Well I attempted to build Ogre 2.0 on MSVC 2019 but ran into the error below. I couldn't find any way to disable precompiled headers in cmake like you can with 1.12.

Any help is appreciated.

Code: Select all

[  0%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreAnimable.cpp.obj
OgreAlignedAllocator.cpp
C:\Users\libolt\builds\sources\ogre-2.0\OgreMain\src\OgreAlignedAllocator.cpp(28): fatal error C1083: Cannot open precompiled header file: 'OgreStableHeaders.pch': No such file or directory
[  0%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreAnimation.cpp.obj
[  0%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreAnimationState.cpp.obj
[  1%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreAnimationTrack.cpp.obj
[  1%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreArchive.cpp.obj
[  1%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreArchiveManager.cpp.obj
[  1%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreAtomicScalar.cpp.obj
OgreAnimable.cpp
C:\Users\libolt\builds\sources\ogre-2.0\OgreMain\src\OgreAnimable.cpp(28): fatal error C1083: Cannot open precompiled header file: 'OgreStableHeaders.pch': No such file or directory
OgreAnimationTrack.cpp
C:\Users\libolt\builds\sources\ogre-2.0\OgreMain\src\OgreAnimationTrack.cpp(28): fatal error C1083: Cannot open precompiled header file: 'OgreStableHeaders.pch': No such file or directory
jom: C:\Users\libolt\builds\build-msvc-amd64\ogre-2.0-build\OgreMain\CMakeFiles\OgreMain.dir\build.make [OgreMain\CMakeFiles\OgreMain.dir\src\OgreAlignedAllocator.cpp.obj] Error 2
OgreAnimation.cpp
C:\Users\libolt\builds\sources\ogre-2.0\OgreMain\src\OgreAnimation.cpp(28): fatal error C1083: Cannot open precompiled header file: 'OgreStableHeaders.pch': No such file or directory
OgreAnimationState.cpp
C:\Users\libolt\builds\sources\ogre-2.0\OgreMain\src\OgreAnimationState.cpp(28): fatal error C1083: Cannot open precompiled header file: 'OgreStableHeaders.pch': No such file or directory
OgreArchive.cpp
C:\Users\libolt\builds\sources\ogre-2.0\OgreMain\src\OgreArchive.cpp(29): fatal error C1083: Cannot open precompiled header file: 'OgreStableHeaders.pch': No such file or directory
OgreArchiveManager.cpp
C:\Users\libolt\builds\sources\ogre-2.0\OgreMain\src\OgreArchiveManager.cpp(28): fatal error C1083: Cannot open precompiled header file: 'OgreStableHeaders.pch': No such file or directory
jom: C:\Users\libolt\builds\build-msvc-amd64\ogre-2.0-build\OgreMain\CMakeFiles\OgreMain.dir\build.make [OgreMain\CMakeFiles\OgreMain.dir\src\OgreAnimationState.cpp.obj] Error 2
jom: C:\Users\libolt\builds\build-msvc-amd64\ogre-2.0-build\OgreMain\CMakeFiles\OgreMain.dir\build.make [OgreMain\CMakeFiles\OgreMain.dir\src\OgreArchive.cpp.obj] Error 2
jom: C:\Users\libolt\builds\build-msvc-amd64\ogre-2.0-build\OgreMain\CMakeFiles\OgreMain.dir\build.make [OgreMain\CMakeFiles\OgreMain.dir\src\OgreArchiveManager.cpp.obj] Error 2
jom: C:\Users\libolt\builds\build-msvc-amd64\ogre-2.0-build\OgreMain\CMakeFiles\OgreMain.dir\build.make [OgreMain\CMakeFiles\OgreMain.dir\src\OgreAnimation.cpp.obj] Error 2
OgreAtomicScalar.cpp
C:\Users\libolt\builds\sources\ogre-2.0\OgreMain\src\OgreAtomicScalar.cpp(29): fatal error C1083: Cannot open precompiled header file: 'OgreStableHeaders.pch': No such file or directory
jom: C:\Users\libolt\builds\build-msvc-amd64\ogre-2.0-build\OgreMain\CMakeFiles\OgreMain.dir\build.make [OgreMain\CMakeFiles\OgreMain.dir\src\OgreAtomicScalar.cpp.obj] Error 2
jom: C:\Users\libolt\builds\build-msvc-amd64\ogre-2.0-build\OgreMain\CMakeFiles\OgreMain.dir\build.make [OgreMain\CMakeFiles\OgreMain.dir\src\OgreAnimable.cpp.obj] Error 2
jom: C:\Users\libolt\builds\build-msvc-amd64\ogre-2.0-build\OgreMain\CMakeFiles\OgreMain.dir\build.make [OgreMain\CMakeFiles\OgreMain.dir\src\OgreAnimationTrack.cpp.obj] Error 2
jom: C:\Users\libolt\builds\build-msvc-amd64\ogre-2.0-build\CMakeFiles\Makefile2 [OgreMain\CMakeFiles\OgreMain.dir\all] Error 2
jom: C:\Users\libolt\builds\build-msvc-amd64\ogre-2.0-build\Makefile [all] Error 2
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5511
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1379

Re: 2.0 build error on MSVC 2019 Community Edition

Post by dark_sylinc »

MSVC 2019 is very new. It is much more tested against MSVC 2015.

Anyway, find "use_precompiled_header" and delete it / comment it out.

Precompiled headers also get disabled if OGRE_UNITY_BUILD is chosen.
libolt
Greenskin
Posts: 126
Joined: Wed Jan 19, 2005 4:48 am
x 9

Re: 2.0 build error on MSVC 2019 Community Edition

Post by libolt »

Okay so I commented out use_precompiled_header in OgreMain/CMakeLists.txt and got 2.0 to build. However, building my game resulted in some errors.

So I installed MSVC 2017 Community Edition since that's the lowest version supported by the Visual Studio Installer that I downloaded from Microsoft's site. I got 2.0 to build again and then when I go to build my game against this version of 2.0 I get the following errors:

Code: Select all

jom: parallel job execution disabled for Makefile
[  0%] Building CXX object CMakeFiles/ubc.dir/src/game/data/playergamedata.cpp.obj
[  1%] Building CXX object CMakeFiles/ubc.dir/src/game/jumpballs/jumpballsexecute.cpp.obj
[  2%] Building CXX object CMakeFiles/ubc.dir/src/game/statemachine/defensestatemachine.cpp.obj
playergamedata.cpp
[  3%] Building CXX object CMakeFiles/ubc.dir/src/game/statemachine/offensestatemachine.cpp.obj
[  4%] Building CXX object CMakeFiles/ubc.dir/src/game/statemachine/statemachine.cpp.obj
[  4%] Building CXX object CMakeFiles/ubc.dir/src/game/statemachine/teamstatemachine.cpp.obj
[  5%] Building CXX object CMakeFiles/ubc.dir/src/game/utilities/logging.cpp.obj
[  6%] Building CXX object CMakeFiles/ubc.dir/src/game/utilities/timing.cpp.obj
timing.cpp
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\OgreHardwareBuffer.h(319): error C2589: '(': illegal token on right side of '::'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\OgreHardwareBuffer.h(319): error C2062: type 'unknown-type' unexpected
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\OgreHardwareBuffer.h(319): error C2059: syntax error: ')'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\OgreHlmsCommon.h(99): error C2589: '(': illegal token on right side of '::'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\OgreHlmsCommon.h(99): error C2062: type 'unknown-type' unexpected
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\OgreHlmsCommon.h(99): error C2059: syntax error: ')'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\OgreHlmsCommon.h(100): error C2589: '(': illegal token on right side of '::'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\OgreHlmsCommon.h(100): error C2062: type 'unknown-type' unexpected
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\OgreHlmsCommon.h(100): error C2059: syntax error: ')'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(66): warning C4003: not enough arguments for function-like macro invocation 'max'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(66): error C2059: syntax error: ')'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(69): warning C4003: not enough arguments for function-like macro invocation 'min'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(69): error C2059: syntax error: ')'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(76): error C2563: mismatch in formal parameter list
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(76): error C2568: '+': unable to resolve function overload
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(76): note: could be 'double Ogre::max(const double &,const double &)'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(76): note: or       'float Ogre::max(const float &,const float &)'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(78): error C2563: mismatch in formal parameter list
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(78): error C2568: '-': unable to resolve function overload
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(78): note: could be 'double Ogre::max(const double &,const double &)'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(78): note: or       'float Ogre::max(const float &,const float &)'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(83): warning C4003: not enough arguments for function-like macro invocation 'max'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(83): error C2059: syntax error: ')'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(86): warning C4003: not enough arguments for function-like macro invocation 'min'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(86): error C2059: syntax error: ')'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(93): error C2563: mismatch in formal parameter list
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(93): error C2568: '+': unable to resolve function overload
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(93): note: could be 'double Ogre::max(const double &,const double &)'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(93): note: or       'float Ogre::max(const float &,const float &)'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(95): error C2563: mismatch in formal parameter list
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(95): error C2568: '-': unable to resolve function overload
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(95): note: could be 'double Ogre::max(const double &,const double &)'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(95): note: or       'float Ogre::max(const float &,const float &)'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(158): error C2589: '(': illegal token on right side of '::'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(158): error C2062: type 'unknown-type' unexpected
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\simple\c\OgreAabb.inl(158): error C2059: syntax error: ')'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(44): warning C4003: not enough arguments for function-like macro invocation 'max'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(44): error C2059: syntax error: ')'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(47): warning C4003: not enough arguments for function-like macro invocation 'min'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(47): error C2059: syntax error: ')'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(50): error C2563: mismatch in formal parameter list
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(50): error C2568: '+': unable to resolve function overload
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(50): note: could be 'double Ogre::max(const double &,const double &)'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(50): note: or       'float Ogre::max(const float &,const float &)'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(51): error C2563: mismatch in formal parameter list
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(51): error C2568: '-': unable to resolve function overload
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(51): note: could be 'double Ogre::max(const double &,const double &)'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(51): note: or       'float Ogre::max(const float &,const float &)'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(56): warning C4003: not enough arguments for function-like macro invocation 'max'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(56): error C2059: syntax error: ')'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(59): warning C4003: not enough arguments for function-like macro invocation 'min'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(59): error C2059: syntax error: ')'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(62): error C2563: mismatch in formal parameter list
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(62): error C2568: '+': unable to resolve function overload
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(62): note: could be 'double Ogre::max(const double &,const double &)'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(62): note: or       'float Ogre::max(const float &,const float &)'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(63): error C2563: mismatch in formal parameter list
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(63): error C2568: '-': unable to resolve function overload
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(63): note: could be 'double Ogre::max(const double &,const double &)'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\math\array\sse2\single\OgreArrayAabb.inl(63): note: or       'float Ogre::max(const float &,const float &)'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\animation\OgreSkeletonTrack.h(94): error C2589: '(': illegal token on right side of '::'
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\animation\OgreSkeletonTrack.h(94): error C2062: type 'unknown-type' unexpected
c:\users\libolt\nextcloud\builds\msvc-amd64\ogre-2.0-sdk\include\ogre\animation\OgreSkeletonTrack.h(94): error C2059: syntax error: ')'
jom: C:\Users\libolt\Projects\ubc-ogre-2.0-msvc\CMakeFiles\ubc.dir\build.make [CMakeFiles\ubc.dir\src\game\data\playergamedata.cpp.obj] Error 2
jumpballsexecute.cpp
jom: C:\Users\libolt\Projects\ubc-ogre-2.0-msvc\CMakeFiles\ubc.dir\build.make [CMakeFiles\ubc.dir\src\game\statemachine\defensestatemachine.cpp.obj] Error 2
I understand that you recommended 2015 but it's difficult to find a download from Microsoft for this version.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5511
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1379

Re: 2.0 build error on MSVC 2019 Community Edition

Post by dark_sylinc »

It looks like this particular version of MSVC wants us to '#include <algorithm>' before that header.

Try including it before including Ogre headers as a workaround.
libolt
Greenskin
Posts: 126
Joined: Wed Jan 19, 2005 4:48 am
x 9

Re: 2.0 build error on MSVC 2019 Community Edition

Post by libolt »

Okay I tried adding that to the top of playergamedata.cpp and it's header playergamedata.h but the error persists. Below are what both files look like:

playergamedata.cpp:

Code: Select all

#include <algorithm>

#include "data/playergamedata.h"
#include "utilities/typedefs.h"

//#include "OgreVector3.h"

playerGameData::playerGameData()  // constructor
{
    activePosition = NONE;
    courtPosition = Ogre::Vector3(0.0f,0.0f,0.0f);
    posChange = Ogre::Vector3(0.0f,0.0f,0.0f);
    passToPlayer = NONE;
    direction = NODIRECT;
    oldDirection = NODIRECT;
    courtPositionChangedType = NOCHANGE;
}
playerGameData::~playerGameData() = default;  // destructor

playerPositions playerGameData::getActivePosition() const  // retrieves the value of activePosition
{
    return (activePosition);
}
void playerGameData::setActivePosition(const playerPositions &set)  // sets the value of activePosition
{
    activePosition = set;
}

Ogre::Vector3 playerGameData::getCourtPosition() const  // retrieves the value of courtPosition
{
    return (courtPosition);
}
void playerGameData::setCourtPosition(const Ogre::Vector3 &set)  // sets the value of courtPosition
{
    courtPosition = set;
}


std::vector<playerActions> playerGameData::getStateAction() const  // retrieves the value of stateAction
{
    return (stateAction);
}
void playerGameData::setStateAction(const std::vector<playerActions> &set)  // sets the value of stateAction
{
    stateAction = set; 
}

directions playerGameData::getDirection() const  // retrieves the value of direction
{
    return (direction);
}
void playerGameData::setDirection(const directions &set)  // sets the value of direction
{
    direction = set;
}

directions playerGameData::getOldDirection() const  // retrieves the value of oldDirection
{
    return (oldDirection);
}
void playerGameData::setOldDirection(const directions &set)  // sets the value of oldDirection
{
    oldDirection = set;
}

Ogre::Vector3 playerGameData::getPosChange() const  // retrieves the value of posChange
{
    return (posChange);
}
void playerGameData::setPosChange(const Ogre::Vector3 &set)  // sets the value of posChange
{
    posChange = set;
}

playerPositions playerGameData::getPassToPlayer() const  // retrieves the value of passToPlayer
{
    return (passToPlayer);
}
void playerGameData::setPassToPlayer(const playerPositions &set)  // sets the value of passToPlayer
{
    passToPlayer = set;
}

Ogre::Vector3 playerGameData::getJumpBeginPos() const  // retrieves the value of playerJumpBeginPos
{
    return (jumpBeginPos);
}
void playerGameData::setJumpBeginPos(const Ogre::Vector3 &set)  // sets the value of playerJumpBeginPos
{
    jumpBeginPos = set;
}

Ogre::Vector3 playerGameData::getJumpEndPos() const  // retrieves the value of playerJumpEndPos
{
    return (jumpEndPos);
}
void playerGameData::setJumpEndPos(const Ogre::Vector3 &set)  // sets the value of playerJumpEndPos
{
    jumpEndPos = set;
}

Ogre::Vector3 playerGameData::getNewCourtPosition() const  // retrieves the value of newCourtPosition
{
    return (newCourtPosition);
}
void playerGameData::setNewCourtPosition(const Ogre::Vector3 &set)  // sets the value of newCourtPosition
{
    newCourtPosition = set;
}

positionChangedTypes playerGameData::getCourtPositionChangedType() const  // retrieves the value of courtPositionChangedType
{
    return (courtPositionChangedType);
}
void playerGameData::setCourtPositionChangedType(const positionChangedTypes &set)  // sets the value of courtPositionChangedType
{
    courtPositionChangedType = set;
}
playergamedata.h:

Code: Select all

#ifndef _PLAYERGAMEDATA_H_
#define _PLAYERGAMEDATA_H_

#include <algorithm>

#include "utilities/enums.h"

#include "OgreVector3.h"

class playerGameData
{
    public:
        playerGameData();  // constructor
        ~playerGameData();  // destructor

        playerPositions getActivePosition() const;  // retrieves the value of activePosition
        void setActivePosition(const playerPositions &set);  // sets the value of activePosition
   
        Ogre::Vector3 getCourtPosition() const;  // retrieves the value of courtPosition
        void setCourtPosition(const Ogre::Vector3 &set);  // sets the value of courtPosition
        
        std::vector<playerActions> getStateAction() const;  // retrieves the value of stateAction
        void setStateAction(const std::vector<playerActions> &set);  // sets the value of stateAction
        
        directions getDirection() const;  // retrieves the value of direction
        void setDirection(const directions &set);  // sets the value of direction

        directions getOldDirection() const;  // retrieves the value of oldDirection
        void setOldDirection(const directions &set);  // sets the value of oldDirection

        Ogre::Vector3 getPosChange() const;  // retrieves the value of posChange
        void setPosChange(const Ogre::Vector3 &set);  // sets the value of posChange

        playerPositions getPassToPlayer() const;  // retrieves the value of passToPlayer
        void setPassToPlayer(const playerPositions &set);  // sets the value of passToPlayer

        Ogre::Vector3 getJumpBeginPos() const;  // retrieves the value of playerJumpBeginPos
        void setJumpBeginPos(const Ogre::Vector3 &set);  // sets the value of playerJumpBeginPos

        Ogre::Vector3 getJumpEndPos() const;  // retrieves the value of playerJumpEndPos
        void setJumpEndPos(const Ogre::Vector3 &set);  // sets the value of playerJumpEndPos

        Ogre::Vector3 getNewCourtPosition() const;  // retrieves the value of newCourtPosition
        void setNewCourtPosition(const Ogre::Vector3 &set);  // sets the value of newCourtPosition

        positionChangedTypes getCourtPositionChangedType() const;  // retrieves the value of courtPositionChangedType
        void setCourtPositionChangedType(const positionChangedTypes &set);  // sets the value of courtPositionChangedType

    private:
    
        playerPositions activePosition;  // stores the active position of the player

        Ogre::Vector3 courtPosition;  // stores the position of the player on the court in an Ogre::Vector3
      
        directions direction;  // stores direction player is moving
        directions oldDirection;  // stores the previous player direction.

        Ogre::Vector3 posChange;  // stores value of players' position changes during logic updates

        playerPositions passToPlayer;  // stores the value of the player to be passed to.

        // player Jump variables
        Ogre::Vector3 jumpBeginPos;  // stores the coordinates of the player at the beginning of the jump
        Ogre::Vector3 jumpEndPos;  // stores the coordinates the player should reach at the end of the jump
    
        Ogre::Vector3 newCourtPosition;  // stores the upfated position of the player on the court in an Ogre::Vector3

        positionChangedTypes courtPositionChangedType;  // stores what subsystem changed the position of the player
    
        std::vector<playerActions> stateAction;  // controls the action performed by stateMachine

};
 
#endif
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5511
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1379

Re: 2.0 build error on MSVC 2019 Community Edition

Post by dark_sylinc »

Oh!!! I just realized. The error is a different one.

Windows headers strike again. #define NOMINMAX at the top. If the error still persists, then something else is defining min & max as macros.
libolt
Greenskin
Posts: 126
Joined: Wed Jan 19, 2005 4:48 am
x 9

Re: 2.0 build error on MSVC 2019 Community Edition

Post by libolt »

Thanks, that fixed it.

I added #ifdef _MSC_VER so that it's only added for VC++. Now I'm tracking down some issues with winsock definitions due to order of includes.

It's good from a portability standpoint to test my code on more than just GCC now and then.

Thanks again.