libRocket is a mit licensed gui lib, which works with ogre 3d. Under windows it support vc++ 2010 by default. I try to build it with mingw32.
I had these problems.
error: invalid suffix "fh" on integer constant and strcpy_s not declared. Those are vc++ related. And freetype2 directory should also be modified. I have to patch the source code.
Here is my patch:
Only in patched//Build: .E
Only in patched//Build: CMakeCache.txt
Only in patched//Build: CMakeFiles
diff -rup libRocket//Build/CMakeLists.txt patched//Build/CMakeLists.txt
--- libRocket//Build/CMakeLists.txt 2010-11-30 17:53:58 -0500
+++ patched//Build/CMakeLists.txt 2012-06-08 11:13:54 -0400
@@ -53,9 +53,9 @@ endif()
# FreeType
if(WIN32)
- set(FREETYPE_INCLUDE_DIRS ../../support/freetype/include)
- set(FREETYPE_LIBRARY freetype243MT.lib)
- set(FREETYPE_LINK_DIRS ../../support/lib)
+ set(FREETYPE_INCLUDE_DIRS ../../freetype-2.4.9/include)
+ set(FREETYPE_LIBRARY libfreetype-6.dll)
+ set(FREETYPE_LINK_DIRS ../../freetype-2.4.9/objs/.libs)
set(FREETYPE_FOUND TRUE)
else()
find_package(Freetype REQUIRED)
Only in patched//Build: Makefile
Only in patched//Build: cmake_install.cmake
Only in patched//Build: libRocketControls.dll
Only in patched//Build: libRocketControls.dll.a
Only in patched//Build: libRocketCore.dll
Only in patched//Build: libRocketCore.dll.a
Only in patched//Build: libRocketDebugger.dll
Only in patched//Build: libRocketDebugger.dll.a
diff -rup libRocket//Source/Controls/Clipboard.cpp patched//Source/Controls/Clipboard.cpp
--- libRocket//Source/Controls/Clipboard.cpp 2010-11-30 19:48:44 -0500
+++ patched//Source/Controls/Clipboard.cpp 2012-06-08 11:36:01 -0400
@@ -107,8 +107,11 @@ void Clipboard::Set(const Core::WString&
_content.ToUTF8(win32_content);
HGLOBAL clipboard_data = GlobalAlloc(GMEM_FIXED, win32_content.Length() + 1);
+#if defined (__MINGW32__)
+ strncpy((char*) clipboard_data, win32_content.CString(), win32_content.Length() + 1);
+#else
strcpy_s((char*) clipboard_data, win32_content.Length() + 1, win32_content.CString());
-
+#endif
if (SetClipboardData(CF_TEXT, clipboard_data) == NULL)
{
CloseClipboard();
diff -rup libRocket//Source/Core/Math.cpp patched//Source/Core/Math.cpp
--- libRocket//Source/Core/Math.cpp 2010-11-30 19:48:44 -0500
+++ patched//Source/Core/Math.cpp 2012-06-08 11:25:17 -0400
@@ -144,7 +144,7 @@ ROCKETCORE_API int RoundDown(float value
// Efficiently truncates a floating-point value into an integer.
ROCKETCORE_API int RealToInteger(float value)
{
-#if defined ROCKET_PLATFORM_WIN32
+#if defined (ROCKET_PLATFORM_WIN32) && !defined (__MINGW32__)
int i;
_asm
{
No comments:
Post a Comment