Horde3D

Next-Generation Graphics Engine
It is currently 25.11.2024, 04:01

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: 08.06.2008, 07:07 
Offline

Joined: 08.06.2008, 06:52
Posts: 6
Essentially GCC 4.3.0 does not include c-headers when including C++ headers.
Hence, it breaks compatibility with Horde3d as it relies on this fact.

Here's some patches to fix it.

Code:
Index: trunk/Extensions/Terrain/Sample/main.cpp
===================================================================
--- trunk/Extensions/Terrain/Sample/main.cpp   (revision 28)
+++ trunk/Extensions/Terrain/Sample/main.cpp   (working copy)
@@ -14,6 +14,7 @@
 // *************************************************************************************************

 

 #include <iostream>

+#include <cstdlib>

 #include "glfw.h"

 #include "app.h"

 

Index: trunk/Horde3D/Source/ColladaConverter/utils.h
===================================================================
--- trunk/Horde3D/Source/ColladaConverter/utils.h   (revision 28)
+++ trunk/Horde3D/Source/ColladaConverter/utils.h   (working copy)
@@ -26,6 +26,8 @@
 #define _utils_H_

 

 #include "utMath.h"

+#include <cstring>

+#include <cstdlib>

 #include <string>

 using namespace std;

 

Index: trunk/Horde3D/Source/Horde3DUtils/main.cpp
===================================================================
--- trunk/Horde3D/Source/Horde3DUtils/main.cpp   (revision 28)
+++ trunk/Horde3D/Source/Horde3DUtils/main.cpp   (working copy)
@@ -31,6 +31,8 @@
 #   include <windows.h>

 #endif

 #include <GL/gl.h>

+#include <cstdlib>

+#include <cstring>

 #include <string>

 #include <vector>

 #include <map>

Index: trunk/Horde3D/Source/Horde3DEngine/utOpenGL.h
===================================================================
--- trunk/Horde3D/Source/Horde3DEngine/utOpenGL.h   (revision 28)
+++ trunk/Horde3D/Source/Horde3DEngine/utOpenGL.h   (working copy)
@@ -30,6 +30,8 @@
 #endif

 

 #include "utPlatform.h"

+#include <cstdlib>

+#include <cstring>

 

 #ifdef PLATFORM_WIN

 #   define WIN32_LEAN_AND_MEAN 1

Index: trunk/Horde3D/Source/Horde3DEngine/egPrerequisites.h
===================================================================
--- trunk/Horde3D/Source/Horde3DEngine/egPrerequisites.h   (revision 28)
+++ trunk/Horde3D/Source/Horde3DEngine/egPrerequisites.h   (working copy)
@@ -25,6 +25,9 @@
 #ifndef _egPrerequisites_H_

 #define _egPrerequisites_H_

 

+#include <cstdlib>

+#include <cstring>

+

 typedef unsigned int uint32;

 

 typedef int ResHandle;

Index: trunk/Horde3D/Source/Horde3DEngine/egRenderer.h
===================================================================
--- trunk/Horde3D/Source/Horde3DEngine/egRenderer.h   (revision 28)
+++ trunk/Horde3D/Source/Horde3DEngine/egRenderer.h   (working copy)
@@ -32,6 +32,7 @@
 #include "egCamera.h"

 #include "egModel.h"

 #include <vector>

+#include <algorithm>

 using namespace std;

 

 class MaterialResource;

Index: trunk/Horde3D/Samples/Knight/main.cpp
===================================================================
--- trunk/Horde3D/Samples/Knight/main.cpp   (revision 28)
+++ trunk/Horde3D/Samples/Knight/main.cpp   (working copy)
@@ -14,6 +14,7 @@
 // *************************************************************************************************

 

 #include <iostream>

+#include <cstdlib>

 #include "glfw.h"

 #include "app.h"

 

Index: trunk/Horde3D/Samples/Chicago/main.cpp
===================================================================
--- trunk/Horde3D/Samples/Chicago/main.cpp   (revision 28)
+++ trunk/Horde3D/Samples/Chicago/main.cpp   (working copy)
@@ -14,6 +14,7 @@
 // *************************************************************************************************

 

 #include <iostream>

+#include <cstdlib>

 #include "glfw.h"

 #include "app.h"

 


Top
 Profile  
Reply with quote  
PostPosted: 13.06.2008, 18:02 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Thanks for this advice. As I don't have a GCC 4.3.0 configuration running, I can't test if it's really necessary to add cstdlib and cstring to egPrerequisities.h.

Can you try if the following patch is working, too?


Attachments:
File comment: GCC Patch created with Tortoise
gcc.zip [845 Bytes]
Downloaded 734 times
Top
 Profile  
Reply with quote  
PostPosted: 14.06.2008, 23:53 
Offline

Joined: 14.06.2008, 21:46
Posts: 8
This problem not in gcc! This specific for new glibc(2.8).
On gcc 4.3.1 all ok.


Top
 Profile  
Reply with quote  
PostPosted: 15.06.2008, 16:27 
Offline

Joined: 23.04.2008, 14:42
Posts: 6
stalkerg wrote:
This problem not in gcc! This specific for new glibc(2.8).
On gcc 4.3.1 all ok.


Yes it is; I'm running gcc 4.3.1 + glibc 2.8, and the include problems are still there. I will apply the patch and see what happens.

Read the chapter "Header dependency cleanup" on this => http://gcc.gnu.org/gcc-4.3/porting_to.html page. Seems like they are implementing stuff that has been nailed down for C++0X.


Top
 Profile  
Reply with quote  
PostPosted: 16.06.2008, 08:07 
Offline

Joined: 08.06.2008, 06:52
Posts: 6
Yes Volker, your patch works too.
Maybe the topic should be renamed to "Compiling problems with glibc" ?

:P.

For my system:
Arch64

gcc 4.3.1 (updated today)
glibc 2.8

It is necessary to apply the patches.


Top
 Profile  
Reply with quote  
PostPosted: 16.06.2008, 08:20 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Ok, I commited it to the SourceForge SVN


Top
 Profile  
Reply with quote  
PostPosted: 16.06.2008, 10:22 
Offline

Joined: 23.04.2008, 14:42
Posts: 6
Volker wrote:
Ok, I commited it to the SourceForge SVN


Thank you :) I can confirm that the project now builds straight from svn on gcc 4.3.1 (all I need to add is the -msse2 flag).


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group