Jump to content

HOWTO : easy way to build GemRB on windows


zefklop

Recommended Posts

I know that i sound like a pro n00b right now... but what to do with the libraries from the "GemRB dependencies for MinGW (libs)" package. In short where to put them and make them work for the "cmake .. -G "MinGW Makefiles" command.

 

WinXP , want to run Baldur's Gate 2

 

Please help

Link to comment
I know that i sound like a pro n00b right now... but what to do with the libraries from the "GemRB dependencies for MinGW (libs)" package. In short where to put them and make them work for the "cmake .. -G "MinGW Makefiles" command.

 

WinXP , want to run Baldur's Gate 2

 

Please help

 

Unzip it to wherever mingw sits, so that the contents of the \include and \lib folders in the zip gets put into <mingw>\include and <mingw>\lib.

 

Also, you might need to add the path to libpng to the gemrb-built.bat, so the line that says

set PATH=%PATH%;c:\mingw\bin;c:\mingw\include;c:\mingw\lib;c:\mingw\include\SDL;c:\mingw\include\AL;

is changed to

set PATH=%PATH%;c:\mingw\bin;c:\mingw\include;c:\mingw\lib;c:\mingw\include\SDL;c:\mingw\include\AL;c:\mingw\include\libpng12;

else it might not be found (I had to do that change, I'm on Windows 7 but that shouldn't matter).

 

Of course, PNG support isn't needed to play BG2, so you shouldn't notice a difference.

Link to comment

Hey,

 

I've got some trouble with the latest version (from the GIT Repo).

 

after the

 

C:\Programme\sourceGEMRB\build2>cmake .. -G "MinGW Makefiles"

-- The C compiler identification is GNU

-- The CXX compiler identification is GNU

-- Check for working C compiler: C:/Programme/MinGW/bin/gcc.exe

-- Check for working C compiler: C:/Programme/MinGW/bin/gcc.exe -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Check for working CXX compiler: c:/Programme/mingw/bin/g++.exe

-- Check for working CXX compiler: c:/Programme/mingw/bin/g++.exe -- work

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Looking for Python libraries

-- Found PythonLibs: C:/Programme/Python265/libs/libpython26.a

-- Python Libraries Found

-- Looking for openAL libraries

-- openal found

-- Looking for SDL

-- Looking for include files CMAKE_HAVE_PTHREAD_H

-- Looking for include files CMAKE_HAVE_PTHREAD_H - not found.

-- Found Threads: TRUE

-- SDL found

-- Looking for Zlib

-- Found ZLIB: C:/Programme/MinGW/lib/libz.dll.a

-- Looking for libPNG

-- Found PNG: C:/Programme/MinGW/lib/libpng.dll.a

-- libPNG found

-- Looking for Ogg Vorbis support

-- Looking for sys/types.h

-- Looking for sys/types.h - found

-- Looking for stdint.h

-- Looking for stdint.h - found

-- Looking for stddef.h

-- Looking for stddef.h - found

-- Check size of int

-- Check size of int - done

-- Check size of long int

-- Check size of long int - done

-- Looking for snprintf

-- Looking for snprintf - found

-- Looking for strndup

-- Looking for strndup - not found

-- Configuring done

-- Generating done

-- Build files have been written to: C:/Programme/sourceGEMRB/build2

 

 

 

mingw32-make produces

 

Scanning dependencies of target gemrb_core

[ 1%] Building CXX object gemrb/plugins/Core/CMakeFiles/gemrb_core.dir/Actions.

obj

cc1plus.exe: error: unrecognized command line option "-fvisibility=hidden"

mingw32-make[2]: *** [gemrb/plugins/Core/CMakeFiles/gemrb_core.dir/Actions.obj]

Error 1

mingw32-make[1]: *** [gemrb/plugins/Core/CMakeFiles/gemrb_core.dir/all] Error 2

mingw32-make: *** [all] Error 2

 

With an old version of the source, I had (alsmost) no problems.

 

What can I do? Is it a problem with the version, or is it a problem with my system?

Thanks!

 

Mav

Link to comment
What can I do? Is it a problem with the version, or is it a problem with my system?

 

I think your compiler is probably a bit older than anything we'd checked, that's all. I updated the cmake files to check whether the flag works before trying to use it, please try it again.

Link to comment

Thanks!

 

Yes, indeed, I used a old version (3.x) - but I was under the (false) impression that the mingw-autoInstaller will fetch the newest version, as I followed the instruction of the first post.

Maybe one should add the link to the "how-to" page of minGW in the first post: http://www.mingw.org/wiki/Getting_Started

 

Automated Installer

 

Note: The automated installer is now considered deprecated, and is currently unmaintained; it will not install GCC 4. You will get GCC 3 using this method. If you want to install the latest GCC release, use the Manual Installation method below.

Link to comment

Hi,

 

for the last 5 hours I've been trying to compile GemRB under Windows 7 (32bit), but without success :)

 

C:\GemRB\build>cmake .. -G "MinGW Makefiles"
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: c:/mingw/bin/g++.exe
-- Check for working CXX compiler: c:/mingw/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
Detected version:
-- Performing Test VISIBILITY_HIDDEN
-- Performing Test VISIBILITY_HIDDEN - Failed
-- Looking for Python libraries
-- Found PythonLibs: C:/Python26/libs/libpython26.a
-- Python Libraries Found
-- Looking for openAL libraries
-- openal found
-- Looking for SDL
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- SDL found
-- Looking for Zlib
-- Found ZLIB: C:/MinGW/lib/libz.dll.a
-- Looking for libPNG
-- Found PNG: C:/MinGW/lib/libpng.dll.a
-- libPNG found
-- Looking for Ogg Vorbis support
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of int
-- Check size of int - done
-- Check size of long int
-- Check size of long int - done
-- Looking for snprintf
-- Looking for snprintf - found
-- Looking for strndup
-- Looking for strndup - not found
-- Configuring done
-- Generating done
-- Build files have been written to: C:/GemRB/build

 

well, that sounds promising...

 

C:\GemRB\build>mingw32-make
Scanning dependencies of target gemrb_core
[  1%] Building CXX object gemrb/core/CMakeFiles/gemrb_core.dir/Actions.obj
cc1plus.exe: warnings being treated as errors
In file included from C:\GemRB\gemrb\core\/GSUtils.h:22:0,
			 from C:\GemRB\gemrb\core\Actions.cpp:23:
C:\GemRB\gemrb\core\/Interface.h:31:0: Fehler: ignoring #pragma warning
mingw32-make[2]: *** [gemrb/core/CMakeFiles/gemrb_core.dir/Actions.obj] Error 1
mingw32-make[1]: *** [gemrb/core/CMakeFiles/gemrb_core.dir/all] Error 2
mingw32-make: *** [all] Error 2

 

oh what the...

 

It looks similar to the problem Maverick had, so I checked if I was using the right version of MinGW and GCC.

As far as I can tell I am using the most recent versions (mingw32-gcc-4.4.0.exe; most of the other binaries from 2010).

 

I really don't know why it isn't working :laugh:

 

PS: I am using the source from the GIT Repository (from ~6 hours ago)

Link to comment

I'm apparently having problems compiling... again. Using gcc 4.5.0.

 

As far as I can discern, it seems to build fine. The binaries don't agree though, the only thing I get trying to run gemrb.exe is an error complaining about the missing file "libgcc_s_dw2-1.dll", locating that one and placing it in gemrb's directory instead makes it complain about "libstdc++-6.dll".

 

I don't remember either of these files from back when I was blissfully unaware that the MinGW automatic installer installed an old version of gcc. No matter, after both of these files are placed inside gemrb's directory, it gives a final error: "The application was unable to start correctly (0xc0000005). Click OK to close the application."

 

I can read the build log, but I do not understand it, as I don't know what to look for.

 

Build log ("cmake", "mingw32-make", "mingw32-make install" run in a bat file after each other, breaking and quitting if any of the commands of the commands outputs an error number other than 0):

... bah, bugger. Messing with various quote, code, and codebox blocks and finally deciding I can't make it not break the forum, I uploaded the log here.

 

Bat file:

@IF NOT EXIST build32_mingw MKDIR build32_mingw
@PUSHD build32_mingw
@ECHO Building 32-bit version using MinGW
cmake ..\gemrb -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=G:\GemRB_Git
@IF NOT "%ERRORLEVEL%"=="0" GOTO error
mingw32-make
@IF NOT "%ERRORLEVEL%"=="0" GOTO error
mingw32-make install
@IF NOT "%ERRORLEVEL%"=="0" GOTO error
@ECHO Build and install Successful
@GOTO end
:error
@ECHO ERROR: %ERRORLEVEL%
:end
@POPD

 

I got the suggestion on IRC to check wether my build environment was broken by trying to compile a simple hello world, so I did:

 

This one compiles and runs without any extras:

gcc hello.cpp -o hello -lstdc++

#include <stdio.h>
int main() {
printf("Hello, world!");
return 0;
}

 

GCC says stuff when trying to compile this one, and the binary runs only after the same two dll's from above can be found (in path or the active directory):

gcc hello2.cpp -o hello2 -lstdc++

#include <iostream>
int main() {
std::cout << "Hello, world!";
}

 

specifically, this is said:

Info: resolving std::cout  by linking to __imp___ZSt4cout (auto-importc:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line.
This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.)

Link to comment

Well, without knowing enough about this environment, my guess is: gemrb is complex enough that this condition would fail:

 

"unless it involves constant data structures referencing symbols from auto-imported DLLs"

 

Do you have the same message in case of GemRB?

 

I have absolutely no idea how to fix the problem, though :suspect:

Link to comment

I'm trying to compile GemRB with Visual C++ Express 2010. There is a very good chance that will build without any problems. This way is much easier than using mingw and gcc. Besides MSCC 10.0 makes more appropriate code for new versions of Windows.

Visual Studio IDE contains very good code editor with IntelliSense and debugger.

 

If necessary, I can place my project files in the WEB.

Link to comment
cmake can generate the project files for you, just pass -G "Visual Studio 10" (or something like that). This will instruct it to create that instead of the unix makefiles.

Not works for me.

Says "CMake Error: Could not create named generator Visual Studio 2010"

 

Add: CMake works, after paths configuration, but generate nothing. I do it manually, it will be faster and easier.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...