Personal tools

Skip to content. | Skip to navigation

You are here: Home Software MILXView MILXView: Porting from Linux (Ubuntu) to Windows XP (Visual Studio 2008)

MILXView: Porting from Linux (Ubuntu) to Windows XP (Visual Studio 2008)

The page lists the majority of errors encountered and their solutions when porting MILXView and its third party products, namely ITK, VTK and WxWidgets, to run on a windows platform from a Linux (Ubuntu platform).

About this Page and its structure

This page will hopefully assist any users wishing on embarking on a similar port of software from Linux to Windows.

MILXView is built upon 3 main 3rd party products: ITK, VTK and WxWidgets. Solutions to problems due to the result of migrating these will also be identified.

The generic errors received and their solutions whilst porting MILXView from Linux (Ubuntu) to Windows XP (Visual Studio 9 2008 will be split into "Compilation and Linking errors" and "run-time errors".  Each error is located in its own table. The error appears in the top row and the solution below it. 

The work is still on-going and hence the page will be continually updated.

MILXView Overview

Medical imaging is a vital clinical and research tool that has made significant strides in the last few decades with impressive advances in acquisition technology. However, image analysis and interpretation is still primarily performed manually, and is difficult to automate.

The Biomedical Imaging team at the Australian e-Health Research Centre (AEHRC) is developing a library of image processing algorithms that can be called from their core software platform: MILXView. MILXView is a 3D medical imaging analysis and visualization platform providing:

  • standard medical imaging functions such as windowing, histogram inspection, panning, slicing, zooming, and metadata inspection;
  • 3D visualization tools such as maximum intensity projection, volume and surface rendering, 3D multi-slicing screenshot, volume rendering, color map, overlay, blending, checkerboard, registration and manipulation of 3D polygon meshes;
  • and Data manipulation in voxel or scanner space: manual rotation scaling, zooming and translation.

Individual or large batch of image analysis tasks can be scheduled and run automatically from MILXView.

MILXView is was designed and developed to support internal research efforts, and provide a viable and robust environment for clinical applications. It is designed to provide a familiar an intuitive user interface for radiologists and clinicians.

MILXView is available free download from http://www.ict.csiro.au/downloads.php?swid=15&title=MILXView for non-commercial use.

MILXview Porting errors and solutions

MILXView Porting Compilation Errors

This section will describe the errors and the solutions used to overcome the compilation errors observed during the port.

 

Compilation Error 1
LINK : fatal error LNK1104: cannot open file 'boost_program_options-vc90-mt-1_40.lib'
Solution By default boost libraries are linked staticall so download the libbboost_*.lib files from http://www.boostpro.com/download
Compilation Error 2
ITK & VTK various link /compile errors
Solution Build ITK and VTK libraries with BUILD_SHARED_LIBS on
Compilation Error 3
Can't find Glew
Solution Check location of glew in FindGLEW.cmake (in Utilitites/Cmake) directory
Compilation Error 4
WxWidgets compile / link errors
Solution Download the “wxAll” option - all wxWidgets ports (other formats: bz2, zip) from http://www.wxwidgets.org and build "DLL Unicode Debug" and "DLL Unicode Release"versions of WxWidgets
Compilation Error 5
10>C:\milx-view\include\view/vtkWXOpenGLRenderWindow.h(31) : error C2504: 'wxGLCanvas' : base class undefined
Solution Open $(WXWIDGETS)\include\wx\msw\setup.h and replace

Code: Select all
    #define wxUSE_GLCANVAS 0

WITH

Code: Select all
    #define wxUSE_GLCANVAS 1



7.2 Open $(WXWIDGETS)\include\wx\univ\setup.h and replace

Code: Select all
    #if defined(__WIN32__)
       #define wxUSE_GLCANVAS 1
    else  
        #define wxUSE_GLCANVAS 0


WITH

Code: Select all
    #define wxUSE_GLCANVAS 1


7.3 While we're at it, also check in the previous two files, if the defines wxUSE_EXCEPTIONS and wxUSE_ABOUTDLG are set to 1 (this is the default, so it should be on). This is mandatory and CELayoutEditor will not compile without it.

Code: Select all
    #define wxUSE_EXCEPTIONS 1


Code: Select all
    #define wxUSE_ABOUTDLG 1


7.4 Rebuild the WX solution in 'Unicode Debug' and 'Unicode Release' configurations

 

Compilation Error 6
Can't find ZLib
Solution download the zlib binaries for windows and set the location in ~/milx-view/Utilities/CMake/FindZLIB.cmake and include it in CMakelist.txt where appropriate i.e.
INCLUDE_DIRECTORIES(${ZLIB_DIRECTORIES})
and Go to “My Computer->Advanced->Environmental settings” add “ZLIB_DIR” for the variable name and the variable value as “C:\MILXView-win32-depend\zlib”

 

Compilation Error 7
..\..\milxview\milxUserPreferences.cxx(75) : error C3861: 'strcasecmp': identifier not found
Solution
#if defined(_WIN32) || defined(_WIN64)
  #define snprintf _snprintf
  #define vsnprintf _vsnprintf
  #define strcasecmp _stricmp
  #define strncasecmp _strnicmp
#endif
Compilation Error 8
1>milxViewFactory.cxx
1>C:\Program Files\Microsoft Visual Studio 8\VC\include\xhash(61) : error C2440: 'type cast' : cannot convert from 'const wxString' to 'size_t'
1>        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>        C:\Program Files\Microsoft Visual Studio 8\VC\include\xhash(99) : see reference to function template instantiation 'size_t stdext::hash_value<_Kty>(const _Kty &)' being compiled
1>        with
1>        [
1>            _Kty=wxString
1>        ]
Solution Modified  

#ifdef WIN32
#include <hash_map>
using namespace stdext;
typedef hash_map <wxString, milx::milxViewBuilder *, stdext::hash_compare <wxString> > ViewBuilderMap;       

to

WX_DECLARE_HASH_MAP(wxString, milx::milxViewBuilder *, wxStringHash, wxStringEqual, ViewBuilderMap);

Compilation Error 9
1>milxImageSlice.cxx
1>..\..\milxview\image\milxImageSlice.cxx(75) : error C2039: 'GetClassName' : is not a member of 'milx::milxImageSlice'
1>        C:\milx-view\include\image/milxImageSlice.h(55) : see declaration of 'milx::milxImageSlice'
1>..\..\milxview\image\milxImageSlice.cxx(88) : error C2039: 'GetClassName' : is not a member of 'milx::milxImageSlice'
1>        C:\milx-view\include\image/milxImageSlice.h(55) : see declaration of 'milx::milxImageSlice'
1>..\..\milxview\image\milxImageSlice.cxx(101) : error C2039: 'GetClassName' : is not a member of 'milx::milxImageSlice'
1>        C:\milx-view\include\image/milxImageSlice.h(55) : see declaration of 'milx::milxImageSlice'
Solution Add the following lines to every inheritance
// file, as the method is virtual
#if defined(WIN32)
#undef GetClassName
#endif
Compilation Error 10
1>milxMultiTextEntryDialogWindow.cxx
1>..\..\milxview\ui\milxMultiTextEntryDialogWindow.cxx(147) : error C2514: 'wxTextCtrl' : class has no constructors
1>        C:\wxWidgets-2.8.10\include\wx/pickerbase.h(19) : see declaration of 'wxTextCtrl'
1>..\..\milxview\ui\milxMultiTextEntryDialogWindow.cxx(149) : error C2664: 'wxSizerItem *wxSizer::Add(wxWindow *,int,int,int,wxObject *)' : cannot convert parameter 1 from 'wxTextCtrl *' to 'wxWindow *'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>..\..\milxview\ui\milxMultiTextEntryDialogWindow.cxx(181) : error C2514: 'wxTextCtrl' : class has no constructors
1>        C:\wxWidgets-2.8.10\include\wx/pickerbase.h(19) : see declaration of 'wxTextCtrl'
 Solution Add #include <wx/wx.h>
 Compilation Error 11
Problem with hash maps defined in itkMaskmergeImageFilter.h & milxLabelImageLoader.cxx cannot convert from * to size_t
 Solution Write own size_t hash function

#include "StringUtils.h"

/**
 * Multiple hash map implementations
 */

// UNIX implementation
#if defined(__UNIX__)

    #include <ext/hash_map>
    using namespace __gnu_cxx;
    #define HASH_MAP(a, b, c) typedef hash_map < a, b, hash< a >, eqstr> c
#endif

#if defined(WIN32)

    #include <hash_map>
    using namespace stdext;
    #define HASH_MAP(a, b, c) typedef stdext::hash_map < a, b, hash_compare< a , greater_str> > c

#endif
where StringUtils.h is:
typedef vector < const char * > StringVector;

// Utility string methods added for the hash_map

struct eqstr
{
    bool operator()(const char* s1, const char* s2) const
    {
            return strcmp(s1, s2) == 0;
    }
};

struct lessstr
{
    bool operator()(const char* s1, const char* s2) const
    {
            return strcmp(s1, s2) < 0;
    }
};

struct greater_str
{
    bool operator()(const char* s1, const char* s2) const
    {
        if (strcmp(s1, s2) < 0)
        {
            return true;
        }
        return false;
    }
};
Examples Usage are:

#ifdef WIN32
#include <hash_map>
HASH_MAP(const char *, milx::milxObject *, ImageDataMap);
HASH_MAP(const char *, const char *, ImageChangesMap);
#else

 Compilation Error 12
7>..\..\..\milxview\test\milxImageSaveTest.cxx(17) : error C3861: 'time': identifier not found
 Solution Add
#if defined(WIN32)
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#endif
Compilation Error 13
c:\milx-view\lib\include\libcte\milxSmoothThicknessImageFilter.txx(464) : error C2958: the left parenthesis '(' found at 'c:\milx-view\lib\include\libcte\milxsmooththicknessimagefilter.txx(464)' was not matched correctly
c:\milx-view\lib\include\libcte\milxSmoothThicknessImageFilter.txx(464) : error C2059: syntax error : ')'
c:\milx-view\lib\include\libcte\milxSmoothThicknessImageFilter.txx(464) : error C2059: syntax error : ')'
c:\milx-view\lib\include\libcte\milxSmoothThicknessImageFilter.txx(464) : error C2059: syntax error : ')'
 Solution Change
if(float tempValue = (float)(itThickness.GetPixel(typename ThicknessIteratorType::OffsetType tempOffset = {{ii,jj,kk}})))

to ...          

typename ThicknessIteratorType::OffsetType tempOffset = {{ii,jj,kk}};
if(float tempValue = (float)(itThickness.GetPixel(tempOffset)))
Compilation Error 14
2>C:\milx-view\lib\include\libcte\milxCTEDistanceSORFilter.h(239) : error C2864: 'milx::milxCTEDistanceSORFilter<TInputValue,TMaskPixel,TPmapPixel,TOutputPixel>::LOWEST_THICKNESS' : only static const integral data members can be initialized within a class
 Solution declare LOWEST_THICKNESS only in the header file and in milxCTEDistanceSORFilter.cxx set the value (originally value was set in header file)
 Compilation Error 15
62>C:\milx-view\lib\src\libcte\milxSimpleLabelPVFilter.cxx(493) : error C3861: 'isnan': identifier not found
 Solution Two options here could modify the code to add:
#if defined(WIN32)
#define isnan(x) ((x) != (x))
#endif

or simply modify to be _isnan so:
#if defined(WIN32)
 ... _isnan(x) ...
#else
 ... isnan(x) ...
#endif
 Compilation Error 16
65>c:\milx-view\lib\include\libcte\milxCTEDriver.h(1251) : error C2248: 'wxMutex::operator =' : cannot access private member declared in class 'wxMutex'
65>        C:\wxWidgets-2.8.10\include\wx/thread.h(164) : see declaration of 'wxMutex::operator ='
65>        C:\wxWidgets-2.8.10\include\wx/thread.h(128) : see declaration of 'wxMutex'
 Solution replace
wxMutex m_LoadImageMutex;  // lock for the loading images
  with
wxMutex *m_LoadImageMutex;
  in milxCTEDriver.h and hence then in milxCTEDriver.cxx use pointer notification instead ie replace
  m_LoadImageMutex.Unlock();
  with
m_LoadImageMutex->Unlock();
 Compilation Error 17
c:\milx-view\lib\include\milxregistration\AladinPyramidImplement.txx(119) : error C2668: 'std::log' : ambiguous call to overloaded function
1>        c:\Program Files\Microsoft Visual Studio 9.0\VC\include\math.h(121): could be 'double log(double)'
1>        c:\Program Files\Microsoft Visual Studio 9.0\VC\include\math.h(519): or       'float log(float)'
1>        c:\Program Files\Microsoft Visual Studio 9.0\VC\include\math.h(567): or       'long double log(long double)'
1>        while trying to match the argument list '(int)'
1>        c:\milx-view\lib\include\milxregistration\AladinPyramidImplement.txx(33) : while compiling class template member function 'void AladinPyramidImplement<DIMENSION>::CreateImagePyramids(void)'
1>        with
1>        [
1>            DIMENSION=3
1>        ]
 Solution Modify:
    const double fixedSampleRateD = std::pow( 2.0,
      std::ceil( std::log( movingSpacing / fixedBaseSpacing ) / std::log(2) ) );

    to:
    const double fixedSampleRateD = std::pow( 2.0,
      std::ceil( std::log( movingSpacing / fixedBaseSpacing ) / std::log(2.0) ) );

  i.e. change 2 to 2.0
Compilation Error 18
milxImageSource.cxx
..\..\milxview\image\milxImageSource.cxx(48) : error C2440: '' : cannot convert from 'const wxChar *' to 'std::string'
        No constructor could take the source type, or constructor overload resolution was ambiguous
 Solution modified fn_str to mb_str
 Compilation Error 19
milxImageLoader.cxx
..\..\milxview\image\milxImageLoader.cxx(84) : error C2039: 'GetClassNameW' : is not a member of 'milx::milxImageLoader'
        C:\milx-view\include\image/milxImageLoader.h(42) : see declaration of 'milx::milxImageLoader'
..\..\milxview\image\milxImageLoader.cxx(85) : error C2039: 'GetClassNameW' : is not a member of 'milx::milxImageLoader'
        C:\milx-view\include\image/milxImageLoader.h(42) : see declaration of 'milx::milxImageLoader'
 Solution comment out the milxErrorMacro and simply report the error to the terminal using std::cout or std::cerr
Compilation Error 20
milxImage3D.cxx
..\..\milxview\image\milxImage3D.cxx(95) : warning C4101: 'ex' : unreferenced local variable
milxImage2D.cxx
..\..\milxview\image\milxImage2D.cxx(70) : warning C4101: 'ex' : unreferenced local variable
milxImageList.cxx
 Solution Use the "ex" variable returned from ITK to output error to terminal and thus avoid warnings
Compilation Error 21
14>..\..\..\..\..\..\..\lib\src\itk-ext\Modules\BiasFieldCorrection\LEMS\milxBiasFieldIntensityCorrector.cxx(255) : error C2057: expected constant expression
14>..\..\..\..\..\..\..\lib\src\itk-ext\Modules\BiasFieldCorrection\LEMS\milxBiasFieldIntensityCorrector.cxx(255) : error C2466: cannot allocate an array of constant size 0
14>..\..\..\..\..\..\..\lib\src\itk-ext\Modules\BiasFieldCorrection\LEMS\milxBiasFieldIntensityCorrector.cxx(255) : error C2133: 'histogramArray' : unknown size
 Solution Change
// Make enough room incase the pixelvalues exceed the input image
 int histogramSize = (int)(m_maximumIntensity * 2);
 int histogramArray[histogramSize];               

 to                      
 // MIX-163 need a dynamic array, otherwise need to know at compile time
 // size of array
 int* histogramArray = NULL;

 // Make enough room incase the pixelvalues exceed the input image
 int histogramSize = (int)(m_maximumIntensity * 2);

 // Need a dynamic array hence need to new.
 histogramArray = new int[histogramSize];                                                            
...

// MIX-163
 delete[] histogramArray;
 histogramArray = NULL;
Compilation Error 22
milxFileOpenError.cxx
..\..\milxview\exceptions\milxFileOpenError.cxx(31) : error C2784: 'std::_String_iterator<_Elem,_Traits,_Alloc> std::operator +(_String_iterator<_Elem,_Traits,_Alloc>::difference_type,std::_String_iterator<_Elem,_Traits,_Alloc>)' : could not deduce template argument for 'std::_String_iterator<_Elem,_Traits,_Alloc>' from 'const std::string'
        C:\Program Files\Microsoft Visual Studio 8\VC\include\xstring(439) : see declaration of 'std::operator +'
 Solution Add
#include <string>
Compilation Error 23
..\..\milxview\view\milxViewPageModel.cxx(174) : error C2039: 'find' : is not a member of 'std'
..\..\milxview\view\milxViewPageModel.cxx(174) : error C3861: 'find': identifier not found
 Solution Add
#include <algorithm>
 Compilation Error 24
..\..\milxview\view\milxSnapshotSaver.cxx(51) : error C2664: 'vtkImageWriter::SetFileName' : cannot convert parameter 1 from 'const wxChar *' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
 Solution Modified filename.fn_str() to filename.mb_str()
Compilation Error 25
C:\milx-view\lib\src\vtk-ext\Modules\Graphics\Meshing\milxImageMesher.cxx(573) : warning C4101: 'ex' : unreferenced local variable
 Solution Added an output message ex.GetDescription to inform the user and remove the warning
 Compilation Error 26
.\..\milxview\ui\milxBatchStringPanel.cxx(177) : warning C4996: 'fopen' was declared deprecated
1>        C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(234) : see declaration of 'fopen'
1>        Message: 'This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
 Solution replaced fopen with input and output streams, see examples in methods  ReadBatchFile and WriteBatchFile in ~milxview/ui
i.e. use ifstream or ofstream etc instead of fopen
 Compilation Error 27
1>..\..\milxview\ui\milxBatchStringPanel.cxx(177) : error C2664: 'fopen' : cannot convert parameter 1 from 'const wxChar *' to 'const char *'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
 Solution use mb_str() instead of fn_str()
 Compilation Error 28
1>milxListCtrl.cxx
1>..\..\milxview\ui\milxListCtrl.cxx(177) : error C2308: concatenating mismatched strings
1>        Concatenating wide "Unable to open file %s for export
1>" with narrow "Task aborted
 Solution modified      
errorMsg.Printf(wxT("Unable to open file %s for export\n"
    "Task aborted\n"),
     filename.c_str());
to                                                                                           
errorMsg.Printf(wxT("Unable to open file %s for export\n"
    wxT("Task aborted\n")),
    filename.c_str());
i.e. add WxT on each new line.
 Compilation Error 29
app.h(230) : warning C4002: too many actual parameters for macro 'Yield'
 Solution Two options identified:

This is because you include, directly or indirectly, windows.h (which
#defines Yield) from somewhere. Make sure you always include
wx/msw/winundef.h after including windows.h - Add
#if defined(WIN32)
#include "wx/msw/winundef.h"
#endif before
#include <wx/wx.h>


Or secondly, an easier solution could be to move include files so the WxWidgets include come at the end of the list
 Compilation Error 30
1>..\..\milxview\view\milxViewPanel.cxx(149) : error C2065: 'vector' : undeclared identifier
 Solution Add  using std::vector; to milxViewPanel.h
Compilation Error 31
1>milxVisualizationCollection.cxx
1>C:\Program Files\Microsoft Visual Studio 8\VC\include\xhash(358) : error C2064: term does not evaluate to a function taking 2 arguments
1>        class does not define an 'operator()' or a user defined conversion operator to a pointer-to-function or reference-to-function that takes appropriate number of arguments
1>        C:\Program Files\Microsoft Visual Studio 8\VC\include\xhash(298) : while compiling class template member function 'std::pair<_Ty1,_Ty2> stdext::_Hash<_Traits>::insert(const std::pair<const _Kty,_Ty> &)'
1>        with
1>        [
1>            _Ty1=std::list<std::pair<const wxString,milx::milxVisualizationCollection::VisualizationVector>,std::allocator<std::pair<const wxString,milx::milxVisualizationCollection::VisualizationVector>>>::_Iterator<true>,
1>            _Ty2=bool,
1>            _Traits=stdext::_Hmap_traits<wxString,milx::milxVisualizationCollection::VisualizationVector,wxStringHash,std::allocator<std::pair<const wxString,milx::milxVisualizationCollection::VisualizationVector>>,false>,
1>            _Kty=wxString,
1>            _Ty=milx::milxVisualizationCollection::VisualizationVector
1>        ]
1>        C:\Program Files\Microsoft Visual Studio 8\VC\include\hash_map(90) : see reference to class template instantiation 'stdext::_Hash<_Traits>' being compiled
1>        with
1>        [
1>            _Traits=stdext::_Hmap_traits<wxString,milx::milxVisualizationCollection::VisualizationVector,wxStringHash,std::allocator<std::pair<const wxString,milx::milxVisualizationCollection::VisualizationVector>>,false>
1>        ]
1>        C:\milx-view\include\visualization/milxVisualizationCollection.h(148) : see reference to class template instantiation 'stdext::hash_map<_Kty,_Ty,_Tr>' being compiled
1>        with
1>        [
1>            _Kty=wxString,
1>            _Ty=milx::milxVisualizationCollection::VisualizationVector,
1>            _Tr=wxStringHash
1>        ]
1>C:\Program Files\Microsoft Visual Studio 8\VC\include\xhash(360) : error C2064: term does not evaluate to a function taking 2 arguments
1>        class does not define an 'operator()' or a user defined conversion operator to a pointer-to-function or reference-to-function that takes appropriate number of arguments
 Solution In visualization/milxVisualizationCollection.h
changed              
typedef stdext::hash_map <wxString, VisualizationVector, wxStringHash > VisualizationMap;                                                

to

WX_DECLARE_HASH_MAP(wxString, VisualizationVector, wxStringHash, wxStringEqual, VisualizationMap);
 Compilation Error 32
1>..\..\milxview\visualization\milxVisualizationCollection.cxx(184) : error C2039: 'sort' : is not a member of 'std'
 Solution Add
#include <algorithm>
 Compilation Error 33
1>..\..\..\..\lib\src\milxRegistration\milxRegistration.cxx(61) : fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory
 Solution Modify
#include <iostream.h>

 to

#include <iostream>
 Compilation Error 34
15>..\..\..\..\lib\src\milxRegistration\milxRegistration.cxx(60) : fatal error C1083: Cannot open include file: 'fstream.h': No such file or directory
 Solution Modify
#include <fstream.h>
to
#include <fstream>
 Compilation Error 35
c:\Program Files\Microsoft Visual Studio 8\VC\include\xhash(127) : error C2039: 'bucket_size' : is not a member of 'wxStringHash'
C:\wxWidgets-2.8.10\include\wx/hashmap.h(589) : see declaration of 'wxStringHash'
 Solution This is a HASH_MAP error need to create your own HASH_MAP as described above or use WX_DECLARE_HASH_MAP also described above
Compilation Error 36
12>c:\milx-view\lib\include\vtk-ext\modules\graphics\meshing\imageUtil.txx(213) : error C2572: 'imageUtil::applyMask' : redefinition of default parameter : parameter 3
 Solution Modify
applyMask(typename ITKImageT::Pointer image, typename ITKImageT::Pointer mask, bool include=false)
to
applyMask(typename ITKImageT::Pointer image, typename ITKImageT::Pointer mask, bool include) in imageUtil.txx
 Compilation Error 37
9. 3>..\..\..\..\..\..\lib\src\itk-ext\Modules\Registration\smoothnessconstraint.cxx(234) : error C3861: '_mm_set_pd1': identifier not found
 Solution for win 32 need to set _mm_set_pd1
to
_mm_set1_pd
etc…
 Compilation Error 38
10>..\..\..\..\lib\src\milxOrientation\milxOrientation.cxx(37) : fatal error C1083: Cannot open include file: 'zlib.h': No such file or directory
 Solution Add
INCLUDE_DIRECTORIES(${ZLIB_INCLUDES})
to Cmakelist.txt
Compilation Error 39
Can’t find wx header files i.e. (wx/string.h, wx/app.h, wx/setup.h)
fatal error C1083: Cannot open include file: 'wx/statusbr.h': No such file or directory
fatal error C1083: Cannot open include file: 'wx/datetime.h': No such file or directory
fatal error C1083: Cannot open include file: 'wx/wx.h': No such file or directory
fatal error C1083: Cannot open include file: 'wx/string.h': No such file or directory
fatal error C1083: Cannot open include file: 'wx/app.h': No such file or directory
fatal error C1083: Cannot open include file: 'wx/setup.h': No such file or directory
 Solution Go to “My Computer->Advanced->Environmental settings” add “WXWIN_CMAKEDIR” for the variable name and the variable value as “C:\MILXView-win32-depend\wxWidgets-2.8.10”

or Atlernatively in Visual Studio
Tools->options->VC++ Directories then select "Show directories for "Include files" add a new line and add the location of header files (I prefer first option)










Compilation Error 40 64 bit windows 7 issue wxwidgets 2.9.1
13>C:\MILXView-win32-depend\itk-3.16.0\Utilities\itksys/SystemTools.hxx(48) : error C2371: 'mode_t' : redefinition; different basic types
13>        C:\MILXView-win32-depend\wxWidgets-2.9.1\include\wx/filefn.h(98) : see declaration of 'mode_t'
Solution Modify C:\MILXView-win32-depend\wxWidgets-2.9.1\include\wx/filefn.h(98) from
#if defined(__VISUALC__) || defined(__DIGITALMARS__)
    typedef int mode_t;
#endif

to

#if defined(__VISUALC__) || defined(__DIGITALMARS__)
    #define mode_t int;
#endif
Compilation Error 41
1>C:\milx-view\lib\common\include\itk-aux\EEDT\edtProcs.h(37) : error C2059: syntax error : 'string'

Solution Modify from:
#if defined(WIN32)
extern "C" {
#endif
MILX_EXPORT void edtComputeEDT_2D(char *, long *, long, long);
#if defined(WIN32)
}
#endif

To:

#if defined(WIN32)
// In the C language, the string-literal "C" is not recognized.
// It is used in C++ to prevent name decoration. Need to add
// __cplusplus in this case to resolve errors:
// error C2059: syntax error : 'string' under windows
#  ifdef __cplusplus
     extern "C" {
#  endif
#endif
MILX_EXPORT void edtComputeEDT_2D(char *, long *, long, long);
#if defined(WIN32)
#  ifdef __cplusplus
     }
#  endif
#endif
Compilation Error 42
1>..\..\core\src\milxMixViewPlugin.cxx(64) : warning C4407: cast between different pointer to member representations, compiler may generate incorrect code
Solution Swap the inheritance order around i.e. from:

class MILX_EXPORT milxMixViewPlugin : public milxPlugin, public wxScrolledWindow,
to:
class MILX_EXPORT milxMixViewPlugin : public wxScrolledWindow, public milxPlugin
Compilation Error 43
3>c:\milx-view-continuous\lib\projects\aibl\src\libpetems\milxPetEMSFilter.cxx(953) : error C3861: 'isinf': identifier not found
Solution
Under windows replace isinf with _finite (found in <float.h>)
Compilation Error 44 1>..\..\..\..\plugins\common\src\relaxometry\milxRelaxometryTask.cxx(379) : error C2057: expected constant expression
1>..\..\..\..\plugins\common\src\relaxometry\milxRelaxometryTask.cxx(379) : error C2466: cannot allocate an array of constant size 0
1>..\..\..\..\plugins\common\src\relaxometry\milxRelaxometryTask.cxx(379) : error C2133: 'm_outputs' : unknown size
Solution Change
ImageType::Pointer m_outputs[ numOutputs ];

To
ImageType::Pointer *m_outputs = new ImageType::Pointer[ numOutputs ];
Compilation Error 45 Building CXX object core/src/itk-ext/Modules/IO/CMakeFiles/milx-itkIO.dir/itkINRImageIOFactory.o
In file included from /home/bmladmin/milx-view/build/depend/itk-3.20.0/include/InsightToolkit/IO/itkImageIOBase.h:23:0,
from /home/bmladmin/milx-view/build/../lib/core/include/itk-ext/Modules/IO/itkINRImageIOFactory.h:30,
from /home/bmladmin/milx-view/lib/core/src/itk-ext/Modules/IO/itkINRImageIOFactory.cxx:21:
/home/bmladmin/milx-view/build/depend/itk-3.20.0/include/InsightToolkit/IO/itkImageIORegion.h:62:11: error: ‘ptrdiff_t’ does not name a type
/home/bmladmin/milx-view/build/depend/itk-3.20.0/include/InsightToolkit/IO/itkImageIORegion.h:63:11: error: ‘ptrdiff_t’ does not name a type
/home/bmladmin/milx-view/build/depend/itk-3.20.0/include/InsightToolkit/IO/itkImageIORegion.h:67:23: error: ‘IndexValueType’ was not declared in this scope
Solution GCC-4.6 is again more strict, introduces new warnings, and lets packages fail to build, which did succeed to build with earlier GCC versions.
added #include <cstddef> to
/home/bmladmin/milx-view/lib/core/src/itk-ext/Modules/IO/itkINRImageIOFactory.cxx

 

 

 

MILXView Porting Link Errors

This section will describe the errors and the solutions used to overcome the linker errors observed during the port

 

 

Link Error 1
LINK : fatal error LNK1104: cannot open file 'boost_program_options-vc90-mt-1_40.lib
Solution By default boost libraries are linked staticall so download the libbboost_*.lib files from http://www.boostpro.com/download
Link Error 2 3>milxViewApp.obj : error LNK2019: unresolved external symbol "public: void __thiscall milx::milxViewController::DebugPluginEventHandler(void)" (?DebugPluginEventHandler@milxViewController@milx@@QAEXXZ) referenced in function "public: virtual bool __thiscall milx::milxViewApp::OnInit(void)" (?OnInit@milxViewApp@milx@@UAE_NXZ)
Solution DebugPluginEventHandler has no implementation i.e. nothing in the function
Link Error 3 LINK : fatal error LNK1104: cannot open file '..\..\..\..\Debug\invert.lib'
15>Build log was saved at "file://c:\milx-view\build\lib\src\itk-ext\Modules\milxDigitalTopology\milx-DigitalTopology.dir\Debug\BuildLog.htm"
15>milx-DigitalTopology - 1 error(s), 5 warning(s)
Solution Only header and template files defined in the invert Cmakelist.txt file so added a file "perf.cxx" so the library is built
Link Error 4 LINK : fatal error LNK1104: cannot open file '..\..\..\..\Debug\itkSkeleton.lib'
4>Build log was saved at "file://c:\milx-view\build\lib\src\itk-ext\Modules\milxDigitalTopology\milx-DigitalTopology.dir\Debug\BuildLog.htm"
4>milx-DigitalTopology - 1 error(s), 0 warning(s)
Solution Only header and template files defined in the skeleton Cmakelist.txt file added main.cxx so the library is built
Link Error 5 4>milxROIPanel.obj : error LNK2019: unresolved external symbol "public: __thiscall milx::milxListCtrl::milxListCtrl(class wxWindow *,int,class wxPoint const &,class wxSize const &,long,class std::vector<class wxString,class std::allocator<class wxString> > &)" (??0milxListCtrl@milx@@QAE@PAVwxWindow@@HABVwxPoint@@ABVwxSize@@JAAV?$vector@VwxString@@V?$allocator@VwxString@@@std@@@std@@@Z) referenced in function "public: __thiscall milx::milxROIPanel::milxROIPanel(class wxWindow *,int)" (??0milxROIPanel@milx@@QAE@PAVwxWindow@@H@Z)
Solution Add
#include "milxWin32Header.h"

and MILX_EXPORT as shown below

class MILX_EXPORT milxListCtrl : public wxListCtrl

milxWin32Header.h contains the macro:

#if (defined(_WIN32) || defined(WIN32)) && !defined(MILXSTATIC)
#define MILX_EXPORT __declspec(dllexport)
#else
/* unix needs nothing */
#define MILX_EXPORT
#endif
Link Error 6
2>fixedpoints.obj : error LNK2001: unresolved external symbol "protected: __thiscall itk::INRImageIOFactory::INRImageIOFactory(void)" (??0INRImageIOFactory@itk@@IAE@XZ)
2>registration.obj : error LNK2019: unresolved external symbol "protected: __thiscall itk::INRImageIOFactory::INRImageIOFactory(void)" (??0INRImageIOFactory@itk@@IAE@XZ) referenced in function "public: static class itk::SmartPointer<class itk::INRImageIOFactory> __cdecl itk::INRImageIOFactory::New(void)" (?New@INRImageIOFactory@itk@@SA?AV?$SmartPointer@VINRImageIOFactory@itk@@@2@XZ)
2>optimizer.obj : error LNK2001: unresolved external symbol "protected: __thiscall itk::INRImageIOFactory::INRImageIOFactory(void)" (??0INRImageIOFactory@itk@@IAE@XZ)
2>inputFile.obj : error LNK2001: unresolved external symbol "protected: __thiscall itk::INRImageIOFactory::INRImageIOFactory(void)" (??0INRImageIOFactory@itk@@IAE@XZ)
2>gradientdescentoptimizer.obj : error LNK2001: unresolved external symbol "protected: __thiscall itk::INRImageIOFactory::INRImageIOFactory(void)" (??0INRImageIOFactory@itk@@IAE@XZ)

Solution need to add the MILX_EXPORT as described above if not already in place and also add the library to the Cmakelist.txt in this case milx-itkIO
Link Error 7
7>milxRecentFilesPlugin.obj : error LNK2019: unresolved external symbol "public: bool __thiscall vtkFSDataReader::CanReadFile(char *)" (?CanReadFile@vtkFSDataReader@@QAE_NPAD@Z) referenced in function "protected: virtual void __thiscall milx::milxRecentFilesPlugin::OnMenuCommand(class wxCommandEvent &)" (?OnMenuCommand@milxRecentFilesPlugin@milx@@MAEXAAVwxCommandEvent@@@Z)
7>milxRecentFilesPlugin.obj : error LNK2019: unresolved external symbol "public: static class vtkFreeSurferSurfaceReader * __cdecl vtkFreeSurferSurfaceReader::New(void)" (?New@vtkFreeSurferSurfaceReader@@SAPAV1@XZ) referenced in function "protected: virtual void __thiscall milx::milxRecentFilesPlugin::OnMenuCommand(class wxCommandEvent &)" (?OnMenuCommand@milxRecentFilesPlugin@milx@@MAEXAAVwxCommandEvent@@@Z)
...

milxRecentFilesPlugin.obj : error LNK2019: unresolved external symbol "public: vtkFSdataReader
Solution Modified VTK_IO_EXPORT to be #define VTK_IO_EXPORT __declspec( dllexport )
Link Error 8
2>C:\wxWidgets-2.8.10\include\wx/app.h(230) : warning C4002: too many actual parameters for macro 'Yield'
2>C:\wxWidgets-2.8.10\include\wx/app.h(230) : error C2059: syntax error : '{'
2>C:\wxWidgets-2.8.10\include\wx/app.h(230) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
2>C:\wxWidgets-2.8.10\include\wx/app.h(406) : warning C4002: too many actual parameters for macro 'Yield'
2>C:\wxWidgets-2.8.10\include\wx/app.h(406) : error C2059: syntax error : '='
2>C:\wxWidgets-2.8.10\include\wx/app.h(406) : error C2238: unexpected token(s) preceding ';'
2>C:\wxWidgets-2.8.10\include\wx/msw/app.h(38) : warning C4002: too many actual parameters for macro 'Yield'
2>C:\wxWidgets-2.8.10\include\wx/msw/app.h(38) : error C2208: 'bool' : no members defined using this type
Solution Moved milxImageComparePanel.h from the first to the end in milxImageComparePanel.cxx as it contained many wx headers maybe milxImageDatamap.h adds windows.h??
Link Error 9
2>milxColourMapPlugin.obj : error LNK2001: unresolved external symbol "protected: static struct wxEventTable const milx::milxMixViewPlugin::sm_eventTable" (?sm_eventTable@milxMixViewPlugin@milx@@1UwxEventTable@@B)
2>C:\milx-view\build\plugins\Debug\milx-ColourMapPlugin.dll : fatal error LNK1120: 1 unresolved externals
Solution removed BEGIN_EVENT_TABLE as second paramter contained class milxMixViewPlugin and replaced it with a "connect" call in RegisterListeners i.e.
Modified
BEGIN_EVENT_TABLE(milxColourMapPlugin, milxMixViewPlugin)
   EVT_COMBOBOX(WXID_ANY, milxColourMapPlugin,::OnColourMapChanged)
END_EVENT_TABLE

to

Connect(WXID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventhandler(milxColourMapPlugin,::OnColourMapChanged));
Link Error 10
..\..\milxview\visualization\milxOpenGLImageSlice.cxx(38) : warning C4273: 'milx::milxOpenGLImageSlice::CollectRevisions' : inconsistent dll linkage
        C:\milx-view\include\visualization/milxOpenGLImageSlice.h(37) : see previous definition of 'CollectRevisions'
Solution Add #include "milxWin32Header.h"

and MILX_EXPORT as shown below

class MILX_EXPORT milxListCtrl : public wxListCtrl
Link Error 11
*****.obj error lnk2001: unresolved external symbol "public: virtual class wxclassindow * __thiscall wxObject::GetClassInfoW(void)const ….
Solution This was solved by addding wxundef to milxImage2D.h and milxImage3D.h as itk adds windows.h and these are needed to undefined some of these variables i.e.
#if defined(WIN32)
#include "wx/msw/winundef.h"
#endif
Link Error 12
6>milxOrientation.obj : error LNK2019: unresolved external symbol "protected: __thiscall itk::INRImageIOFactory::INRImageIOFactory(void)" (??0INRImageIOFactory@itk@@IAE@XZ) referenced in function "public: static class itk::SmartPointer<class itk::INRImageIOFactory> __cdecl itk::INRImageIOFactory::New(void)" (?New@INRImageIOFactory@itk@@SA?AV?$SmartPointer@VINRImageIOFactory@itk@@@2@XZ)
Solution Add library "milx-itkIO" to Cmakelist.txt
Link Error 13
6>ITKNrrdIO.lib(miscAir.obj) : error LNK2005: _itk_airFree already defined in milx-NonRigidRegistration.lib(milx-NonRigidRegistration.dll)
6>ITKNrrdIO.lib(simple.obj) : error LNK2005: _itk_nrrdSpaceDimension already defined in milx-NonRigidRegistration.lib(milx-NonRigidRegistration.dll)
6>ITKNrrdIO.lib(simple.obj) : error LNK2005: _itk_nrrdSpaceSet already defined in milx-NonRigidRegistration.lib(milx-NonRigidRegistration.dll)
6>ITKNrrdIO.lib(simple.obj) : error LNK2005: _itk_nrrdSpaceDimensionSet already defined in milx-NonRigidRegistration.lib(milx-NonRigidRegistration.dll)
Solution 1) Can be caused by Mixing static and dynamic libraries so check this first, plus check the methods aren't already defined.
2) Can also be caused when libraries are linked in the wrong order or doubly included which was the case here as the ITK libraries are include in milx-itkIO, so initailly the the Cmakelist file was;
SET(LINK_milxRegistration
   ITKIO
   ITKCommon
   ITKNumerics
   ITKStatistics
   milx-NonRigidRegistration
   milx-Orientation
   milx-base
   milx-itkIO
   boost_program_options boost_filesystem
  ----> modified to;
SET(LINK_milxRegistration
   milx-base
   milx-itkIO   
   milx-NonRigidRegistration
   milx-Orientation
   ${LIBBOOST_PROGRAM_OPTIONS}
   ${LIBBOOST_FILESYSTEM} ------> i.e. deleted ITK libraries and moved the base and itkIO libraries
Link Error 14
122>milxPluginAtlasCreationPanel.obj : error LNK2001: unresolved external symbol "public: virtual class wxClassInfo * __thiscall wxEvtHandler::GetClassInfoW(void)const " (?GetClassInfoW@wxEvtHandler@@UBEPAVwxClassInfo@@XZ)
Solution This was solved by addding wxundef to milxImage.h (see above) as itk adds windows.h, and these are needed to undefine some of these variables. This could also be solved by moving the include files so wxwidgets come last in the list
Link Error 15
dll created but no lib created
Solution need to add the MILX_EXPORT as described above. Lib is not created unless something is exported
Link Error 16
11>imageUtil.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall vtkMatrix4x4::SetElement(int,int,double)" (__imp_?SetElement@vtkMatrix4x4@@QAEXHHN@Z) referenced in function __catch$?loadTFM@imageUtil@@YAPAVvtkMatrix4x4@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z$0
11>imageUtil.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class vtkMatrix4x4 * __cdecl vtkMatrix4x4::New(void)" (__imp_?New@vtkMatrix4x4@@SAPAV1@XZ) referenced in function __catch$?loadTFM@imageUtil@@YAPAVvtkMatrix4x4@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z$0
Solution added milx-lib library to target link libraries in CMakeList.txt
Link Error 17
vtkHedgeHogActor.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) protected: virtual __thiscall vtkActor::~vtkActor(void)" (__imp_??1vtkActor@@MAE@XZ) referenced in function "public: virtual __thiscall vtkHedgeHogActor::~vtkHedgeHogActor(void)" (??1vtkHedgeHogActor@@UAE@XZ)
carried on for 318 errors of different functions
Solution Added vtkRendering library to C:\milx-view\lib\src\vtk-ext\Modules\Graphics\Cmakelist.txt
Link Error 18
milxLattice.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall vtkMapper::SetLookupTable(class vtkScalarsToColors *)" (__imp_?SetLookupTable@vtkMapper@@QAEXPAVvtkScalarsToColors@@@Z) referenced in function "public: __thiscall milx::Lattice::Lattice(class vtkImageData *,float,class vtkImageData *)" (??0Lattice@milx@@QAE@PAVvtkImageData@@M0@Z) Carried for 12 errors of different functions
Solution Added vtkRendering library to Cmakelist.txt
Link Error 19
milxDicomLoader.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall gdcm::DicomDir::SetDirectoryName(class std::basic_string,class std::allocator > const &)" (__imp_?SetDirectoryName@DicomDir@gdcm@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: class milx::milxImageGroup * __thiscall milx::milxDicomLoader::LoadDir(class wxString const &)" (?LoadDir@milxDicomLoader@milx@@QAEPAVmilxImageGroup@2@ABVwxString@@@Z)
milxDicomLoader.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: float __thiscall gdcm::DicomDir::GetProgress(void)const " (__imp_?GetProgress@DicomDir@gdcm@@QBEMXZ) referenced in function "void __cdecl milx::milxDicomDirProgress(void *)" (?milxDicomDirProgress@milx@@YAXPAX@Z)
Solution modified class GDCM_EXPORT DicomDir: public Document
to
class DicomDir: public Document
   in ~itk-3.16.0/Utilitities/gdcm/src/gdcmDicomDir.h
i.e. remove GDCM_EXPORT

Alternatively see 19 b below.
Link Error 20
34>reg_tools.obj : error LNK2019: unresolved external symbol "void __cdecl reg_smoothImageForCubicSpline<float>(struct nifti_image *,int * const)" (??$reg_smoothImageForCubicSpline@M@@YAXPAUnifti_image@@QAH@Z) referenced in function "int __cdecl reg_tools(int,char * *)" (?reg_tools@@YAHHPAPAD@Z
Solution This a template issue. Because at the point of instantation the compiler will see the template declaration in the header file
but not the definition in the cpp file. Thus the compiler will not generate the type, and will not report an error assuming that it's defined in some other compilation unit.
Now the compiler checks cpp for syntax correctness, but it will not generate the code for member functions as it would need to know template parameters i.e. it needs type, not a template.
Now the linker will report an error: "LNK2019: unresolved external symbol..." as the definition for the type is not in. So we need to include template definitions here, by either including the cpp file or moving the definitions from the CPP file to the header file
See also the following webpage for more info on this  http://www.codeproject.com/KB/cpp/templatesourceorg.aspx
Link Error 19 b
6>   Creating library C:\milx-view\build\lib\Debug\milx-lib.lib and object C:\milx-view\build\lib\Debug\milx-lib.exp
6>milxMixViewPluginThread.obj : warning LNK4049: locally defined symbol ?wxEVT_INSERT_TEXT_PROGRESS_BAR@@3HB (int const wxEVT_INSERT_TEXT_PROGRESS_BAR) imported
6>milxMixViewPluginThread.obj : warning LNK4049: locally defined symbol ?wxEVT_BATCH_JOB_DONE@@3HB (int const wxEVT_BATCH_JOB_DONE) imported
6>milxMixViewPluginThread.obj : warning LNK4049: locally defined symbol ?wxEVT_INSERT_PROGRESS_PROGRESS_BAR@@3HB (int const wxEVT_INSERT_PROGRESS_PROGRESS_BAR) imported
6>milxMixViewPluginThread.obj : warning LNK4049: locally defined symbol ?wxEVT_FINISHED_ALL_BATCH_JOB@@3HB (int const wxEVT_FINISHED_ALL_BATCH_JOB) imported
6>milxDicomLoader.obj : warning LNK4217: locally defined symbol ?ParseDirectory@DicomDir@gdcm@@QAEXXZ (public: void __thiscall gdcm::DicomDir::ParseDirectory(void)) imported in function "public: class milx::milxImageGroup * __thiscall milx::milxDicomLoader::LoadDir(class wxString const &)" (?LoadDir@milxDicomLoader@milx@@QAEPAVmilxImageGroup@2@ABVwxString@@@Z)
6>milxDicomLoader.obj : warning LNK4217: locally defined symbol ?SetProgressMethod@DicomDir@gdcm@@QAEXP6AXPAX@Z0@Z (public: void __thiscall gdcm::DicomDir::SetProgressMethod(void (__cdecl*)(void *),void *)) imported in function "public: class milx::milxImageGroup * __thiscall milx::milxDicomLoader::LoadDir(class wxString const &)" (?LoadDir@milxDicomLoader@milx@@QAEPAVmilxImageGroup@2@ABVwxString@@@Z)
6>milxDicomLoader.obj : warning LNK4217: locally defined symbol ??0DicomDir@gdcm@@QAE@XZ (public: __thiscall gdcm::DicomDir::DicomDir(void)) imported in function "public: class milx::milxImageGroup * __thiscall milx::milxDicomLoader::LoadDir(class wxString const &)" (?LoadDir@milxDicomLoader@milx@@QAEPAVmilxImageGroup@2@ABVwxString@@@Z)
6>milxDicomLoader.obj : warning LNK4217: locally defined symbol ??1DicomDir@gdcm@@UAE@XZ (public: virtual __thiscall gdcm::DicomDir::~DicomDir(void)) imported in function "public: virtual void * __thiscall gdcm::DicomDir::`scalar deleting destructor'(unsigned int)" (??_GDicomDir@gdcm@@UAEPAXI@Z)
6>milxImageGroup.obj : warning LNK4217: locally defined symbol ?GetValue@ContentEntry@gdcm@@QBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ (public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __thiscall gdcm::ContentEntry::GetValue(void)const ) imported in function "public: class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __thiscall milx::milxImageGroup::GetSeriesFilenames(class gdcm::DicomDirSerie *)" (?GetSeriesFilenames@milxImageGroup@milx@@QAE?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@PAVDicomDirSerie@gdcm@@@Z)
6>milxImageGroup.obj : warning LNK4217: locally defined symbol ?GetNextImage@DicomDirSerie@gdcm@@QAEPAVDicomDirImage@2@XZ (public: class gdcm::DicomDirImage * __thiscall gdcm::DicomDirSerie::GetNextImage(void)) imported in function "public: class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __thiscall milx::milxImageGroup::GetSeriesFilenames(class gdcm::DicomDirSerie *)" (?GetSeriesFilenames@milxImageGroup@milx@@QAE?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@PAVDicomDirSerie@gdcm@@@Z)
6>milxImageGroup.obj : warning LNK4217: locally defined symbol ?GetFirstImage@DicomDirSerie@gdcm@@QAEPAVDicomDirImage@2@XZ (public: class gdcm::DicomDirImage * __thiscall gdcm::DicomDirSerie::GetFirstImage(void)) imported in function "public: class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __thiscall milx::milxImageGroup::GetSeriesFilenames(class gdcm::DicomDirSerie *)" (?GetSeriesFilenames@milxImageGroup@milx@@QAE?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@PAVDicomDirSerie@gdcm@@@Z)
6>milxImageMesherTask.obj : warning LNK4217: locally defined symbol ?wxTASK_DONE_EVENT@@3HB (int const wxTASK_DONE_EVENT) imported in function "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl itk::operator<<<unsigned long,3,class itk::NeighborhoodAllocator<unsigned long> >(class std::basic_ostream<char,struct std::char_traits<char> > &,class itk::Neighborhood<unsigned long,3,class itk::NeighborhoodAllocator<unsigned long> > const &)" (??$?6K$02V?$NeighborhoodAllocator@K@itk@@@itk@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AAV12@ABV?$Neighborhood@K$02V?$NeighborhoodAllocator@K@itk@@@0@@Z)
6>milxMeshDecimateTask.obj : warning LNK4049: locally defined symbol ?wxTASK_DONE_EVENT@@3HB (int const wxTASK_DONE_EVENT) imported
6>milxMeshSaveTask.obj : warning LNK4217: locally defined symbol ?wxTASK_DONE_EVENT@@3HB (int const wxTASK_DONE_EVENT) imported in function __catch$??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@ABV01@@Z$0
6>milxMeshPFCTask.obj : warning LNK4049: locally defined symbol ?wxTASK_DONE_EVENT@@3HB (int const wxTASK_DONE_EVENT) imported
6>milxMeshSmoothTask.obj : warning LNK4217: locally defined symbol ?wxTASK_DONE_EVENT@@3HB (int const wxTASK_DONE_EVENT) imported in function "public: __thiscall milx::milxImageSource::milxImageSource(class milx::milxImageSource const &)" (??0milxImageSource@milx@@QAE@ABV01@@Z)
6>milxDicomLoader.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall gdcm::DicomDir::SetDirectoryName(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?SetDirectoryName@DicomDir@gdcm@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: class milx::milxImageGroup * __thiscall milx::milxDicomLoader::LoadDir(class wxString const &)" (?LoadDir@milxDicomLoader@milx@@QAEPAVmilxImageGroup@2@ABVwxString@@@Z)
6>milxDicomLoader.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: float __thiscall gdcm::DicomDir::GetProgress(void)const " (__imp_?GetProgress@DicomDir@gdcm@@QBEMXZ) referenced in function "void __cdecl milx::milxDicomDirProgress(void *)" (?milxDicomDirProgress@milx@@YAXPAX@Z)
6>C:\milx-view\build\lib\Debug\milx-lib.dll : fatal error LNK1120: 2 unresolved externals
6>Build log was saved at "file://c:\milx-view\build\core\milx-lib.dir\Debug\BuildLog.htm"
6>milx-lib - 3 error(s), 29 warning(s)
========== Rebuild All: 5 succeeded, 1 failed, 0 skipped ==========
Solution Make sure that the gdcm header files appear before the milxWin32Header file I suspect because we use "#define MILX_EXPORT __declspec(dllexport)" in these header files (milxImageGroup.h and milxDicomLoader.h" and this causes the problem
Note that this also solves the "Locally defined symbol" warnings.

#include <gdcm.h>
#include <gdcmDicomDir.h>
#include <gdcmDicomDirSerie.h>

#include "milxWin32Header.h"
Link Error 21
libboost_program_options-vc90-mt-gd-1_40.lib(options_description.obj) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
Solution  
 Link Warning 22

6>milxMixViewPluginThread.obj : warning LNK4049: locally defined symbol ?wxEVT_INSERT_TEXT_PROGRESS_BAR@@3HB (int const wxEVT_INSERT_TEXT_PROGRESS_BAR) imported

6>milxMixViewPluginThread.obj : warning LNK4049: locally defined symbol ?wxEVT_BATCH_JOB_DONE@@3HB (int const wxEVT_BATCH_JOB_DONE) imported

6>milxMixViewPluginThread.obj : warning LNK4049: locally defined symbol ?wxEVT_INSERT_PROGRESS_PROGRESS_BAR@@3HB (int const wxEVT_INSERT_PROGRESS_PROGRESS_BAR) imported

6>milxMixViewPluginThread.obj : warning LNK4049: locally defined symbol ?wxEVT_FINISHED_ALL_BATCH_JOB@@3HB (int const wxEVT_FINISHED_ALL_BATCH_JOB) imported

 Solution  Modified milxMixViewPlugin.cxx to:
#if defined(WIN32)
  // Added to resolve warning under visual studio warning LNK4049:
  // locally defined symbol ?wxEVT_INSERT_TEXT_PROGRESS_BAR@@3HB
  // (int const wxEVT_INSERT_TEXT_PROGRESS_BAR) imported
  DEFINE_LOCAL_EVENT_TYPE(wxEVT_INSERT_TEXT_PROGRESS_BAR)
  DEFINE_LOCAL_EVENT_TYPE(wxEVT_INSERT_PROGRESS_PROGRESS_BAR)
  DEFINE_LOCAL_EVENT_TYPE(wxEVT_FINISHED_ALL_BATCH_JOB)
  DEFINE_LOCAL_EVENT_TYPE(wxEVT_BATCH_JOB_DONE)
#else
  DEFINE_EVENT_TYPE(wxEVT_INSERT_TEXT_PROGRESS_BAR)
  DEFINE_EVENT_TYPE(wxEVT_INSERT_PROGRESS_PROGRESS_BAR)
  DEFINE_EVENT_TYPE(wxEVT_FINISHED_ALL_BATCH_JOB)
  DEFINE_EVENT_TYPE(wxEVT_BATCH_JOB_DONE)
#endif

 and


Link Errir 23
 Under Windows 7, 32 bit, Visual Studio 9 2008 reported the following error when trying to build WxWidgets

LINK : fatal error LNK1000: Internal error during IncrBuildImage


 Solution
 This is a known issue Microsoft provided a hotfix: https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=11399 once downloaded double-click on the exe and it will install (Note you can download to c:\ on windows 7) then everything worked
   
   
   
   

 

 

MILXView Porting Run-Time Errors

This section will describe the errors and the solutions used to overcome the run-time errors observed when running MILXView on windows.

 

 

Run-Time Error 1
can't find any of the milx-view or third party libraries
Solution
  1. Stop Visual studio
  2. Go to “My Computer->Advanced->Environmental settings”
  3. Add the following to PATH variable (if it doesn't exist create it)
    1. C:\milx-view\build\lib\Debug
    2. C:\MILXView-win32-depend\zlib
    3. C:\MILXView-win32-depend\itk-3.16.0\bin\Debug
    4. C:\MILXView-win32-depend\vtk-5.4.2\bin\Debug 
    5. C:\MILXView-win32-depend\libsigc++-2.2.3\MSVC_Net2008\Debug    
    6. C:\MILXView-win32-depend\glew-1.5.2\bin 
    7. C:\MILXView-win32-depend\wxWidgets-2.8.10\lib\vc_dll   
  4. Restart visual studio and run the application
Run-Time Error 2
 Detected memory leaks!
Dumping objects ->
{2653} normal block at 0x072DA178, 4 bytes long.
 Data: < -  > CC 2D 00 00
{2652} normal block at 0x079FB9F0, 48 bytes long.
 Data: <                > F0 B9 9F 07 F0 B9 9F 07 CD CD CD CD CD CD CD CD
{2651} normal block at 0x079FB978, 24 bytes long.
 Data: < >              > D8 3E 20 00 FF FF FF FF 00 00 00 00 00 00 00 00
{2650} normal block at 0x079FB8B8, 96 bytes long.
 Data: <                > F4 B6 8B 10 00 00 00 00 00 00 00 00 00 00 00 00
{2427} normal block at 0x079F4F80, 72 bytes long.
 Data: <H(              > 48 28 84 10 01 00 CD CD 00 00 00 00 CD CD CD CD
{2426} normal block at 0x079F4F08, 24 bytes long.
 Data: < >              > 80 3E 20 00 FF FF FF FF 00 00 00 00 00 00 00 00
{2425} normal block at 0x079F4E80, 40 bytes long.
 Data: <`(              > 60 28 84 10 00 00 00 00 00 00 00 00 00 00 00 00
{2424} normal block at 0x079F4D88, 152 bytes long.
 Data: <$&       O   &  > 24 26 84 10 00 00 00 00 80 4F 9F 07 0C 26 84 10
Object dump complete.
The program '[5928] milxview.exe: Native' has exited with code -1 (0xffffffff).
Solution Fix the memory leaks in this case they were milxViewController * milxViewController::INSTANCE = new milxViewController; which had to be replaced with
milxViewController * milxViewController::INSTANCE = 0; and milxTaskQueue *milxTaskQueue::INSTANCE = new milxTaskQueue(); which i replaced with
milxTaskQueue *milxTaskQueue::INSTANCE = 0; (virtual leak detector)
Run-Time Error 3
The program '[3528] milxview.exe: Native' has exited with code -1 (0xffffffff).
Solution Line 102 in milxViewApp::OnInit() calls FileManager::Init to set up MILXHOME path and library directory if these are not set correctly you'll get this error as the libraries and plugins can't be found and loaded.
Run-Time Error 4
MilxView application starts but no menu options (WxWidgets)
Solution Because the plugin directory has not be located check its set correctly in FileeManager::Init as described above.
Run-Time Error 5
Run-Time Check Failure #0 - The value of ESP was not properly
saved across a function call.
Solution Linked to the error; *****.obj error lnk2001: unresolved external symbol "public: virtual class wxclassindow * __thiscall wxObject::GetClassInfoW(void)const …. This was solved by adding the include file "wx/msw/wxundef.h" to milxImage2D.h and milxImage3D.h as itk adds windows.h and these are needed to undefined some of these variables.
Run-Time Error 6
Couldn't load an image as it seemed to go into an infinite loop
Solution deleteTool was failing in milxViewPageToolbar::SetPerspective as needed to add "Realize" in the milxViewPageToolbar::InitializeTools method to addTool properly
Run-Time Error 7
assert "!(style & wxLB_MULTIPLE) || !(style & wxLB_EXTENDED)" failed in wxListBox::MSWGetStyle(); only one of listbox selection modes can be specified
Solution removed wxLB_EXTENDED from code only one allowed between wxLB_SINGLE, wxLB_MULTIPLE
Run-Time Error 8
debug Assertion failed Expression ("Invalid file open mode", O)
Solution not allowed to have ro or wo must be r or r+ etc
Run-Time Error 9
wxMessageDialog and wxMessageBox don't appear and no result transfrerred back from ShowModal
Solution Modified milxStatusBar.cxx - Must use wsPaintDC in all EVT_PAINT handlers otherwise under windows wxMessageBox and wxMessageDialog among other things don't appear. Also ShowModal doesn't return a value.
Run-Time Error 10 ..\..\src\generic\grid.cpp(3948) assert "(row<GetNumberRows()) && (col < GetNumberCols())" failed in wxGrisStringTable::SetValue(): invalid row or column index in wxGridStringTable
Solution a comma removed  at end of string (count) as code attempted to insert into a tenth column but only 9 stated itkImageStatisticsApp.cxx (count,)
Run-Time Error 11 Loading an image works under Linux, but under windows the image is loaded but then an assert is fired with the following error dialog box:

Debug Assertion Fired

Program: C:\milx-view\build\bin\Debug\milxview.exe
File: f:\dd\vctools\crt_bld\self_x86\crt\sprintf.c
Line: 105

Expression: (format != NULL)

For information on how your program can cause an assertion
Failure, see the visual C++ documentation on asserts.

(Press Retry to debug the application)


The application stops in void vtkXYPlotActor::PlaceAxes when it tries and executes the sprintf line:

// At this point the thing to do would be to actually ask the Y axis
// actor to return the largest label.
// In the meantime, let's try with the min and max
sprintf(str1, axisY->GetLabelFormat(), axisY->GetAdjustedRange()[0]);
 Loading an image works under Linux, but under windows the image is loaded but then an assert is fired with the following error dialog box:

Debug Assertion Fired

Program: C:\milx-view\build\bin\Debug\milxview.exe
File: f:\dd\vctools\crt_bld\self_x86\crt\sprintf.c
Line: 105

Expression: (format != NULL)

For information on how your program can cause an assertion
Failure, see the visual C++ documentation on asserts.

(Press Retry to debug the application)


The application stops in void vtkXYPlotActor::PlaceAxes when it tries and executes the sprintf line:

// At this point the thing to do would be to actually ask the Y axis
// actor to return the largest label.
// In the meantime, let's try with the min and max
sprintf(str1, axisY->GetLabelFormat(), axisY->GetAdjustedRange()[0]);
 Loading an image works under Linux, but under windows the image is loaded but then an assert is fired with the following error dialog box:

Debug Assertion Fired

Program: C:\milx-view\build\bin\Debug\milxview.exe
File: f:\dd\vctools\crt_bld\self_x86\crt\sprintf.c
Line: 105

Expression: (format != NULL)

For information on how your program can cause an assertion
Failure, see the visual C++ documentation on asserts.

(Press Retry to debug the application)


The application stops in void vtkXYPlotActor::PlaceAxes when it tries and executes the sprintf line:

// At this point the thing to do would be to actually ask the Y axis
// actor to return the largest label.
// In the meantime, let's try with the min and max
sprintf(str1, axisY->GetLabelFormat(), axisY->GetAdjustedRange()[0]);
Loading an image works under Linux, but under windows the image is loaded but then an assert is fired with the following error dialog box:

Debug Assertion Fired
Loading an image works under Linux, but under windows the image is loaded but then an assert is fired with the following error dialog box:
Solution Problem was that when we hovered the mouse (in debug) mode over "axisY->getlabelFormat()" we the value of LabelFormat was "0x00000000 <bad_ptr>". Tracking down where the LabelFormat was set brought us to milxHistogram::milxHistogram here:
 m_plotActor->SetLabelFormat(0);
 m_plotActor->SetXTitle(0);
 m_plotActor->SetYTitle(0);
 These are const char* however so should be initialized with an empty string so the values were modified to:
    m_plotActor->SetLabelFormat("");
    m_plotActor->SetXTitle("");
    m_plotActor->SetYTitle("");    
Note that Title still gives a bad_ptr as its defined in vtkXYPlotActor::vtkXYPlotActor() as
  this->Title = NULL;
  should be this->Title = "" ???
Run-Time Error 12 On the crosshairs plugin when selecting "Enable Crosshairs" or "Enable sphere" or changing the "Opcaity" would cause MILXView to crash
Solution It happened because these widgets were losing their statuses, made them static to reslove this i.e  milxCrossHairsPlugin.h and milxCrossHairsPlugin.cxx
     // MIX-163 made static because during runtime on windows
     // they lose their statuses.
        static wxCheckBox * m_checkEnabled;
        static wxCheckBox * m_checkSphereEnabled;

        // Opacity controls
        static wxSlider * sliderOpacity;
        static wxTextCtrl * textOpacity;{
//MIX-163 - made static because during runtime on windows they lose their statuses
wxCheckBox * milxCrossHairsPlugin::m_checkEnabled = 0;
wxCheckBox * milxCrossHairsPlugin::m_checkSphereEnabled = 0;
wxSlider * milxCrossHairsPlugin::sliderOpacity = 0;
wxTextCtrl * milxCrossHairsPlugin::textOpacity = 0;
Run-Time Error 13 Changing the colour on the colour plugin didn't do anything...
Solution Firstly the milxColourMapPlugin::OnColourMapChanged method wasn't getting called so modified the connect call from
    Connect(wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED,
            wxCommandEventHandler(milxColourMapPlugin::OnColourMapChanged));
to
    colourMapCombo->Connect(wxEVT_COMMAND_TEXT_UPDATED,
            wxCommandEventHandler(milxColourMapPlugin::OnColourMapChanged), NULL, this);
becuause it was not a combobox for a start and using the colourMapCombo->Connect meant an ID wasn't needed. Still the method wasn't called so modified the creation of the wxComboCtrl from:
        
    colourMapCombo = new wxComboCtrl(this, GetLocalId("colourMapCombo"), wxEmptyString,
            wxDefaultPosition, wxSize(100, -1), wxCB_READONLY);
    

    to:
    colourMapCombo = new wxComboCtrl(this, GetLocalId("colourMapCombo"), wxEmptyString,
            wxDefaultPosition, wxSize(100, -1), wxTE_PROCESS_ENTER);
    i.e. use wxTE_PROCESS_ENTER (windows only -but also works for windows style) instead of more generic wxCB_READONLY meaning that the labels are now not readonly - need to come back to this...
     Also these widgets were losing their statuses, (i.e. their values were NULL in the debugger causing MILXView to crash )made them static to reslove this i.e
     // MIX-163 made static because during runtime on windows
     // they lose their statuses.
        static milxComboPopup * colourMapPopup;
        
        static wxComboBox *colourRampCombo;
        static wxColourPickerCtrl * colourPickerLow;
        static wxColourPickerCtrl * colourPickerHigh;

        // Opacity
        static wxSlider * sliderOpacity;
        static wxTextCtrl * editOpacity;
//MIX-163 - made static because during runtime on windows they lose their statuses
milxComboPopup * milxColourMapPlugin::colourMapPopup = 0;
wxComboBox *milxColourMapPlugin::colourRampCombo = 0;
wxColourPickerCtrl * milxColourMapPlugin::colourPickerLow = 0;
wxColourPickerCtrl * milxColourMapPlugin::colourPickerHigh = 0;

wxSlider * milxColourMapPlugin::sliderOpacity = 0;
wxTextCtrl * milxColourMapPlugin::editOpacity = 0;
Run-Time Error 14 Compare plugin doesn't do anything when image set
Solution Modify the create statement from:
 m_imageCombo = new milxImageComboBox(this, IMAGE_COMBO_ID);
 to:
 m_imageCombo = new milxImageComboBox(this, IMAGE_COMBO_ID, wxEmptyString,
            wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
 i.e. Add wxTE_PROCESS_ENTER and chnage the coonect statement from:
  EVT_COMBOBOX( IMAGE_COMBO_ID, milxImageComparePanel::OnImageComboChanged )
  to:
  m_imageCombo->Connect(wxEVT_COMMAND_TEXT_UPDATED,
   wxCommandEventHandler(milxImageComparePanel::OnImageComboChanged), NULL, this);
as its a text that's getting updated even though its a combobox
Run-Time Error 15 Linux and windows show different order of elements in a popup box (milxComboPopup)
Solution Cause milxComboPopup::Create uses wxLC_SORT_ASCENDING it works for windows i.e. Puts elements in ascending order but not for Linux as we need to add sortItems and serDataItem etc... See wxwidgets for more info under wxListCtrl. Removed wcLC_SORT_ASCENDING from milxComboPopup::Create

 

Run-Time Error 16 Adding files to the CTE UI and then clicking on the "Process" button creates an assertion failure
..\..\src\common\ctrlsub.cpp(170): assert "m_clientDataItemsType == wxClientData_void" failed in wxItemContainer::GetClientData(): this window doesn't have void client data.
Looks like we have a mismatch data type. The stack dump is:
     milx-lib.dll!milx::milxBatchFilePanel::GetBatch()  Line 151 + 0x15 bytes    C++
     milx-CTEPlugin.dll!milx::milxCTEPanel::OnProcessButtonClicked(wxCommandEvent & __formal={...})  Line 732 + 0xf bytes    C++
The line being:
      batch.push_back( static_cast<milxImageSourceWrapper *>(m_listbox->GetClientData(i))->GetValue() );
 Solution check
GetClientDataType() return value. If it returns wxClientData_Object, then
you must be calling SetClientObject() somewhere. If it returns
wxClientData_Void then you hadn't set the client data before retrieving it.
 Need to GetClientObject rather than GetClientData (don't know why this works on Linux) so the line should read:

batch.push_back( static_cast<milxImageSourceWrapper *>(m_listbox->GetClientObject(i))->GetValue() );
Run-Time Error 17
We get an unhandled exception when clicking on the "Process" button in CTE. The stack dump is:
>    wxbase28ud_vc_custom.dll!wxMutex::Lock()  Line 42 + 0x3 bytes    C++
     milx-CTE.dll!milx::milxCTEReadWriteLock::RequestWrite()  Line 89 + 0xd bytes    C++
The code breaks in the method:
wxMutexError wxMutex::Lock()
{
    wxCHECK_MSG( m_internal, wxMUTEX_INVALID,
                 _T("wxMutex::Lock(): not initialized") );

    return m_internal->Lock();
}
Solution Need to initialise the mutexes in the constructors of each cxx file:
m_WriteMutex = new wxMutex;
m_ReadCountMutex = new wxMutex

Note: ideally we should be using wxMutexLocker instead, but as we're not I also needed to create a destructor to delete the mutexes.
Run-Time 18 Error
Run-Time Check Failure #2 - Stack around the variable '****' was corrupted
Solution  This happens for example if you write to an invalid address. For example you write to the fifth element of an array, but the array is on;y defined to hold 4 elements. Then when freeing the Variable buffer when leaving the function-scope, it is stated that the stack around that Variable is corrupted, cause you wrote to invalid address. This was the case for me me in ~/lib/src/libcte/milxEMSFilter.cxxas the array was in a loop 6 times initialising its elements but there were only 4 elements.
Run-Time 19 Error 0xC0000005: Access violation writing location 0x00000000. Run-Time Check Failure #3 - The variable 'NullVoxelPt' is being used without being initialized. 
Solution  
Run-Time 20 Error debug assertion error:
Expression: list iterator not incremental
Solution

Initially we had the code in milxCTELaplaceSORFilter::SolveLaplace

 

...

 

    for (typename GridPointList::iterator pos; pos = ptrGMVoxels.begin(); pos != ptrGMVoxels.end(); ++pos)

    {

             ...

 

                pos =  ptrGMVoxels.erase(pos);       

 

 

Then halfway through the “for” loop I got an exception. I think what was happening was we were either decrementing an iterator at  ptrGMVoxels.begin which is of course not a valid result, or incrementing past the end after deleting the last element. Basically it's OK to increment or decrement a valid iterator as long as the result is valid. Decrementing an iterator that whose value is begin() is not OK.

 

The correct coding is as follows

 

typename GridPointList::iterator pos;

 

for (pos = ptrGMVoxels.begin(); pos != ptrGMVoxels.end();)

    {

             ...

 

      If

     {

      // Erase the current one and save the incremented iterator

                 ptrGMVoxels.erase(pos++);       

     }

     Else

     {

           ++pos;

     }

Run-Time 21 Error C:\MILXView-win32-depend\wxWidgets-2.9.1\include\wx/strvararg.h(449):
  assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype"
  failed in wxArgNormalizer<unsigned __int64>::wxArgNormalizer(): format
  specifier doesn't match argument type

From the Debug the code stops at:

     // Current Progress
      buffer.Printf(wxT("%d"), info[i].GetProgress());


Solution Does your GetProgress maybe return a 64-bit integer? You should either
convert/cast to an int, change the return type of GetProgress, or
change the format specifier (%d). The assert you were seeing earlier
on (and probably now) contained a hint about this: "format specifier
doesn't match argument type". I get the exact same assert with the
above code if I let the function return a float or 64-bit int.

so as a test modified to the following which worked:

// Current Progress
      buffer.Printf(wxT("%d"), (int)(info[i].GetProgress()));

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Document Actions
PortletA
Museum Robot

School students and others living in all corners of the country will soon have greater access to Australia's history, thanks to a CSIRO robot and high speed broadband connectivity. Read more...

PortletB
Colin Griffith Apps Day spotlight

The Australian Centre for Broadband Innovation's first industry event demonstrated there is strong interest in driving innovation in broadband-enabled services. Read more...

PortletC
Wifi Team

The CSIRO team that invented one of the foundation technologies of Wi-Fi has been named as a finalist in the European Inventor Award 2012. Read more