title: symbol(s) not found for architecture x86_64 os x lion
body: <p>When trying to compile a simple c++ test.cpp code with opencv 2.3.1 as as third
  library, I get the following error message:</p>
  
  <blockquote>
    <p>Undefined symbols for architecture x86_64:</p>
     "_cvLoadImage", referenced from: </p>
         _main in test.cpp.o </p>
    ld: symbol(s) not found for architecture x86_64 </p></p>
  </blockquote>
  
  <p>For info, am using CMake for linking, and gcc 4.2.1 i686-apple-darwin11
  obtained from Xcode 4.2. OpenCV had been installed using CMake:</p>
  ccmake ../sourcecode </p>
  
  <p>Note please that I get a similar message when trying to compile SoQt
  (coin3D), after commands ./configure &amp; sudo make:</p></p>
  
  <blockquote>
    <p>. 
    .
    . </p>
    "typeinfo for QWidget", referenced from:
         typeinfo for SoQtThumbWheelin SoQtThumbWheel.o
     "QWidget::staticMetaObject", referenced from:
         SoQtThumbWheel::staticMetaObject        in SoQtThumbWheel.o </p>
    ld: symbol(s) not found for architecture x86_64 </p>
    collect2: ld returned 1 exit status</p>
  </blockquote>
  
  <p>The CMakeLists.txt of the main project is: </p></p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8)    
  PROJECT(TOTO )
  
  FIND_PACKAGE(OpenCV)
  
  INCLUDE_DIRECTORIES(${TOTO_SOURCE_DIR}/src/control)
  
  SET(ALL_LIB_RAF  ${OPENCV_LIBRARIES}             
           Hello
            )
  
  # FILEs to consider
  ADD_SUBDIRECTORY(main) 
  ADD_SUBDIRECTORY( src )
  </code></pre>
  
  <p>While the CMakeLists.txt for test.cpp is:</p></p>
  
  <pre><code>ADD_EXECUTABLE(helloWorld test)
  TARGET_LINK_LIBRARIES(helloWorld ${ALL_LIB_RAF} )
  </code></pre>
  
  <p>Perhaps the issue consists in the fact that OpenCV needs to be compiled in 64-bit (?). I found an interesting <a href="https://stackoverflow.com/questions/5781198/compiling-opencv-code-on-a-64-bit-mac">link</a>. But am wondering how that mights be applied to CMake. </p>
  
  <p>Any help please? </p>
  Thanks.</p>