Errors building Mogre

BrainScan

11-06-2012 22:08:23

I'm trying to build Mogre the hard way (as in not using Mogre Builder) because I'm trying to wrap some additional classes. I got Ogre to build no problem, but when I get to the build Mogre step I get errors. I'm probably just doing something really stupid. Anyone got any ideas?

I'm building with VS2008. Here's the build output.
Compiling...
MogrePrecompiledHeaders.cpp
include\CLRObject.h(62) : error C3821: 'System::Runtime::InteropServices::GCHandle': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(62) : error C3821: 'System::Runtime::InteropServices::GCHandle::operator System::IntPtr': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(62) : error C3821: 'System::Runtime::InteropServices::GCHandle': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(62) : error C3821: 't': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(62) : error C3821: 'Normal': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(62) : error C3642: 'System::Runtime::InteropServices::GCHandle System::Runtime::InteropServices::GCHandle::Alloc(System::Object ^,System::Runtime::InteropServices::GCHandleType)' : cannot call a function with __clrcall calling convention from native code
include\CLRObject.h(62) : error C3175: 'System::Runtime::InteropServices::GCHandle::Alloc' : cannot call a method of a managed type from unmanaged function 'CLRObject::CLRObject'
include\CLRObject.h(62) : error C3642: 'System::Runtime::InteropServices::GCHandle::operator System::IntPtr(System::Runtime::InteropServices::GCHandle)' : cannot call a function with __clrcall calling convention from native code
include\CLRObject.h(62) : error C3175: 'System::Runtime::InteropServices::GCHandle::operator System::IntPtr' : cannot call a method of a managed type from unmanaged function 'CLRObject::CLRObject'
include\CLRObject.h(62) : error C3821: 'System::IntPtr::ToPointer': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(62) : error C3642: 'void *System::IntPtr::ToPointer(void)' : cannot call a function with __clrcall calling convention from native code
include\CLRObject.h(62) : error C3175: 'System::IntPtr::ToPointer' : cannot call a method of a managed type from unmanaged function 'CLRObject::CLRObject'
include\CLRObject.h(63) : error C3821: 'CLRObject::CLRObject(CLRObject::Object ^)': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(60) : error C3645: 'CLRObject::CLRObject' : __clrcall cannot be used on functions compiled to native code
include\CLRObject.h(67) : error C3821: 'System::Runtime::InteropServices::GCHandle': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(67) : error C3821: 'System::Runtime::InteropServices::GCHandle::operator System::IntPtr': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(67) : error C3821: 'System::Runtime::InteropServices::GCHandle': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(67) : error C3821: 't': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(67) : error C3821: 'Normal': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(67) : error C3642: 'System::Runtime::InteropServices::GCHandle System::Runtime::InteropServices::GCHandle::Alloc(System::Object ^,System::Runtime::InteropServices::GCHandleType)' : cannot call a function with __clrcall calling convention from native code
include\CLRObject.h(67) : error C3175: 'System::Runtime::InteropServices::GCHandle::Alloc' : cannot call a method of a managed type from unmanaged function 'CLRObject::operator ='
include\CLRObject.h(67) : error C3642: 'System::Runtime::InteropServices::GCHandle::operator System::IntPtr(System::Runtime::InteropServices::GCHandle)' : cannot call a function with __clrcall calling convention from native code
include\CLRObject.h(67) : error C3175: 'System::Runtime::InteropServices::GCHandle::operator System::IntPtr' : cannot call a method of a managed type from unmanaged function 'CLRObject::operator ='
include\CLRObject.h(67) : error C3821: 'System::IntPtr::ToPointer': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(67) : error C3642: 'void *System::IntPtr::ToPointer(void)' : cannot call a function with __clrcall calling convention from native code
include\CLRObject.h(67) : error C3175: 'System::IntPtr::ToPointer' : cannot call a method of a managed type from unmanaged function 'CLRObject::operator ='
include\CLRObject.h(69) : error C3821: 'System::Runtime::InteropServices::GCHandle': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(69) : error C3821: 'System::Runtime::InteropServices::GCHandle::operator System::Runtime::InteropServices::GCHandle': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(69) : error C3821: 'System::IntPtr': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(69) : error C3642: 'System::IntPtr::IntPtr(void *)' : cannot call a function with __clrcall calling convention from native code
include\CLRObject.h(69) : error C3175: 'System::IntPtr::IntPtr' : cannot call a method of a managed type from unmanaged function 'CLRObject::operator ='
include\CLRObject.h(69) : error C3642: 'System::Runtime::InteropServices::GCHandle::operator System::Runtime::InteropServices::GCHandle(System::IntPtr)' : cannot call a function with __clrcall calling convention from native code
include\CLRObject.h(69) : error C3175: 'System::Runtime::InteropServices::GCHandle::operator System::Runtime::InteropServices::GCHandle' : cannot call a method of a managed type from unmanaged function 'CLRObject::operator ='
include\CLRObject.h(69) : error C3821: 'System::Runtime::InteropServices::GCHandle::Target': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(69) : error C3821: 't': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(69) : error C2039: 'set' : is not a member of 'System::Runtime::InteropServices::GCHandle::Target'
include\CLRObject.h(62) : see declaration of 'System::Runtime::InteropServices::GCHandle::Target'
include\CLRObject.h(72) : error C3821: 'CLRObject &CLRObject::operator =(CLRObject::Object ^)': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(65) : error C3645: 'CLRObject::operator =' : __clrcall cannot be used on functions compiled to native code
include\CLRObject.h(77) : error C3821: 'System::Runtime::InteropServices::GCHandle': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(77) : error C3821: 'System::Runtime::InteropServices::GCHandle::operator System::IntPtr': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(77) : error C3821: 'System::Runtime::InteropServices::GCHandle': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(77) : error C3821: 't': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(77) : error C3821: 'handleType': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(77) : error C3642: 'System::Runtime::InteropServices::GCHandle System::Runtime::InteropServices::GCHandle::Alloc(System::Object ^,System::Runtime::InteropServices::GCHandleType)' : cannot call a function with __clrcall calling convention from native code
include\CLRObject.h(77) : error C3175: 'System::Runtime::InteropServices::GCHandle::Alloc' : cannot call a method of a managed type from unmanaged function 'CLRObject::_MapToCLRObject'
include\CLRObject.h(77) : error C3642: 'System::Runtime::InteropServices::GCHandle::operator System::IntPtr(System::Runtime::InteropServices::GCHandle)' : cannot call a function with __clrcall calling convention from native code
include\CLRObject.h(77) : error C3175: 'System::Runtime::InteropServices::GCHandle::operator System::IntPtr' : cannot call a method of a managed type from unmanaged function 'CLRObject::_MapToCLRObject'
include\CLRObject.h(77) : error C3821: 'System::IntPtr::ToPointer': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(77) : error C3642: 'void *System::IntPtr::ToPointer(void)' : cannot call a function with __clrcall calling convention from native code
include\CLRObject.h(77) : error C3175: 'System::IntPtr::ToPointer' : cannot call a method of a managed type from unmanaged function 'CLRObject::_MapToCLRObject'
include\CLRObject.h(79) : error C3821: 'System::Exception': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(79) : error C3642: 'System::Exception::Exception(System::String ^)' : cannot call a function with __clrcall calling convention from native code
include\CLRObject.h(79) : error C3175: 'System::Exception::Exception' : cannot call a method of a managed type from unmanaged function 'CLRObject::_MapToCLRObject'
include\CLRObject.h(80) : error C3821: 'void CLRObject::_MapToCLRObject(CLRObject::Object ^,CLRObject::GCHandleType)': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(74) : error C3645: 'CLRObject::_MapToCLRObject' : __clrcall cannot be used on functions compiled to native code
include\CLRObject.h(86) : error C3821: 'System::Runtime::InteropServices::GCHandle': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(86) : error C3821: 'System::Runtime::InteropServices::GCHandle::operator System::Runtime::InteropServices::GCHandle': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(86) : error C3821: 'System::IntPtr': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(86) : error C3642: 'System::IntPtr::IntPtr(void *)' : cannot call a function with __clrcall calling convention from native code
include\CLRObject.h(86) : error C3175: 'System::IntPtr::IntPtr' : cannot call a method of a managed type from unmanaged function 'CLRObject::operator __gc CLRObject::Object'
include\CLRObject.h(86) : error C3642: 'System::Runtime::InteropServices::GCHandle::operator System::Runtime::InteropServices::GCHandle(System::IntPtr)' : cannot call a function with __clrcall calling convention from native code
include\CLRObject.h(86) : error C3175: 'System::Runtime::InteropServices::GCHandle::operator System::Runtime::InteropServices::GCHandle' : cannot call a method of a managed type from unmanaged function 'CLRObject::operator __gc CLRObject::Object'
include\CLRObject.h(86) : error C3821: 'System::Runtime::InteropServices::GCHandle::Target': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(86) : error C2039: 'get' : is not a member of 'System::Runtime::InteropServices::GCHandle::Target'
include\CLRObject.h(62) : see declaration of 'System::Runtime::InteropServices::GCHandle::Target'
include\CLRObject.h(87) : error C3821: 'CLRObject::operator __gc CLRObject::Object(void)': managed type or function cannot be used in an unmanaged function
include\CLRObject.h(82) : error C3645: 'CLRObject::operator __gc CLRObject::Object' : __clrcall cannot be used on functions compiled to native code
include\CLRHandle.h(43) : error C3821: 'System::Runtime::InteropServices::GCHandle': managed type or function cannot be used in an unmanaged function
include\CLRHandle.h(43) : error C3821: 'System::Runtime::InteropServices::GCHandle::operator System::IntPtr': managed type or function cannot be used in an unmanaged function
include\CLRHandle.h(43) : error C3821: 'System::Runtime::InteropServices::GCHandle': managed type or function cannot be used in an unmanaged function
include\CLRHandle.h(43) : error C3821: 't': managed type or function cannot be used in an unmanaged function
include\CLRHandle.h(43) : error C3821: 'Normal': managed type or function cannot be used in an unmanaged function
include\CLRHandle.h(43) : error C3642: 'System::Runtime::InteropServices::GCHandle System::Runtime::InteropServices::GCHandle::Alloc(System::Object ^,System::Runtime::InteropServices::GCHandleType)' : cannot call a function with __clrcall calling convention from native code
include\CLRHandle.h(43) : error C3175: 'System::Runtime::InteropServices::GCHandle::Alloc' : cannot call a method of a managed type from unmanaged function 'CLRHandle::CLRHandle'
include\CLRHandle.h(43) : error C3642: 'System::Runtime::InteropServices::GCHandle::operator System::IntPtr(System::Runtime::InteropServices::GCHandle)' : cannot call a function with __clrcall calling convention from native code
include\CLRHandle.h(43) : error C3175: 'System::Runtime::InteropServices::GCHandle::operator System::IntPtr' : cannot call a method of a managed type from unmanaged function 'CLRHandle::CLRHandle'
include\CLRHandle.h(43) : error C3821: 'System::IntPtr::ToPointer': managed type or function cannot be used in an unmanaged function
include\CLRHandle.h(43) : error C3642: 'void *System::IntPtr::ToPointer(void)' : cannot call a function with __clrcall calling convention from native code
include\CLRHandle.h(43) : error C3175: 'System::IntPtr::ToPointer' : cannot call a method of a managed type from unmanaged function 'CLRHandle::CLRHandle'
include\CLRHandle.h(44) : error C3821: 'CLRHandle::CLRHandle(CLRHandle::Object ^)': managed type or function cannot be used in an unmanaged function
include\CLRHandle.h(41) : error C3645: 'CLRHandle::CLRHandle' : __clrcall cannot be used on functions compiled to native code
include\CLRHandle.h(48) : error C3821: 'System::Runtime::InteropServices::GCHandle': managed type or function cannot be used in an unmanaged function
include\CLRHandle.h(48) : error C3821: 'System::Runtime::InteropServices::GCHandle::operator System::IntPtr': managed type or function cannot be used in an unmanaged function
include\CLRHandle.h(48) : error C3821: 'System::Runtime::InteropServices::GCHandle': managed type or function cannot be used in an unmanaged function
include\CLRHandle.h(48) : error C3821: 't': managed type or function cannot be used in an unmanaged function
include\CLRHandle.h(48) : error C3821: 'Normal': managed type or function cannot be used in an unmanaged function
include\CLRHandle.h(48) : error C3642: 'System::Runtime::InteropServices::GCHandle System::Runtime::InteropServices::GCHandle::Alloc(System::Object ^,System::Runtime::InteropServices::GCHandleType)' : cannot call a function with __clrcall calling convention from native code
include\CLRHandle.h(48) : error C3175: 'System::Runtime::InteropServices::GCHandle::Alloc' : cannot call a method of a managed type from unmanaged function 'CLRHandle::operator ='
include\CLRHandle.h(48) : error C3642: 'System::Runtime::InteropServices::GCHandle::operator System::IntPtr(System::Runtime::InteropServices::GCHandle)' : cannot call a function with __clrcall calling convention from native code
include\CLRHandle.h(48) : error C3175: 'System::Runtime::InteropServices::GCHandle::operator System::IntPtr' : cannot call a method of a managed type from unmanaged function 'CLRHandle::operator ='
include\CLRHandle.h(48) : error C3821: 'System::IntPtr::ToPointer': managed type or function cannot be used in an unmanaged function
include\CLRHandle.h(48) : error C3642: 'void *System::IntPtr::ToPointer(void)' : cannot call a function with __clrcall calling convention from native code
include\CLRHandle.h(48) : error C3175: 'System::IntPtr::ToPointer' : cannot call a method of a managed type from unmanaged function 'CLRHandle::operator ='
include\CLRHandle.h(50) : error C3821: 'System::Runtime::InteropServices::GCHandle': managed type or function cannot be used in an unmanaged function
include\CLRHandle.h(50) : error C3821: 'System::Runtime::InteropServices::GCHandle::operator System::Runtime::InteropServices::GCHandle': managed type or function cannot be used in an unmanaged function
include\CLRHandle.h(50) : error C3821: 'System::IntPtr': managed type or function cannot be used in an unmanaged function
include\CLRHandle.h(50) : error C3642: 'System::IntPtr::IntPtr(void *)' : cannot call a function with __clrcall calling convention from native code
include\CLRHandle.h(50) : error C3175: 'System::IntPtr::IntPtr' : cannot call a method of a managed type from unmanaged function 'CLRHandle::operator ='
include\CLRHandle.h(50) : error C3642: 'System::Runtime::InteropServices::GCHandle::operator System::Runtime::InteropServices::GCHandle(System::IntPtr)' : cannot call a function with __clrcall calling convention from native code
include\CLRHandle.h(50) : error C3175: 'System::Runtime::InteropServices::GCHandle::operator System::Runtime::InteropServices::GCHandle' : cannot call a method of a managed type from unmanaged function 'CLRHandle::operator ='
include\CLRHandle.h(50) : error C3821: 'System::Runtime::InteropServices::GCHandle::Target': managed type or function cannot be used in an unmanaged function
include\CLRHandle.h(50) : error C3821: 't': managed type or function cannot be used in an unmanaged function

Tubulii

14-06-2012 16:31:05

You do not need to "do it the hard way". Just build Mogre using MogreBuilder and when edit the Mogre project directly. You can rerun MogreBuilder with your modified Mogre source to build the dlls, because already existing source code files won't be overriden. Just make sure, you backup your code files recently. I never had any problems with my modified sources. But I never touched the AutoWrapper process and only added custom classses.

BrainScan

15-06-2012 06:48:14

I was thinking about switching to Mogre Builder, but according to this post its not working with .NET 2.0 either. So, it seems like Mogre no longer supports VS2008 and .NET 2.0. I'm going to give VS2010 a try and see what happens.

Tubulii

15-06-2012 07:07:54

I was thinking about switching to Mogre Builder, but according to this post its not working with .NET 2.0 either. So, it seems like Mogre no longer supports VS2008 and .NET 2.0. I'm going to give VS2010 a try and see what happens.
There is should be no difference between .Net 4 and .Net 2 which cause problems. Try to build mogre with .Net 4, change .Net version to .Net 2 (edit the project file), clear the project data (both in VS) and rebuild.