[Insight-users] issue with the file: cstddef - Qt and ITK and g++

Merlin Lenchanteur tibouroxane at yahoo.fr
Tue Apr 20 15:00:54 EDT 2010


Hello,

I just wanted to point out what could seems a very small detail at first, but in the end, I spent quite a few hours (even days) to find it out.

My environments are the following:
First:
Win32 - XP Pro
Qt 4.6.2 (opensource edition)
ITK 3.12 and 3.16
Mingw 3.4.5 and 4.4.0

Second:
Ubuntu 9.10 (Karmic Koala) 32 bits
Qt 4.6.2 (opensource edition)
ITK 3.18
compiler: gnu 4.4.1

On both configuration: CMake v2.8

I wanted to use Qt and ITK together in my applications and with mingw 
3.4.5 (and now 4.4) for Win32 or gnu 4.4.1 for Linux. But when 
compiling, I had weird errors about std::size_t not found. Typical errors when we are missing includes or dependencies.
I tried with Win32 using microsoft visual studio, but there was no 
problem. It only appears with the g++ compiler.


Step to reproduce the problem:
Prerequisite: Qt and ITK correctly set up.
Write a simple main.cpp program which include qapplication.h (for example).
Create a makefile which contains Qt and all ITK dependencies and 
includes ( don't forget Utilities\itksys - it's there that the problem 
lies).
Run make --> error
If you remove all the ITK dependencies and includes, the make succeeds 
(but then we can not use ITK :(!!).


How I solved it:
The problem is in the install directory of ITK.
To build and install ITK, I used CMake. In the settings, I remove 
threading (because I don't need it). The CMake part and the build of ITK runs smoothly.
Then I run "make install". So far, so good; everything is installed in 
my install directory (I thought).

In fact, the filename cstddef does not contain the '.h' extension in the 
directory
"install \ include \ InsightToolkit \ Utilities \ itksys".
I changed this (renamed cstddef to cstddef.h), and then, everything went well for me from that point on.

Is there any particular reason for this file not to have the .h 
extension as all its friends next to it in the directory? or is this a 
bug ?

I spent quite a long time to find this out, by first rechecking my code 
(before going to a simple study case), redownloading and recompiling Qt 
and ITK, changing compilers version and so on.

If my current fix (the fact to add the extension '.h' to the cstddef filename) is not 
recommended, please, let me know, but if you could help me fix 
my problem then, I'll take any suggestions.

Anyway, my proposed fix might help somebody.

good day,


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100420/2e995a86/attachment-0001.htm>


More information about the Insight-users mailing list