Compilling errors of directx

Annihilator

08-03-2011 07:35:56

Hi, folks. I`ve downloaded MyGui 3.2 and latest directx june 2010. I`ve configured MyGui with CMake and successfully compiled MyGUI.DirectXPlatform and MyGUIEngine projects. But I cannot compile demos, for ex. 'Demo_Colour'
I get errors:
1>c:\libs\cpp\directx\include\d3dx9math.h(392): error C2059: syntax error : 'constant'
1>c:\libs\cpp\directx\include\d3dx9math.h(392): error C2091: function returns function
1>c:\libs\cpp\directx\include\d3dx9math.h(392): error C2802: static member 'operator new' has no formal parameters
1>c:\libs\cpp\directx\include\d3dx9math.h(393): error C2059: syntax error : 'constant'
1>c:\libs\cpp\directx\include\d3dx9math.h(393): error C2090: function returns array
1>c:\libs\cpp\directx\include\d3dx9math.inl(990): error C2761: 'void *(__cdecl *_D3DXMATRIXA16::operator new(void))(size_t)' : member function redeclaration not allowed
1>c:\libs\cpp\directx\include\d3dx9math.inl(990): fatal error C1903: unable to recover from previous error(s); stopping compilation
2>------ Build started: Project: Demo_Colour, Configuration: Debug Win32 ------
2>c:\libs\cpp\directx\include\d3dx9math.h(392): error C2059: syntax error : 'constant'
2>c:\libs\cpp\directx\include\d3dx9math.h(392): error C2091: function returns function
2>c:\libs\cpp\directx\include\d3dx9math.h(392): error C2802: static member 'operator new' has no formal parameters
2>c:\libs\cpp\directx\include\d3dx9math.h(393): error C2059: syntax error : 'constant'
2>c:\libs\cpp\directx\include\d3dx9math.h(393): error C2090: function returns array
2>c:\libs\cpp\directx\include\d3dx9math.inl(990): error C2761: 'void *(__cdecl *_D3DXMATRIXA16::operator new(void))(size_t)' : member function redeclaration not allowed
2>c:\libs\cpp\directx\include\d3dx9math.inl(990): fatal error C1903: unable to recover from previous error(s); stopping compilatio
n

I have no ideas. Google didn't help
Thanks
win7 64
VS2010 (same problem on vs 2008 sp1)
mygui 3.2
dx sdk jun 2010

Altren

08-03-2011 12:27:51

Which options you enabled/disabled in CMake? I have same DxSDK and it compiles fine.

Annihilator

08-03-2011 16:02:33

Which options you enabled/disabled in CMake? I have same DxSDK and it compiles fine.
Hi. See screenshots
http://screencast.com/t/oZxVT5HYCiu
http://screencast.com/t/BN2rM7xAEay

Altren

08-03-2011 18:03:01

Oh, I see now. This bug was fixed, but you should disable MYGUI_CHECK_MEMORY_LEAKS flag or get newer code from svn (or wait for 3.2 release).

А еще можно на русскоязычном форуме общаться http://www.ogre3d.ru/forum/viewforum.php?f=20

Annihilator

08-03-2011 20:15:21

Thanks! I`ve compiled. But have another problem with loading MyGUI_Core.xml
Here is part of log
...............................
...............................
01:20:53 | Core | Info | FactoryManager successfully initialized | ..\..\MyGUIEngine\src\MyGUI_FactoryManager.cpp | 42
01:20:53 | Core | Info | * Initialise: ToolTipManager | ..\..\MyGUIEngine\src\MyGUI_ToolTipManager.cpp | 48
01:20:53 | Core | Info | ToolTipManager successfully initialized | ..\..\MyGUIEngine\src\MyGUI_ToolTipManager.cpp | 60
01:20:53 | Core | Error | ResourceManager : 'MyGUI_Core.xml', not found | ..\..\MyGUIEngine\src\MyGUI_ResourceManager.cpp | 153
01:20:53 | Core | Info | Gui successfully initialized | ..\..\MyGUIEngine\src\MyGUI_Gui.cpp | 133
01:25:46 | Core | Error | ResourceManager : 'Wallpaper.layout', not found | ..\..\MyGUIEngine\src\MyGUI_ResourceManager.cpp | 153
01:25:46 | Core | Warning | Layout 'Wallpaper.layout' couldn't be loaded | ..\..\MyGUIEngine\src\MyGUI_LayoutManager.cpp | 87
01:25:55 | Core | Error | ResourceManager : 'HelpPanel.layout', not found | ..\..\MyGUIEngine\src\MyGUI_ResourceManager.cpp | 153
01:25:55 | Core | Warning | Layout 'HelpPanel.layout' couldn't be loaded | ..\..\MyGUIEngine\src\MyGUI_LayoutManager.cpp | 87


After debugging I found out that scanFolder() is a probem (FindFirstFile). Seems like it is invoked with wrong paths (mPaths).

Altren

08-03-2011 21:18:22

What is inside mPaths? For Demo_Colour there should be 5 paths, here's mine:
"E:/MyGUI/trunk/Media"
"E:/MyGUI/trunk/Media/MyGUI_Media"
"E:/MyGUI/trunk/Media/Common/Base"
"E:/MyGUI/trunk/Media/Demos/Demo_Colour"
"E:/MyGUI/trunk/Media/Common/Demos"
Set breakpoint in DirectXDataManager::getDataPath to see that.

Also check generated resource.xml file (should be in build_directory/bin/debug).
<?xml version="1.0" encoding="UTF-8"?>

<Paths>
<Path root="true">E:/MyGUI/trunk/Media</Path>
<Path>E:/MyGUI/trunk/Media/MyGUI_Media</Path>
</Paths>
Root should be absolute path to Media folder in MyGUI sources.

Annihilator

09-03-2011 05:17:19

It works! The problem was with relative path
It was

<?xml version="1.0" encoding="UTF-8"?>
<Paths>
<Path root="true">../../Media</Path>
<Path>../../Media/MyGUI_Media</Path>
</Paths>


but should be

<Paths>
<Path root="true">../../../Media</Path>
<Path>../../../Media/MyGUI_Media</Path>
</Paths>

Thanks!