Horde3D

Next-Generation Graphics Engine
It is currently 15.10.2019, 12:35

All times are UTC + 1 hour




Post new topic Reply to topic  [ 37 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: Compile Fixes
PostPosted: 17.01.2011, 12:04 
Offline

Joined: 22.06.2010, 19:21
Posts: 26
Horde3D Trunk and the last Beta don't compile on my ancient MSVC compiler. To fix it, I added the following to utPlatform.h:

Code:
// <!-- WORKAROUND
//  Compile on Windows XP (32Bit)
//  Microsoft Visual Studio .NET 2003 Service Pack 1 (KB918007)
//  Microsoft Visual C++ .NET   69462-270-0000007-18762
// egRenderer.cpp(1198):   error C3861: 'strncpy_s': identifier not found, even with argument-dependent lookup
// egCom.cpp(177):         error C3861: 'vsnprintf': identifier not found, even with argument-dependent lookup
#ifdef WIN32
#define strncpy_s( dst, dstSize, src, count ) strncpy( dst, src, count < dstSize ? count : dstSize )
#define vsnprintf _vsnprintf
#endif
// -->


Top
 Profile  
Reply with quote  
 Post subject: Re: Compile Fixes
PostPosted: 17.01.2011, 20:46 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1149
Location: Germany
Can you try if the following patch solve your problem too?
Code:
Index: Horde3D/Source/Shared/utPlatform.h
===================================================================
--- Horde3D/Source/Shared/utPlatform.h   (revision 303)
+++ Horde3D/Source/Shared/utPlatform.h   (working copy)
@@ -74,8 +74,10 @@
 #undef max
 #endif
 
-#ifndef _MSC_VER
+#if !defined( _MSC_VER ) || !defined( __STDC_SECURE_LIB__ )
 #   define strncpy_s( dst, dstSize, src, count ) strncpy( dst, src, count < dstSize ? count : dstSize )
+#elif defined( _MSC_VER) && (_MSC_VER < 1400 )
+#   define vsnprintf _vsnprintf
 #endif
 

Should produce less side effects on other comilers than your suggestion.


Top
 Profile  
Reply with quote  
 Post subject: Re: Compile Fixes
PostPosted: 22.01.2011, 17:34 
Offline

Joined: 22.06.2010, 19:21
Posts: 26
That seems to work. Thank you!


Top
 Profile  
Reply with quote  
 Post subject: Re: Compile Fixes
PostPosted: 30.01.2011, 04:28 
Offline

Joined: 30.01.2011, 03:33
Posts: 5
Compiling Horde3D 1.0.0 Beta4 on OSX Snow Leopard 10.6.6 there are many deprecation related errors and warnings related to glfw when building the samples, so I disabled samples for Horde3D and Terrain in the appropriate CMakeLists.txt files. I'd recommend a CMake option to "Build without Samples" so there is no dependancy on glfw.

I started fixing the actual deprecation errors but got to the point where the code I was trying to fix was hacks and workarounds in glfw (not Horde3D), would probably break backwards compatibility (pre 10.6?) and decided it'd be easier to just not use it.

Additionally there is an error compiling when std::min takes different types (32 and 64 bit integers) fixed with this patch:
Code:
--- egShader.cpp   (revision 304)
+++ egShader.cpp   (working copy)
@@ -335,8 +335,8 @@
       const char *p0 = _p;
       seekChar( " \t\n\r{}()<>=,;" );  // Advanve until whitespace or special char found
       if( _p == p0 && *_p != '\0' ) ++_p;  // Handle special char
-      memcpy( _token, p0, std::min( _p - p0, tokenSize-1 ) );
-      _token[std::min( _p - p0, tokenSize-1 )] = '\0';
+      memcpy( _token, p0, std::min( _p - p0, (ptrdiff_t)(tokenSize-1) ) );
+      _token[std::min( _p - p0, (ptrdiff_t)(tokenSize-1) )] = '\0';
    }
 
 public:


P.S. I really like everything I've read about Horde3D, and presume I'll like it a lot more when I get to actually use it :).


Top
 Profile  
Reply with quote  
 Post subject: Re: Compile Fixes
PostPosted: 31.01.2011, 00:02 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Could you please try out the latest svn version? It uses a newer version of GLFW and at least the Horde code should compile on OSX.


Top
 Profile  
Reply with quote  
 Post subject: Re: Compile Fixes
PostPosted: 31.01.2011, 09:09 
Offline

Joined: 30.01.2011, 03:33
Posts: 5
marciano wrote:
Could you please try out the latest svn version? It uses a newer version of GLFW and at least the Horde code should compile on OSX.


Sorry, I compiled that from SVN just from the wrong directory :oops:. It compiles fine now except for the GLFW Carbon.framework related deprecation warnings :). However the samples have a black screen, which after some searching and testing seemed to be the result of an incorrect resource path. The following diff (Chicago only here) fixes all the samples. Although it does assume that the samples on OSX are in a bundle.

Code:
Index: Horde3D/Samples/Chicago/main.cpp
===================================================================
--- Horde3D/Samples/Chicago/main.cpp   (revision 304)
+++ Horde3D/Samples/Chicago/main.cpp   (working copy)
@@ -40,9 +40,7 @@
 {
 #ifdef __APPLE__
    std::string s( fullPath );
-   for( int i = 0; i < 4; ++i )
-      s = s.substr( 0, s.rfind( "/" ) );
-   return s + "/../";
+   return s.substr( 0, s.rfind("/", s.rfind(".app"))+1);
 #else
    const std::string s( fullPath );
    if( s.find( "/" ) != std::string::npos )


Top
 Profile  
Reply with quote  
 Post subject: Re: Compile Fixes
PostPosted: 01.02.2011, 14:45 
Offline

Joined: 15.09.2010, 18:31
Posts: 53
I hope extension fixes are applying for this thread too.
gcc-4.5.2 x64
Code:
Index: trunk/Extensions/Sound/Source/decode_wave.h
===================================================================
--- trunk/Extensions/Sound/Source/decode_wave.h (revision 686)
+++ trunk/Extensions/Sound/Source/decode_wave.h (working copy)
@@ -28,6 +28,7 @@
 #ifndef _Horde3DSound_decode_wave_H_
 #define _Horde3DSound_decode_wave_H_
 
+#include <stddef.h>
 #include "decode.h"
 
 
@@ -64,4 +65,4 @@
        size_t _sizeRead;
 };
 
-#endif // _Horde3DSound_decode_wave_H_
\ No newline at end of file
+#endif // _Horde3DSound_decode_wave_H_
Index: trunk/Extensions/Sound/Source/listener.h
===================================================================
--- trunk/Extensions/Sound/Source/listener.h    (revision 686)
+++ trunk/Extensions/Sound/Source/listener.h    (working copy)
@@ -28,12 +28,19 @@
 #ifndef _Horde3DSound_listener_H_
 #define _Horde3DSound_listener_H_
 
+#include <stdlib.h>
 #include <string>
+#include <strings.h>
 #include <map>
 
 #include "egScene.h"
 
 
+
+#ifndef ALC_ALL_DEVICES_SPECIFIER
+# define ALC_ALL_DEVICES_SPECIFIER     0x1013
+#endif
+
 namespace Horde3DSound {
 
 // =================================================================================================
@@ -102,4 +109,4 @@
 };
 
 } // namespace
-#endif // _Horde3DSound_listener_H_
\ No newline at end of file
+#endif // _Horde3DSound_listener_H_


Top
 Profile  
Reply with quote  
 Post subject: Re: Compile Fixes
PostPosted: 01.02.2011, 17:00 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1149
Location: Germany
shd wrote:
I hope extension fixes are applying for this thread too.

Sure!
shd wrote:
gcc-4.5.2 x64
Code:
Index: trunk/Extensions/Sound/Source/listener.h
===================================================================
--- trunk/Extensions/Sound/Source/listener.h    (revision 686)
+++ trunk/Extensions/Sound/Source/listener.h    (working copy)
@@ -28,12 +28,19 @@
 #ifndef _Horde3DSound_listener_H_
 #define _Horde3DSound_listener_H_
 
+#include <stdlib.h>
 #include <string>
+#include <strings.h>
 #include <map>
 
 #include "egScene.h"
 
 
+
+#ifndef ALC_ALL_DEVICES_SPECIFIER
+# define ALC_ALL_DEVICES_SPECIFIER     0x1013
+#endif
+
 namespace Horde3DSound {
 
 // =================================================================================================
@@ -102,4 +109,4 @@
 };
 
 } // namespace
-#endif // _Horde3DSound_listener_H_
\ No newline at end of file
+#endif // _Horde3DSound_listener_H_

Shouldn't that be string.h instead of strings.h?


Top
 Profile  
Reply with quote  
 Post subject: Re: Compile Fixes
PostPosted: 01.02.2011, 17:02 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1149
Location: Germany
therealbnut wrote:
Sorry, I compiled that from SVN just from the wrong directory :oops:. It compiles fine now except for the GLFW Carbon.framework related deprecation warnings :). However the samples have a black screen, which after some searching and testing seemed to be the result of an incorrect resource path. The following diff (Chicago only here) fixes all the samples. Although it does assume that the samples on OSX are in a bundle.

Some time ago I tested the samples with the CMake based XCode project and they were working out of the box. I will have a look at it again, when I'm at a Mac again.


Top
 Profile  
Reply with quote  
 Post subject: Re: Compile Fixes
PostPosted: 01.02.2011, 19:57 
Offline

Joined: 15.09.2010, 18:31
Posts: 53
Volker wrote:
Shouldn't that be string.h instead of strings.h?


No, I ment 'strings.h', or even better <cstring> instead of "string.h". Shame on me that I didn't used it on the first place.


Top
 Profile  
Reply with quote  
 Post subject: Re: Compile Fixes
PostPosted: 02.02.2011, 08:56 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1149
Location: Germany
At least under MSVC 2005 there's no strings.h only a string.h, that's why I asked. But there is a cstring so we can use this one.


Top
 Profile  
Reply with quote  
 Post subject: Re: Compile Fixes
PostPosted: 20.03.2011, 14:30 
Offline

Joined: 15.02.2009, 02:13
Posts: 161
Location: Sydney Australia
Hi,
In egRendererBase.cpp for sourceforge SVN revision 310, line 643:
Code:
uint32 shaderId = _shaders.add( RDIShader() );

I think should be:
Code:
RDIShader shd;
uint32 shaderId = _shaders.add( shd );

Sans this small error, I like where Horde's rendering backend is going, keep it up! :)

_________________
-Alex
Website


Top
 Profile  
Reply with quote  
 Post subject: Re: Compile Fixes
PostPosted: 20.03.2011, 15:16 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Thanks for the notice MistaED. Anonymous objects are allowed in C++ but the parameter in add needs to be const reference then. gcc is again more strict there than MSVC.


Top
 Profile  
Reply with quote  
 Post subject: Re: Compile Fixes
PostPosted: 30.03.2011, 16:11 
Offline

Joined: 27.03.2011, 08:40
Posts: 47
Location: Fi
Kubuntu 10.10, latest horde3d from svn.

Quote:
/horde3d/Horde3D/Source/Horde3DEngine/egRendererBase.cpp:667: error: "strcmp" was not declared in this scope

so #include <string.h> is needed there.


Second problem was that GLFW window closes right away, so quick debugging

/horde3d/Horde3D/Samples/glfw/lib/window.c
line 592
Code:
    if( _glfwWin.glMajor > 2 )
    {
        _glfwWin.GetStringi = (PFNGLGETSTRINGIPROC) glfwGetProcAddress( "glGetStringi" );
        if( !_glfwWin.GetStringi )
        {
            _glfwPlatformCloseWindow();
            return GL_FALSE;
        }
    }

I commented this out and then demos works.


Third problem was when I tried my C# code, mono complains it doesnt find libHorde3D.so, so I modified .config file to
Quote:
<configuration>
<dllmap os="linux" dll="Horde3D.dll" target="./libHorde3D.so"/>
<dllmap os="linux" dll="Horde3DUtils.dll" target="./libHorde3DUtils.so"/>
</configuration>

and got horde.net working. But when I exit my demo, it complains
Quote:
*** glibc detected *** mono: corrupted double-linked list: 0xb5e4d770 ***

and long list backtrace etc stuff.
Well, when I deleted .config files, that error disappears (new mono does not need .config).


Top
 Profile  
Reply with quote  
PostPosted: 13.04.2011, 16:05 
Offline

Joined: 02.10.2009, 19:26
Posts: 5
The title says it all, <cstring> should be included or use its C++ 'compare' counterpart instead. It happens in egRendererBase.cpp line 667 in revision 313.
Code:
-            if( strcmp( vl.attribs[k].semanticName.c_str(), name ) == 0 )
+            if( vl.attribs[k].semanticName.compare(name) == 0 )


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 37 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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