-
Microsoft Visual Studio 2022 or Visual Studio Community 2022
or
- Cppcheck a static code analysis tool for the C and C++.
If using Visual Studio, also download Visual Studio integration add-in for Cppcheck
- mpg123
- OpenAL-Soft
- wxWidgets 3.2.4 or higher
- FreeType Included
- gw2dattools Included
- gw2formats Included
- libogg Included
- libvorbis Included
- libwebp Included
- OpenGL Mathematics Included
- The OpenGL Extension Wrangler Library Included
- TinyXML2 Included
- Visual Leak Detector (for use with Visual Studio only)
If you want to use Visual Leak Detector, remove the comment for #include <vld.h>
in gw2browser.cpp
.
-
Crate a directory for source code some where, for example,
C:\DEV
. -
Open Git Bash window and change directory to the one you create above.
-
Use this command to download the source code.
git clone --recursive https://github.com/kytulendu/gw2browser.git
This will download gw2browser and all included library source code.
-
Download mpg123 binaries from here, choose the lastest Win32 or Win64 file and extract it to the same directory that gw2browser directory is in. Or download the source code and build it your self.
-
Download OpenAL-Soft binaries from here, extract it to the same directory that gw2browser directory is in. Or download the source code and build it your self.
-
Download wxWidgets source code from here, choose
wxWidgets-3.2.4.zip
orwxWidgets-3.2.4.7z
and extract it to the same directory that gw2browser directory is in. Or download and use the binaries.
Note: The library and source code directory must be in directory like this. The ROOT is the directory you created in Getting the source code.
[ROOT]
|
+--gw2browser
| |
| +--src
| +--...
|
+--mpg123
|
+--openal-soft
| |
| +--bin
| +--include
| +--lib
| +--...
|
+--wxWidgets-3.2.4
+--include
+--src
+--...
- Use solution file corresponding with your VS version in directory
wxWidgets-3.2.4/build/msw
. For example, VS2022 iswx_vc17.sln
, if there is no corresponding solution file for your newer VS, just open the highest version of solution file available.
-
Open a
x64 Native Tools Command Prompt for VS 2022
orx86 Native Tools Command Prompt for VS 2022
and change it's directory to mpg123's directory. -
Rename export definition file by using this command.
ren libmpg123-0.dll.def libmpg123-0.def
-
Build the library.
for 64 bit binary, use this command.
lib /MACHINE:X64 /DEF:libmpg123-0.def /OUT:libmpg123-0.lib
for 32 bit binary, use this command.
lib /DEF:libmpg123-0.def /OUT:libmpg123-0.lib
-
Open
x64 Native Tools Command Prompt for VS 2022
If you want to compile 32 bit library, usex86 Native Tools Command Prompt for VS 2022
instread. -
Change directory to
gw2browser/extern/libweb
-
Use this command to compile libwebp
nmake /f Makefile.vc CFG=debug-static RTLIBCFG=dynamic OBJDIR=obj nmake /f Makefile.vc CFG=release-static RTLIBCFG=dynamic OBJDIR=obj
-
Create vc2022 directory in
gw2browser/extern/freetype/builds/windows
-
Copy all content from vc2010 directory to vc2022 directory
-
Open
freetype.sln
solution file ingw2browser/extern/freetype/builds/windows/vc2022
with VS 2022 -
Choose
Debug Static
orRelease Static
configuration and choose to Win32 for 32 bit build or x64 for 64 bit build from two dropdown box in Visual Studio toolbar. -
Press F7 or in MenuBar -> Build -> Build Solution to compile freetype.
-
Open cmake-gui, put path of directory
gw2browser/extern/tinyxml2
toWhere is the source code:
-
Create a directory named
build-vc
ingw2browser/extern/tinyxml2
-
Put path of directory
gw2browser/extern/tinyxml2/build-vc
toWhere to build the binaries
-
Click
Configure
button -
Choose
Visual Studio 17 2022
then clickOK
-
Click
Generate
button -
Open
tinyxml2.sln
solution file ingw2browser/extern/tinyxml2/build-vc
-
Choose Debug or Release configuration.
-
Press F7 or in MenuBar -> Build -> Build Solution to compile tinyxml2.
-
Open
gw2browser.sln
solution file ingw2browser/prj
. -
Choose Debug or Release configuration and choose to Win32 for 32 bit build or x64 for 64 bit build from two dropdown box in Visual Studio toolbar.
-
Press F7 or in MenuBar -> Build -> Build Solution to compile gw2browser.
-
Copy
soft_oal.dll
fromopenal-soft/bin/Win32
oropenal-soft/bin/Win64
directory togw2browser/bin
and rename it toOpenAL32.dll
-
Copy
libmpg123-0.dll
from mpg123 directory togw2browser/bin
Make sure you have Cmake in your path.
Download TDM-GCC and install it to any location, for example C:\TDM-GCC-64
.
You must also add TDM-GCC to your path.
for example set your path to %path%;C:\TDM-GCC-64\bin
-
Open
libmpg123-0.def
with any text editor, like Notepad++ and insert this to the first line.LIBRARY libmpg123-0.dll
It will look some thing like this.
LIBRARY libmpg123-0.dll EXPORTS mpg123_add_string ...
-
Open Git Bash command line window and change directory to mpg123 directory and use these command.
dlltool -d libmpg123-0.def -l libmpg123-0.a
-
Open Git Bash command line window and change directory to
wxWidgets-3.2.4/build/msw
and use these command.mingw32-make -j 4 -f makefile.gcc BUILD=debug SHARED=1
If it give error, re-type it again. Wait for it to finish, then use these command.
mingw32-make -j 4 -f makefile.gcc BUILD=release SHARED=1
This will build wxWidgets in debug and release configuration as a dynamiclink library. If you want static library, remove
SHARED=1
from the commandline. But you have to change library search path in CodeBlocks project file fromgcc_dll
togcc_lib
.mingw32-make -j 4 -f makefile.gcc BUILD=debug mingw32-make -j 4 -f makefile.gcc BUILD=release
-
If you need to rebuild, use "clean" target first.
mingw32-make -j 4 -f makefile.gcc BUILD=debug SHARED=1 clean mingw32-make -j 4 -f makefile.gcc BUILD=release SHARED=1 clean mingw32-make -j 4 -f makefile.gcc BUILD=debug clean mingw32-make -j 4 -f makefile.gcc BUILD=release clean
-
Open Git Bash command line window and change directory to
gw2browser/extern/glew
and use these commandcmake -G "MinGW Makefiles" ./build/cmake mingw32-make
-
Open Git Bash command line window and change directory to
gw2browser/extern/libogg
and use these commandmkdir build && cd build cmake -G "MinGW Makefiles" .. -DBUILD_SHARED_LIBS=ON mingw32-make
-
Open Git Bash command line window and change directory to
gw2browser/extern/libvorbis
and use these commandmkdir build && cd build cmake -G "MinGW Makefiles" .. -DBUILD_SHARED_LIBS=ON -DOGG_INCLUDE_DIR="D:/devel/gw2browser/extern/libogg/include" -D OGG_LIBRARY="D:/devel/gw2browser/extern/libogg/build/libogg.dll.a" mingw32-make
-
Open Git Bash command line window and change directory to
gw2browser/extern/libwebp
and use these commandmkdir build && cd build cmake -G "MinGW Makefiles" .. -DBUILD_SHARED_LIBS=ON mingw32-make
-
Open Command Prompt and change directory to
gw2browser/extern/freetype
and use these commandmkdir build && cd build cmake -G "MinGW Makefiles" .. -DBUILD_SHARED_LIBS=ON mingw32-make
-
Open Command Prompt and change directory to
gw2browser/extern/tinyxml2
and use these commandmkdir build && cd build cmake -G "MinGW Makefiles" .. -DBUILD_SHARED_LIBS=ON mingw32-make
-
Open workspace file
gw2browser.workspace
ingw2browser/prj
with CodeBlocks. -
Compile gw2browser by right click and select gw2browser as active project, choose debug or release build, then click the gear button in toolbar or press CTRL+F9 key or in MenuBar -> Build -> Build.
-
Copy
libgomp_64-1.dll
from TDM-GCC install directory togw2browser/bin
-
Copy
soft_oal.dll
fromopenal-soft/bin/Win32
oropenal-soft/bin/Win64
directory togw2browser/bin
and rename it toOpenAL32.dll
-
Copy
libmpg123-0.dll
from mpg123 directory togw2browser/bin
-
Copy
glew32.dll from
gw2browser/extern/glew/bindirectory to
gw2browser/bin` -
Copy
libtinyxml2.dll
fromgw2browser/extern/tinyxml2/build
directory togw2browser/bin
-
Copy
libogg.dll
fromgw2browser/extern/libogg/build
directory togw2browser/bin
-
Copy
libvorbis.dll
andlibvorbisfile.dll
fromgw2browser/extern/libvorbis/build/lib
directory togw2browser/bin
-
Copy
libwebpdecoder.dll
fromgw2browser/extern/libwebp/build
directory togw2browser/bin
-
Copy following dll files from
wxWidgets-3.2.4/lib/gcc_dll
directory togw2browser/bin
wxbase32u_gcc_custom.dll wxmsw32u_aui_gcc_custom.dll wxmsw32u_core_gcc_custom.dll wxmsw32u_gl_gcc_custom
If debug build, also copy these dll files.
wxbase32ud_gcc_custom.dll wxmsw32ud_aui_gcc_custom.dll wxmsw32ud_core_gcc_custom.dll wxmsw32ud_gl_gcc_custom
For this guide, I was using Kubuntu and ArchLinux, but this guide can be adapt to work with any Linux distribution.
-
Download wxWidgets 3.2 source code from here, choose wxWidgets-3.2.4.tar.bz2 and extract it to somewhere, for example, your home directory. If your Linux distribution have wxWidgets 3.2 package, you can skip this and use a command like below command to install wxWidgets 3.2.
for Debian and it's derivative
sudo apt install libwxbase3.2-dev libwxgtk3.2-dev
for ArchLinux and it's derivative
sudo pacman -S wxwidgets-common wxwidgets-gtk3
Or download wxWidgets's repository using this command.
git clone https://github.com/wxWidgets/wxWidgets.git
-
Open a terminal window, the directory would be in your home directory.
-
Install git by using this command. You can skip this step if you have already install git.
for Debian and it's derivative
sudo apt install git git-gui
for ArchLinux and it's derivative
sudo pacman -S git git-gui
-
Use this command to install required library and tools.
for Debian and it's derivative
sudo apt install build-essential codeblocks cmake cmake-gui libwebp-dev libglew-dev libopenal-dev libmpg123-dev libvorbis-dev libogg-dev libfreetype6 libfreetype6-dev libtinyxml2-dev libglm-dev
for ArchLinux and it's derivative
sudo pacman -S gcc codeblocks cmake libwebp glew openal mpg123 libvorbis libogg freetype2 tinyxml2 glm
-
Use this command to download the source code.
git clone --recursive https://github.com/kytulendu/gw2browser.git
This will download gw2browser and all included library source code, although we won't use most of the library that was included in the repo.
-
If your system have wxWidgets 3.2 package, you can skip this step.
-
Open a terminal window and change directory to wxWidgets source code directory you have extracted.
-
Make a directory using this command
mkdir gtk-build
-
Change directory to the directory you make previously, in this case, gtk-build directory.
cd gtk-build
-
Use this command to config the build script and wait for it to finish.
../configure --enable-unicode --enable-debug --with-opengl
-
Use this command to compile wxWidgets source code.
make
or
make -j 4
-
When finished, use this command to install wxWidgets
sudo make install
-
After that use this command
sudo ldconfig
-
Open a terminal window and change directory to extern/gw2dattools source code directory you have extracted.
-
Make a directory using this command
mkdir build
-
Change directory to the directory you make previously, in this case, build directory.
cd build
-
Use this command to and wait for it to finish.
cmake ..
-
Use this command to compile gw2dattools source code.
make
or
make -j 4
-
When finished, use this command to install gw2dattools
sudo make install
-
Open a terminal window and change directory to extern/gw2formats source code directory you have extracted.
-
Make a directory using this command
mkdir build
-
Change directory to the directory you make previously, in this case, build directory.
cd build
-
Use this command to and wait for it to finish.
cmake ..
-
Use this command to compile gw2formats source code.
make
or
make -j 4
-
When finished, use this command to install gw2formats
sudo make install
-
Open a terminal window and change directory to gw2browser directory.
-
Make a directory using this command
mkdir build
-
Change directory to the directory you make previously, in this case, build directory.
cd build
-
Use this command to and wait for it to finish.
cmake ..
-
Use this command to compile gw2browser source code.
make
or
make -j 4
-
When finished, use this command to install gw2browser
sudo make install
Todo