[IGSTK-Users] PolarisTrackerExample Linking Error
Patrick Cheng
patrick.p.cheng at gmail.com
Wed Aug 3 16:14:22 EDT 2011
Hi Jiwon Jamie Ryu,
Try to include this in your CMakeLists.txt
FIND_PACKAGE (ITK)
IF (ITK_FOUND)
INCLUDE (${ITK_USE_FILE})
ELSE (ITK_FOUND)
MESSAGE (FATAL_ERROR "Need ITK.")
ENDIF (ITK_FOUND)
Patrick
On Tue, Aug 2, 2011 at 10:17 AM, Jiwon Jamie Ryu
<jjamieryu at melab.snu.ac.kr>wrote:
> Hi all.
>
> I'm trying to set up a new solution regarding Polaris tracker, and I'm
> trying to use the functions that are in PolarisTracker.cxx in IGSTKSandbox
> example.
> So I start up with writing CMakeLists.txt shown as below.
> Then, I used Cmake to configure and generate a solution. (Code added is
> the ones that I have written for other program and I'm trying to combine
> everything that I've got.)
> But when I compile the solution, I keep getting about 400 errors as:
>
>
> 1>IGSTKSandbox.lib(igstkTracker.obj) : error LNK2001:
> "__declspec(dllimport) public: unsigned long __thiscall
> itk::Object::AddObserver(class itk::EventObject const &,class itk::Command
> *)" (__imp_?AddObserver at Object@itk@@QAEKABVEventObject at 2@PAVCommand at 2@@Z)
> 1>IGSTKSandbox.lib(igstkTrackerTool.obj) : error LNK2001:
> "__declspec(dllimport) public: unsigned long __thiscall
> itk::Object::AddObserver(class itk::EventObject const &,class itk::Command
> *)" (__imp_?AddObserver at Object@itk@@QAEKABVEventObject at 2@PAVCommand at 2@@Z)
> 1>IGSTKSandbox.lib(igstkCoordinateSystemDelegator.obj) : error LNK2001:
> "__declspec(dllimport) public: unsigned long __thiscall
> itk::Object::AddObserver(class itk::EventObject const &,class itk::Command
> *)" (__imp_?AddObserver at Object@itk@@QAEKABVEventObject at 2@PAVCommand at 2@@Z)
>
> I'm thinking it relates to IGSTKSandbox Linking problem, but I don't know
> what.
> Please help me out.
> Thanks.
>
> Jamie.
> ========================================
> INCLUDE (${IGSTK_USE_FILE} )
> ELSE (IGSTK_USE_FILE)
> MESSAGE( FATAL_ERROR "This application requires IGSTK. One of these
> components is missing. Please verify configuration")
> ENDIF (IGSTK_USE_FILE)
>
>
> INCLUDE_DIRECTORIES(
> ${IGSTKSandbox_SOURCE_DIR}/IGSTK/Source
> ${IGSTKSandbox_SOURCE_DIR}/Source
> ${IGSTKSandbox_BINARY_DIR}
> ${IGSTKSandbox_BINARY_DIR}/SourceLatest
> )
>
> IF(WIN32)
> LINK_LIBRARIES(
> AdeptTcpServer
> IGSTKSandbox
> )
> ENDIF(WIN32)
> INCLUDE_DIRECTORIES(./)
> INCLUDE_DIRECTORIES(./PolarisHandler)
> #INCLUDE_DIRECTORIES(E:/TK/IGSTKBIN2)
> INCLUDE_DIRECTORIES(E:/TK/Sandbox-4-4/Sandbox-4.4)
> #
> # This option enables the scene graph observer to collect relavant events
> to constuct the scene graph tree
> #
> OPTION(IGSTK_USE_SceneGraphVisualization "Enable scene graph visualization
> by allowing the observer to listen to
> relevant events" ON)
> IF(IGSTK_USE_SceneGraphVisualization)
> INCLUDE_DIRECTORIES(
> ${IGSTKSandbox_SOURCE_DIR}/Utilities/SceneGraphVisualization)
> ENDIF(IGSTK_USE_SceneGraphVisualization)
>
>
> SET(Adept_SRC
> RobotTestV1.rc
> AdeptServerTest.cpp
> RobotTestV1.cpp
> RobotTestV1Dlg.cpp
> stdafx.cpp
> )
> SET(Adept_HRD
> AdeptServerTest.h
> AdeptTcpServer.h
> resource.h
> RobotTestV1.h
> RobotTestV1Dlg.h
> stdafx.h
> targetver.h
> )
> SET(Polaris_SRC
> PolarisTracker.cxx
> )
> SET(PolarisHandler
> ./PolarisHandler/APIStructures.h
> ./PolarisHandler/Comm32.cpp
> ./PolarisHandler/Comm32.h
> ./PolarisHandler/CommandConstruction.cpp
> ./PolarisHandler/CommandHandling.cpp
> ./PolarisHandler/CommandHandling.h
> ./PolarisHandler/Conversions.cpp
> ./PolarisHandler/Conversions.h
> ./PolarisHandler/Conversions.cpp
> ./PolarisHandler/Conversions.h
> ./PolarisHandler/INIFileRW.cpp
> ./PolarisHandler/INIFileRW.h
> ./PolarisHandler/MELAB_PolarisHandler.cpp
> ./PolarisHandler/MELAB_PolarisHandler.h
> ./PolarisHandler/SystemCRC.cpp
> )
>
> ADD_EXECUTABLE(Polaris_Robot WIN32 ${Adept_SRC} ${Adept_HRD} ${Polaris_SRC}
> ${PolarisHandler})
> TARGET_LINK_LIBRARIES(Polaris_Robot IGSTKSandbox)
> ==============================================
> *-----------------------------------------------------------------*
> * Jiwon Jamie Ryu**
> *
> **
> **
> * PhD Candidate*
> Dept. Bioengineering
> Seoul National University
> TEL: +82 10 8868 3678
> Office: +82 2 2072 3128
> *-------------------------------------------------------*-------------
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/igstk-users/attachments/20110803/8476047d/attachment.html>
More information about the IGSTK-Users
mailing list