-
Unzip the
VisualC.zip file in the root ParaGUI directory.
Be certain that you unzip it into this directory and not any other directory.
If you are using WinZip, be careful to make sure that it extracts into this
folder, because it's convenient feature of unzipping to a folder with the
name of the file currently being unzipped will get you in trouble if you
use it right now.
-
Go into the
VisualC directory that is created, and open the workspace file "
paragui_all.dsw " with MSVC++.
You may be prompted at this point to upgrade the workspace, if you are
using a more recent version of MSVC++. If so, allow the workspace to be
upgraded.
-
Choose dynamic
or static paragui project.
This is done by right clicking on each project in turn (Projects are
listed in the Workspace panel in the FileView tab), and selecting "Set as
active project".
-
ParaGUI depends
on sdl.lib, sdl_ttf.lib, sdl_image.lib (when HAVE_SDLIMAGE is defined) and
freetype.lib
You need to supply these libraries to the linker. There are three ways
how to do this:
- Go to "Tools|Options|Directories|Library
files", and add proper paths to all listed .lib files
- Go to "Project|Settings|Link|Category:
Input|Additional Library Path", add here path to libs (relative or
absolute)
- Find .lib files
and copy them into /lib directory in your ParaGUI root. This dir is preset
to be on the library path.
You also need set
paths to header files of these libraries. There are also several ways how
to do this:
- Go to "Tools|Options|Directories|Include
files", and add proper paths to all listed .lib files
- Go to "Project|Settings|C/C++|Category:
Preprocessor|Additional Include directories", add here paths to headers
(relative or absolute)
- Find .h files
and copy them into /include directory in your ParaGUI root. This dir
is preset to be on the include path.
-
Choose the proper
configuration from "Build|Configurations...":
For paragui_dynamic there are
-
Release
=> produces release mode dynamic link library and import library
[bin/paragui.dll, lib/paragui.lib]
-
Debug = >
produces debug mode dynamic link library and import library [bin/paraguid.dll,
lib/paraguid.lib]
For paragui_static
there are
-
Build the project
with the "Project|Build" command.
You may get a few warnings, but you should not get any errors. If
yes check again step 4. If you did it all correctly, check types of
libraries sdl.lib, sdl_ttf.lib, sdl_image.lib, freetype.lib. They must
be compiled in mode Multithreaded DLL. Anyway check troubleshoting section.
-
Your library
files are created. Check if you find them in /lib and /bin directories.
-
I don't want to use SDL_Image library. I just want to load BMP files.
Answer: remove HAVE_SDLIMAGE define from project settings.
"Project|Settings|C/C++|Category: Preprocessor|Preprocessor definitions".
Now you don't have to supply sdl_image.lib and SDL_Image header files.
-
I want to link example files statically with ParaGUI.
Answer
: specify another ParaGUI library to link with in project setting: "Project|Settings|Link|Category:
General|Object/library modules", change paragui.lib to paraguis.lib (or
paraguid.lib to paraguisd.lib), or use multithreaded versions of static
library. Don't forget to set proper code generation for example project:
"Project|Settings|C/C++|Category: Code generation|Use runtime library.
-
I get compiler errors like: "fatal error C1083: Cannot open include
file: 'SDL_image.h': No such file or directory"
Answer: header files of library were not found by the
compiler. You did step 4b wrong.
-
I get linker errors like: "fatal error LNK1104: cannot open file "sdl.lib""
Answer: lib file was not found by the linker. You did
step 4a wrong.
-
I get linker errors like: "error LNK2005: __alloc_osfhnd already
defined in LIBC.lib(osfinfo.obj)"
Answer: you are mixing libraries of different types
(static vs. dynamic, multithreaded vs. singlethreaded, etc.)
-
I get linker warnings like: "warning LNK4098: defaultlib "msvcrt.lib"
conflicts with use of other libs; use /NODEFAULTLIB:library"
Answer: you are mixing libraries of different types (static
vs. dynamic, multithreaded vs. singlethreaded, etc.), but it was only a warning
- the project got compiled.