Main  /  Edit  /  History  /   /  Users Area

Notes for Windows users

Introduction

There are several important differences between Windows and POSIX operating systems that may effect the way you work.

  1. Using DLL instead of ELF shared objects
  2. Debug and Release versions for MSVC

Using DLLs

First of all I strongly recommend using CppCMS as DLL instead of static libraries:

  1. It allows you to use dynamic loadable views
  2. It allows you to switch CppCMS's dll version without recompiling the application, for example due to security update.
  3. It makes it easier to handle dependencies as for example you should not link manually with zlib, pcre and optional openssl or ICU.

Compilation

When you compile your program to use DLL you must add DLL_EXPORT define at your project level. Such that the code would be compiled with this define.

It should be defined for all source files including dynamically loadable views.

When you are using Visual C++ compiler make sure you are using have "Enable C++ Exceptions" set /EHsc command line argument.

cl /EHsc -DDLL_EXPORT app.cpp cppcms.lib booster.lib

Libraries naming convention

By default, both static libraries and DLL's with import libraries are built, they have following naming conversion:

GCC/MinGW:

MSVC:

Cygwin:

Make sure you:

Building and using CppCMS under Visual Studio

Visual Studio is the only existing compiler that has incompatible debug and release runtime libraries and require separate compilation and linking of them.

So in order to build CppCMS correctly make sure

My personal recommendation is to create a set of debug and a set of release libraries in some location, let's say:

c:\apps\debug
c:\apps\debug\include
c:\apps\debug\lib
c:\apps\debug\bin

With all debug versions of libraries like pcre, zlib and so on, for example c:\apps\debug\bin\pcred.dll

And the same for release:

c:\apps\release
c:\apps\release\include
c:\apps\release\lib
c:\apps\release\bin

Such that the pcre.dll goes to c:\apps\release\bin\pcre.dll

And then run two separate builds:

For debug, open terminal and run:

cd z:\mybuilds\cppcms-1.0.1\
mkdir Debug
cd Debug
set PATH=c:\apps\debug\bin;%PATH%
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug 
  -DCMAKE_INCLUDE_PATH=c:/apps/debug/include 
  -DCMAKE_LIBRARY_PATH=c:/apps/debug/lib  
  -DCMAKE_INSTALL_PREFIX=c:/apps/debug
  ..
nmake
nmake test
nmake install

Then do the same for release, open separate terminal and run:

cd z:\mybuilds\cppcms-1.0.1\
mkdir Release
cd Release
set PATH=c:\apps\release\bin;%PATH%
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release 
  -DCMAKE_INCLUDE_PATH=c:/apps/release/include 
  -DCMAKE_LIBRARY_PATH=c:/apps/release/lib  
  -DCMAKE_INSTALL_PREFIX=c:/apps/release
  ..
nmake
nmake test
nmake install

This would make the life much simpler for you.


Troubleshooting | Top | Hello World

About

CppCMS is a web development framework for performance demanding applications.

Commercial

CppCMS is available under Open Source and Commercial Licenses.

For more details, visit our website: commercial.cppcms.com

Support This Project

SourceForge.net Logo

Поддержать проект

CppCMS needs You


Navigation

Main Page



Valid CSS | Valid XHTML 1.0