[ptx] Hugin windows compilation

alexandre jenny alexandre.jenny at le-geo.com
Tue Nov 25 12:47:42 GMT 2003


So, hi everybody,

I will be in charge of the windows compilation of hugin. So I'm taking some
time to clean little problems in the code. Let's make some clarification of
what I want to do :
- First, I'll be using visual.net for the compilation. Why ? the ide is
great and in the future we could use some top end compilers to get a really
powerfull and fast hugin (I'm thinking of intel's one, of course).
- Secondly, for doing the compilation in visual, I have to clean a little
bit the code. The main problem is always the same, it's the #include orders.
In windows, we have some bad named defines which can cause problem. So I've
tried to and managed to simplified this by regrouping all the dependencies
of every files from hugin in 2 files :

----
panoinc.h -> will contains something like that (it is totally WX
independant)
----

// =====
// ===== Standard Includes
// =====
#include <vector>
#include <set>
#include <string>
#include <sstream>
#include <fstream>
#include <iostream>
#include <math.h>

// =====
// ===== VIGRA library
// =====
#include "vigra/basicimage.hxx"

// =====
// ===== Hugin specific with no dependencies to WX
// =====
#include "common/math.h"
#include "common/utils.h"
#include "common/stl_utils.h"

#include "PT/PanoImage.h"
#include "PT/PanoramaMemento.h"
#include "PT/PanoCommand.h"

----
panoinc_WX.h : is dependant to WX
----

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
    #pragma hdrstop
#endif
// For all others, include the necessary headers (this file is usually all
you
// need because it includes almost all "standard" wxWindows headers)
#ifndef WX_PRECOMP
    #include "wx/wx.h"
#endif

Why doing this ? Because WX is declaring some strange min max and so on
stuff and it has to be included after vigra absolutely.
So in every file, we will have something like that :

// more standard includes if needed
#include <algorithm>
#include <float.h>

// standard hugin include
#include "panoinc.h"

// more vigra include if needed
#include "vigra/cornerdetection.hxx"
#include "vigra/localminmax.hxx"

// standard wx include
#include "panoinc_WX.h"

// more WX includes if needed
#include "wx/xrc/xmlres.h"              // XRC XML resouces
#include "wx/notebook.h"
#include "wx/listctrl.h"
#include "wx/config.h"

// hugin's
#include "hugin/huginApp.h"
#include "hugin/ImageProcessing.h"
#include "hugin/CommandHistory.h"
#include "hugin/ImageCache.h"
#include "hugin/CPImageCtrl.h"
#include "hugin/TextKillFocusHandler.h"
#include "hugin/CPEditorPanel.h"

So that was the first problem.

There are also some issues with some strange prototyping declaration like :
template <class T>
bool PT::getParam(T & value, const std::string & line, const std::string &
name)
As you are already in the PT namespace, the PT:: is a double declaration
within a namespace and it's not allowed in visual. So removing it does
change anything but allows compilation.

Some little problems :
- Why impex.hxx isn't in the vigra folder ? It isn't even in the cvs.
- I found other .h that are missing like testpanel.h (I suppose it's just a
test, so I've removed it from compilation).

See you

Alexandre






More information about the ptX mailing list