<br>As a noob to ObjC-C++ conventions, this filename extention seems weird:<br><br>"sourcecode.cpp.objcpp"<br><br>Did you try "<a href="http://sourcecode.mm">sourcecode.mm</a>"?<br><br>That may inform the compiler of how to handle the file.<br>
<br>Take care,<br>Darren<br><br><br><br><div class="gmail_quote">On Wed, Oct 14, 2009 at 11:06 AM, Olivier Saut <span dir="ltr"><<a href="mailto:saut.olivier@orange.fr">saut.olivier@orange.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br>
<br>
sorry if it is a frequent question but I have not found any working solution to my problem: I am trying (without success so far) to use ITK in a Cocoa app on Snow Leopard (Xcode 3.2) . Project file was generated from Xcode.<br>
<br>
I have set the filetype of the file containing the ITK calls to Objective-C++ (sourcecode.cpp.objcpp), Header and Library Search Paths are set to find ITK files. However I still have the following errors just by including itkImage. (I can use ITK within a command line app in C++.)<br>
<br>
Anyone knows what I am doing wrong?<br>
<br>
<br>
Thanks!<br>
<br>
-- Source file ---<br>
#import "Segmenter.hpp"<br>
<br>
#ifdef __cplusplus<br>
// (found on <a href="http://www.nabble.com/Re:-itk-vtk-and-cocoa-p20230764.html" target="_blank">http://www.nabble.com/Re:-itk-vtk-and-cocoa-p20230764.html</a>)<br>
// Define undefined constant to avoid warnings.<br>
#define ITK_TEMPLATE_CXX 0<br>
#define ITK_TEMPLATE_TYPE 0<br>
#include<itkImage.h><br>
#endif<br>
<br>
@implementation Segmenter<br>
- (id) init {<br>
self=[super init];<br>
if(self != nil) {<br>
<br>
}<br>
return self;<br>
}<br>
<br>
@end<br>
-- End of Source file --<br>
<br>
-- Error Log --<br>
Build CSeg of project CSeg with configuration Debug<br>
<br>
CompileC build/CSeg.build/Debug/CSeg.build/Objects-normal/x86_64/Segmenter.o Segmenter.mm normal x86_64 objective-c++ com.apple.compilers.gcc.4_2<br>
cd /Users/saut/Dropbox/CSeg<br>
setenv LANG en_US.US-ASCII<br>
/Developer/usr/bin/gcc-4.2 -x objective-c++ -arch x86_64 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -pg -Wreturn-type -Wunused-variable -isysroot /Developer/SDKs/MacOSX10.6.sdk -mfix-and-continue -fobjc-gc -fvisibility-inlines-hidden -mmacosx-version-min=10.6 -gdwarf-2 -fopenmp -iquote /Users/saut/Dropbox/CSeg/build/CSeg.build/Debug/CSeg.build/CSeg-generated-files.hmap -I/Users/saut/Dropbox/CSeg/build/CSeg.build/Debug/CSeg.build/CSeg-own-target-headers.hmap -I/Users/saut/Dropbox/CSeg/build/CSeg.build/Debug/CSeg.build/CSeg-all-target-headers.hmap -iquote /Users/saut/Dropbox/CSeg/build/CSeg.build/Debug/CSeg.build/CSeg-project-headers.hmap -F/Users/saut/Dropbox/CSeg/build/Debug -I/Users/saut/Dropbox/CSeg/build/Debug/include -I/Users/saut/thrill/include/InsightToolkit -I/Users/saut/thrill/include/InsightToolkit/Algorithms -I/Users/saut/thrill/include/InsightToolkit/BasicFilters -I/Users/saut/thrill/include/InsightToolkit/Common -I/Users/saut/thrill/include/InsightToolkit/gdcm -I/Users/saut/thrill/include/InsightToolkit/IO -I/Users/saut/thrill/include/InsightToolkit/Numerics -I/Users/saut/thrill/include/InsightToolkit/SpatialObject -I/Users/saut/thrill/include/InsightToolkit/Utilities -I/Users/saut/thrill/include/InsightToolkit/gdcm/Dicts -I/Users/saut/thrill/include/InsightToolkit/gdcm/src -I/Users/saut/thrill/include/InsightToolkit/Numerics/FEM -I/Users/saut/thrill/include/InsightToolkit/Numerics/NeuralNetworks -I/Users/saut/thrill/include/InsightToolkit/Numerics/Statistics -I/Users/saut/thrill/include/InsightToolkit/Utilities/expat -I/Users/saut/thrill/include/InsightToolkit/Utilities/itkExtHdrs -I/Users/saut/thrill/include/InsightToolkit/Utilities/itkpng -I/Users/saut/thrill/include/InsightToolkit/Utilities/itksys -I/Users/saut/thrill/include/InsightToolkit/Utilities/itktiff -I/Users/saut/thrill/include/InsightToolkit/Utilities/itkzlib -I/Users/saut/thrill/include/InsightToolkit/Utilities/MetaIO -I/Users/saut/thrill/include/InsightToolkit/Utilities/NrrdIO -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl -I/Users/saut/thrill/include/InsightToolkit/Utilities/itksys/ios -I/Users/saut/thrill/include/InsightToolkit/Utilities/itksys/stl -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/core -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/vcl -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/core/vnl -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p/netlib -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/vcl/borland55 -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/vcl/borland56 -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/vcl/egcs -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/vcl/emulation -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/vcl/gcc -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/vcl/gcc-295 -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/vcl/gcc-libstdcxx-v3 -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/vcl/generic -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/vcl/iso -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/vcl/mwerks -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/vcl/sgi -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/vcl/stlport -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/vcl/sunpro -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/vcl/vcl_sys -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/vcl/win32-vc60 -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/vcl/win32-vc70 -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/core/vnl/algo -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p/netlib/blas -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p/netlib/datapac -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p/netlib/eispack -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p/netlib/lapack -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p/netlib/laso -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p/netlib/linalg -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p/netlib/linpack -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p/netlib/mathews -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p/netlib/minpack -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p/netlib/napack -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p/netlib/opt -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p/netlib/sparse -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p/netlib/temperton -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p/netlib/toms -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p/netlib/lapack/complex16 -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p/netlib/lapack/double -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p/netlib/lapack/single -I/Users/saut/thrill/include/InsightToolkit/Utilities/vxl/v3p/netlib/lapack/util -I/Users/saut/Dropbox/CSeg/build/CSeg.build/Debug/CSeg.build/DerivedSources/x86_64 -I/Users/saut/Dropbox/CSeg/build/CSeg.build/Debug/CSeg.build/DerivedSources -include /var/folders/Wa/WaB1Wzw+HaCPXA71ALf6+++++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/CSeg_Prefix-bdswsgxfpnuwmmchklxbfrubchhw/CSeg_Prefix.pch -c /Users/saut/Dropbox/CSeg/Segmenter.mm -o /Users/saut/Dropbox/CSeg/build/CSeg.build/Debug/CSeg.build/Objects-normal/x86_64/Segmenter.o<br>
<br>
In file included from /Users/saut/thrill/include/InsightToolkit/Common/itkLightObject.h:20,<br>
from /Users/saut/thrill/include/InsightToolkit/Common/itkObject.h:23,<br>
from /Users/saut/thrill/include/InsightToolkit/Common/itkDataObject.h:23,<br>
from /Users/saut/thrill/include/InsightToolkit/Common/itkImageBase.h:23,<br>
from /Users/saut/thrill/include/InsightToolkit/Common/itkImage.h:20,<br>
from /Users/saut/Dropbox/CSeg/Segmenter.mm:16:<br>
/Users/saut/thrill/include/InsightToolkit/Common/itkSmartPointer.h:129: error: expected ';' before '(' token<br>
/Users/saut/thrill/include/InsightToolkit/Common/itkSmartPointer.h:136: error: expected `;' before 'private'<br>
/Users/saut/thrill/include/InsightToolkit/Common/itkSmartPointer.h:153: error: expected constructor, destructor, or type conversion before '&' token<br>
In file included from /Users/saut/thrill/include/InsightToolkit/Common/itkTimeStamp.h:23,<br>
from /Users/saut/thrill/include/InsightToolkit/Common/itkLightObject.h:21,<br>
from /Users/saut/thrill/include/InsightToolkit/Common/itkObject.h:23,<br>
from /Users/saut/thrill/include/InsightToolkit/Common/itkDataObject.h:23,<br>
from /Users/saut/thrill/include/InsightToolkit/Common/itkImageBase.h:23,<br>
from /Users/saut/thrill/include/InsightToolkit/Common/itkImage.h:20,<br>
from /Users/saut/Dropbox/CSeg/Segmenter.mm:16:<br>
/Users/saut/thrill/include/InsightToolkit/Common/itkMacro.h:533: error: expected class-name before '{' token<br>
In file included from /Users/saut/thrill/include/InsightToolkit/Common/itkMacro.h:589,<br>
from /Users/saut/thrill/include/InsightToolkit/Common/itkTimeStamp.h:23,<br>
from /Users/saut/thrill/include/InsightToolkit/Common/itkLightObject.h:21,<br>
from /Users/saut/thrill/include/InsightToolkit/Common/itkObject.h:23,<br>
from /Users/saut/thrill/include/InsightToolkit/Common/itkDataObject.h:23,<br>
from /Users/saut/thrill/include/InsightToolkit/Common/itkImageBase.h:23,<br>
from /Users/saut/thrill/include/InsightToolkit/Common/itkImage.h:20,<br>
from /Users/saut/Dropbox/CSeg/Segmenter.mm:16:<br>
/Users/saut/thrill/include/InsightToolkit/Common/itkExceptionObject.h:55: error: expected class-name before '{' token<br>
/Users/saut/thrill/include/InsightToolkit/Common/itkExceptionObject.h:57: error: 'exception' in namespace 'std' does not name a type<br>
/Users/saut/thrill/include/InsightToolkit/Common/itkExceptionObject.h:64: error: expected unqualified-id before '&' token<br>
/Users/saut/thrill/include/InsightToolkit/Common/itkExceptionObject.h:64: error: expected ',' or '...' before '&' token<br>
/Users/saut/thrill/include/InsightToolkit/Common/itkExceptionObject.h:66: error: 'itk::ExceptionObject::ExceptionObject()' cannot be overloaded<br>
---<br>
<br>
<br>
Thanks a lot,<br>
<br>
- Olivier<br>
<br>
<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>
Please keep messages on-topic and check the ITK FAQ at: <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>
</blockquote></div><br>