[Insight-users] Noob question, but I have to

Luis Ibanez luis.ibanez at kitware.com
Thu Apr 15 21:40:12 EDT 2010


Hi Boris,

Have you verified that there is indeed a file

                     libITKCommon.a

in the "bin" subdirectory of the binary directory
where you build ITK ?

Also,

Did you used Shared libraries when you build ITK ?

(if so, you may want to change that build to use
static libraries).


Please let us know what you find.


      Thanks


            Luis



-----------------------------------------------------
On Mon, Apr 12, 2010 at 8:06 PM, Boris Shabash <bshabash at hotmail.com> wrote:

>
> Used
> make VERBOSE=1
>
> and got the following:
>
> /usr/local/bin/cmake
>
> -H/Users/borisshabash/Desktop/School/CMPT/888/project/ITK_Assignment/ReadProcesssWrtieFolder
>
> -B/Users/borisshabash/Desktop/School/CMPT/888/project/ITK_Assignment/ReadProcesssWrtieFolder
> --check-build-system CMakeFiles/Makefile.cmake 0
> /usr/local/bin/cmake -E cmake_progress_start
>
> /Users/borisshabash/Desktop/School/CMPT/888/project/ITK_Assignment/ReadProcesssWrtieFolder/CMakeFiles
>
> /Users/borisshabash/Desktop/School/CMPT/888/project/ITK_Assignment/ReadProcesssWrtieFolder/CMakeFiles/progress.make
> make -f CMakeFiles/Makefile2 all
> make -f CMakeFiles/ReadProcessWrite.dir/build.make
> CMakeFiles/ReadProcessWrite.dir/depend
> cd
>
> /Users/borisshabash/Desktop/School/CMPT/888/project/ITK_Assignment/ReadProcesssWrtieFolder
> && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles"
>
> /Users/borisshabash/Desktop/School/CMPT/888/project/ITK_Assignment/ReadProcesssWrtieFolder
>
> /Users/borisshabash/Desktop/School/CMPT/888/project/ITK_Assignment/ReadProcesssWrtieFolder
>
> /Users/borisshabash/Desktop/School/CMPT/888/project/ITK_Assignment/ReadProcesssWrtieFolder
>
> /Users/borisshabash/Desktop/School/CMPT/888/project/ITK_Assignment/ReadProcesssWrtieFolder
>
> /Users/borisshabash/Desktop/School/CMPT/888/project/ITK_Assignment/ReadProcesssWrtieFolder/CMakeFiles/ReadProcessWrite.dir/DependInfo.cmake
> --color=
> make -f CMakeFiles/ReadProcessWrite.dir/build.make
> CMakeFiles/ReadProcessWrite.dir/build
> Linking CXX executable ReadProcessWrite
> /usr/local/bin/cmake -E cmake_link_script
> CMakeFiles/ReadProcessWrite.dir/link.txt --verbose=1
> /usr/bin/g++     -ftemplate-depth-50 -Wall -Wno-deprecated -no-cpp-precomp
> -Wno-long-double -Wl,-search_paths_first -headerpad_max_install_names -fPIC
> CMakeFiles/ReadProcessWrite.dir/ReadProcessWrite.o  -o ReadProcessWrite
> -L/Users/borisshabash/Desktop/School/CMPT/888/project/itkXcodeBuild/bin
> -lITKCommon -litkvnl_inst -litkvnl_algo -litkv3p_netlib -litkvnl -litkvcl
> -lm -litksys -lpthread -lm
> ld: library not found for -lITKCommon
> collect2: ld returned 1 exit status
> make[2]: *** [ReadProcessWrite] Error 1
> make[1]: *** [CMakeFiles/ReadProcessWrite.dir/all] Error 2
> make: *** [all] Error 2
>
> any insight?
>
>
>
> Boris Shabash wrote:
> >
> > Hello everyone
> >
> > I am currently working on a class project requiring ITK. I created the
> > binary using cmake and am working with the first example.
> >
> > I created a folder called "HelloWorldFolder" on my mac and inside created
> > a CmakeLists.txt file with the following:
> > PROJECT(HelloWorld)
> >
> > FIND_PACKAGE(ITK)
> > IF (ITK_FOUND)
> >       INCLUDE(${ITK_USE_FILE})
> > ELSE(ITK_FOUND)
> >       MESSAGE(FATAL_ERROR
> >                         "ITK not found. Please set ITK_DIR.")
> > ENDIF(ITK_FOUND)
> >
> > ADD_EXECUTABLE(HelloWorld HelloWorld.cxx)
> >
> > TARGET_LINK_LIBRARIES(HelloWorld ITKCommon)
> >
> >
> > I also created a file called HelloWorld.cxx and in it I wrote:
> > #include "itkImage.h"
> > #include <iostream>
> >
> > int main()
> > {
> >       typedef itk::Image<unsigned short, 3> ImageType;
> >
> >       ImageType::Pointer image = ImageType::New();
> >
> >       std::cout<<"ITK HELLOW WORLD!"<<std::endl;
> >
> >       return 0;
> > }
> >
> >
> > Then I type "ccmake ." in the folder and do all the configurations, then
> I
> > type "make" and get the following error:
> >
> > Scanning dependencies of target HelloWorld
> > [100%] Building CXX object CMakeFiles/HelloWorld.dir/HelloWorld.o
> > Linking CXX executable HelloWorld
> > ld: library not found for -lITKCommon
> > collect2: ld returned 1 exit status
> > make[2]: *** [HelloWorld] Error 1
> > make[1]: *** [CMakeFiles/HelloWorld.dir/all] Error 2
> > make: *** [all] Error 2
> >
> > What do I have to do to have the compiler find the ITKCommon library?
> >
>
> --
> View this message in context:
> http://old.nabble.com/Noob-question%2C-but-I-have-to-tp28219187p28219202.html
> Sent from the ITK - Users mailing list archive at Nabble.com.
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100415/0dc6e2d1/attachment.htm>


More information about the Insight-users mailing list