Horde3D

Next-Generation Graphics Engine
It is currently 27.11.2024, 18:33

All times are UTC + 1 hour




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: DLL Confusion
PostPosted: 08.01.2010, 00:46 
Offline

Joined: 09.09.2009, 18:58
Posts: 107
Ok, I know how to use static libraries, but Dynamic Libraries ... ehhhhh I'm lost. Do I need to tell the compiler to link it or is all loading and linking done in h3dInit? And are the only H3D files I need to compile into my program Horde3D.h and Horde3DUtils.h or do I need to include everything else as well?

Main question is this, how in the hell does that all work?


Top
 Profile  
Reply with quote  
 Post subject: Re: DLL Confusion
PostPosted: 08.01.2010, 01:04 
Offline

Joined: 08.11.2006, 03:10
Posts: 384
Location: Australia
It depends on the OS you're using :?

On windows, when you compile Horde it produces a .lib and a .dll

When you compile your game, you include Horde3D.h and you link to the LIB file (just like with a static library). The DLL file must be placed alongside your EXE in order to run your game.


Top
 Profile  
Reply with quote  
 Post subject: Re: DLL Confusion
PostPosted: 08.01.2010, 01:09 
Offline

Joined: 09.09.2009, 18:58
Posts: 107
Alright, and Windows is all I am concerning myself with for now. For the record, what about Linux and Mac?

Also, I'd like to post a log of the compile I did only because I find Warnings irksome for some reason.
Code:
||=== Horde3D Engine, Release Win32 ===|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utOpenGL.h|26|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utTimer.h|20|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utOpenGL.h|26|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utTimer.h|20|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utOpenGL.h|26|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utOpenGL.h|26|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utTimer.h|20|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utOpenGL.h|26|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utOpenGL.h|26|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utTimer.h|20|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utOpenGL.h|26|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utOpenGL.h|26|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utOpenGL.h|26|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\egRenderer.cpp|1994|warning: no newline at end of file|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utOpenGL.h|26|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utTimer.h|20|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utOpenGL.h|26|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utOpenGL.h|26|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utTimer.h|20|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utOpenGL.h|26|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
C:\Users\orm\Desktop\Project Data\Horde3D_SDK_1.0.0_Beta4\Horde3D_SDK_1.0.0_Beta4\Horde3D\Source\Horde3DEngine\utOpenGL.h|26|warning: "NOMINMAX" redefined|
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\mingw32\bits\os_defines.h|46|warning: this is the location of the previous definition|
||=== Build finished: 0 errors, 41 warnings ===|


Might want to keep that "NOMINMAX" define warning in mind for the next version.


Top
 Profile  
Reply with quote  
 Post subject: Re: DLL Confusion
PostPosted: 08.01.2010, 16:19 
Offline

Joined: 15.06.2008, 11:21
Posts: 166
Location: Germany
Well, linux behaves a bit different with shared libraries (they are called .so instead of .dll here):
You don't need any .lib, you link directly to the .so, and usually the shared object is then placed in some special path (/usr/lib or /usr/local/lib), if you want to put it next to your application, you have to compile it with a rpath directive. CMake e.g. does this automatically.

Oh, MinGW btw usually does not create a .lib, it creates a .a

And about the warning:
This should fix it (to appear soon in my horde3d hg repository -.-):
Code:
diff --git a/Horde3D/Source/Horde3DEngine/utOpenGL.h b/Horde3D/Source/Horde3DEngine/utOpenGL.h
--- a/Horde3D/Source/Horde3DEngine/utOpenGL.h
+++ b/Horde3D/Source/Horde3DEngine/utOpenGL.h
@@ -23,9 +23,11 @@
 
 #ifdef PLATFORM_WIN
 #   define WIN32_LEAN_AND_MEAN 1
-#   define NOMINMAX
+#   ifndef NOMINMAX
+#       define NOMINMAX
+#   endif
 #   include <windows.h>
-#   include <stddef.h>
+#   include <stddef.h>
 #   define GLAPI __declspec( dllimport )
 #   define GLAPIENTRY _stdcall
 #   define GLAPIENTRYP _stdcall *
@@ -38,7 +40,7 @@
 #      include <Carbon/Carbon.h>
 #   else
 extern "C" void (*glXGetProcAddressARB( const unsigned char *procName ))( void );
-#   endif
+#   endif
 #endif
#endif


Top
 Profile  
Reply with quote  
 Post subject: Re: DLL Confusion
PostPosted: 11.01.2010, 01:38 
Offline

Joined: 09.09.2009, 18:58
Posts: 107
That go in Horde3D.h?


Top
 Profile  
Reply with quote  
 Post subject: Re: DLL Confusion
PostPosted: 11.01.2010, 09:41 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
No in utOpenGL.h. See:

Quote:
diff --git a/Horde3D/Source/Horde3DEngine/utOpenGL.h b/Horde3D/Source/Horde3DEngine/utOpenGL.h
--- a/Horde3D/Source/Horde3DEngine/utOpenGL.h
+++ b/Horde3D/Source/Horde3DEngine/utOpenGL.h


Top
 Profile  
Reply with quote  
 Post subject: Re: DLL Confusion
PostPosted: 11.01.2010, 10:10 
Offline

Joined: 08.11.2006, 03:10
Posts: 384
Location: Australia
If I've read that patch right, it means

Open up utOpenGL.h

Remove:
# define NOMINMAX

And replace it with:
# ifndef NOMINMAX
# define NOMINMAX
# endif


Top
 Profile  
Reply with quote  
 Post subject: Re: DLL Confusion
PostPosted: 11.01.2010, 12:51 
Offline

Joined: 09.09.2009, 18:58
Posts: 107
Right, right. God I need more sleep. :roll:


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: Bing [Bot] and 25 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:  
Powered by phpBB® Forum Software © phpBB Group