[Insight-users] Using ITK in a Cocoa App (+Xcode)

Darren Weber darren.weber.lists at gmail.com
Mon Oct 26 17:18:57 EDT 2009


Hard to see exactly, but it looks like the include path for ITK is unusual
(to my eye, the 'iquote' option to gcc or g++ is unusual):

-iquote/Users/saut/thrill/include/InsightToolkit/Common

Nevertheless, it should work, from the man page:

"
4459        -iquote dir
    4460            Search dir only for header files requested with
"#include "file""; they are not searched for
    4461            "#include <file>", before all directories specified by
-I and before the standard system
    4462            directories.
"

Also, I'm no expert on the gcc suite, but I generally call g++ for any c++
programs (one would have to believe that the Apple Xcode and bundled gcc
suite is able to resolve gcc calls for Objc-C++ programs correctly).



On Mon, Oct 26, 2009 at 1:29 PM, Olivier Saut <saut.olivier at orange.fr>wrote:

>
> Le 26 oct. 2009 à 20:57, Sean McBride a écrit :
>
>
>
>> On 10/26/09 12:49 PM, Darren Weber said:
>>
>>  Was the ITK lib built with the cocoa option for the render engine?  (The
>>> alternatives are x11 and carbon.)
>>>
>>
>> You're thinking of VTK, not ITK. :)
>>
>> Olivier, in your test project, can you include other C++ headers (not
>> ITK ones) without compiler errors?
>>
>
>
> Yes. For instance starting from a new project (with User Header Search Path
> minimally set to $HOME/thrill/include/InsightToolkit/Common)  the following
> code :
> ---
> //  test.mm
> #import "test.h"
> #include <iostream>
> #include <vector>
>
> // Compiles and run without the following include
> #include "itkSmartPointer.h"
>
> @implementation test
>
> - (id) init {
>    NSLog(@"test");
>
>    std::vector<double> vect;
>    vect.push_back(0.0);
>    std::cout << "test" << std::endl;
>    return self;
> }
>
> @end
> ---
> compiles and run when I comment out #include "itkSmartPointer.h".
> With the ITK include, I obtain the following error :
> /Users/saut/thrill/include/InsightToolkit/Common/itkSmartPointer.h:129:
> error: function definition does not declare parameters
>
> The complete transcript is
> Build Untitled of project Untitled with configuration Debug
>
> CompileC
> build/Untitled.build/Debug/Untitled.build/Objects-normal/x86_64/test.o
> test.mm normal x86_64 objective-c++ com.apple.compilers.gcc.4_2
> cd /Users/saut/Desktop/Untitled
>
> setenv LANG en_US.US-ASCII
> /Developer/usr/bin/gcc-4.2 -x objective-c++ -arch x86_64 -fmessage-length=0
> -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type
> -Wunused-variable -isysroot /Developer/SDKs/MacOSX10.6.sdk
> -mfix-and-continue -fvisibility-inlines-hidden -mmacosx-version-min=10.6
> -gdwarf-2 -iquote
> /Users/saut/Desktop/Untitled/build/Untitled.build/Debug/Untitled.build/Untitled-generated-files.hmap
> -I/Users/saut/Desktop/Untitled/build/Untitled.build/Debug/Untitled.build/Untitled-own-target-headers.hmap
> -I/Users/saut/Desktop/Untitled/build/Untitled.build/Debug/Untitled.build/Untitled-all-target-headers.hmap
> -iquote
> /Users/saut/Desktop/Untitled/build/Untitled.build/Debug/Untitled.build/Untitled-project-headers.hmap
> -F/Users/saut/Desktop/Untitled/build/Debug
> -iquote/Users/saut/thrill/include/InsightToolkit/Common
> -I/Users/saut/Desktop/Untitled/build/Debug/include
> -I/Users/saut/Desktop/Untitled/build/Untitled.build/Debug/Untitled.build/DerivedSources/x86_64
> -I/Users/saut/Desktop/Untitled/build/Untitled.build/Debug/Untitled.build/DerivedSources
> -include
> /var/folders/Wa/WaB1Wzw+HaCPXA71ALf6+++++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/Untitled_Prefix-csugzkpcvxzatqfcqgrxlfvlcabr/Untitled_Prefix.pch
> -c /Users/saut/Desktop/Untitled/test.mm -o
> /Users/saut/Desktop/Untitled/build/Untitled.build/Debug/Untitled.build/Objects-normal/x86_64/test.o
>
> In file included from /Users/saut/Desktop/Untitled/test.mm:8:
> /Users/saut/thrill/include/InsightToolkit/Common/itkSmartPointer.h:129:
> error: function definition does not declare parameters
>
>
>
> Thanks!
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20091026/e0cdfdd8/attachment-0001.htm>


More information about the Insight-users mailing list