<br>Hi Merlin,<br><br>Thanks for your detailed email and for sharing this findings.<br><br><br>Looking at the content of the cstddef might be enlightening:<br><br><br>-------------------------------------------------------------------<br>
#ifndef itksys_cstddef<br>#define itksys_cstddef<br><br>#include <itksys/Configure.hxx><br><br>/* Avoid warnings in MSVC standard headers. */<br>#ifdef _MSC_VER<br># pragma warning (push, 1)<br># pragma warning (disable: 4702)<br>
# pragma warning (disable: 4786)<br>#endif<br><br>/* Include the real header. */<br>#if itksys_CXX_HAS_CSTDDEF<br># include <cstddef><br>#else<br># include <stddef.h><br>#endif<br><br>#ifdef _MSC_VER<br># pragma warning(pop)<br>
#endif<br><br>#endif<br><br>-------------------------------------------------------<br><br><br>The primary suspect for the conflict that you are observing <br>is the variable:<br><br> itksys_CXX_HAS_CSTDDEF<br>
<br>this variable get set during the configuration process <br>via try-compiles.<br><br>and decides whether this file is going to redirect <br>the include to:<br><br> # include <cstddef><br>or to<br>
<br> # include <stddef.h><br><br><br>The value is set in the file<br><br> Configure.hxx<br><br>(in the binary directory Utilities/itksys)<br><br><br>In a Visual Studio 9 configuration, this variable is set to<br>
<br> Configure.hxx: #define itksys_CXX_HAS_CSTDDEF 1<br><br>in a Ubuntu Linux 9.10 gcc 4.4 configuration, it gets set to<br><br> Configure.hxx: #define itksys_CXX_HAS_CSTDDEF 1<br>
<br><br>So, the question is:<br><br> What is the value of this variable <br> in your MinGW build ?<br><br>and... do you have a "cstddef" file in the include directory<br>of Gcc under MinGW ?<br>
<br>As a reference, <br>In Ubuntu Linux, with gcc 4.4 this file is at:<br><br> /usr/include/c++/4.4/cstddef<br><br><br><br> Please let us know what you find,<br><br><br> Thanks<br><br><br> Luis<br>
<br><br>------------------------------------------------<br><div class="gmail_quote">On Tue, Apr 20, 2010 at 3:00 PM, Merlin Lenchanteur <span dir="ltr"><<a href="mailto:tibouroxane@yahoo.fr">tibouroxane@yahoo.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div>Hello,<br><br>
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.<br>
<br>
My environments are the following:<br>
First:<br>
Win32 - XP Pro<br>
Qt 4.6.2 (opensource edition)<br>
ITK 3.12 and 3.16<br>
Mingw 3.4.5 and 4.4.0<br>
<br>
Second:<br>
Ubuntu 9.10 (Karmic Koala) 32 bits<br>
Qt 4.6.2 (opensource edition)<br>
ITK 3.18<br>
compiler: gnu 4.4.1<br>
<br>
On both configuration: CMake v2.8<br>
<br>
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.<br>
I tried with Win32 using microsoft visual studio, but there was no
problem. It only appears with the g++ compiler.<br>
<br>
<br>
Step to reproduce the problem:<br>
Prerequisite: Qt and ITK correctly set up.<br>
Write a simple main.cpp program which include qapplication.h (for example).<br>
Create a makefile which contains Qt and all ITK dependencies and
includes ( don't forget Utilities\itksys - it's there that the problem
lies).<br>
Run make --> error<br>
If you remove all the ITK dependencies and includes, the make succeeds
(but then we can not use ITK :(!!).<br>
<br>
<br>
How I solved it:<br>
The problem is in the install directory of ITK.<br>
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.<br>
Then I run "make install". So far, so good; everything is installed in
my install directory (I thought).<br>
<br>
In fact, the filename cstddef does not contain the '.h' extension in the
directory<br>
"install \ include \ InsightToolkit \ Utilities \ itksys".<br>
I changed this (renamed cstddef to cstddef.h), and then, everything went
well for me from that point on.<br>
<br>
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 ?<br>
<br>
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.<br>
<br>
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.<br><br>Anyway, my proposed fix might help somebody.<br>
<br>
good day,<br>
<br>
</div>
</div>
</div><br>
</div><br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>