[Insight-users] integrating the ITK libraries into external application with VC6
barbababa
tonimuusimaki at gmail.com
Fri Jun 24 19:23:07 EDT 2011
Hello all,
i have been banging my head to the wall with this problem for the last two
days and would
greatly appreciate any advice or help. I am using vc6 (no choice in this
one) and all i want
is to include some filters from ITK to another image application as
functions. I have an existing
vc6 project, which has all the correct links and dependencies related to
that other application, which i do not have the skills to chance. So i can
not use cmake with this one. When i try to include itkImage.h Into my cpp
file, i end up in endless fixing of the paths. (i did that half an hour...)
For example:
c:\itk\source\code\common\itkeventobject.h(151) : warning C4541:
'dynamic_cast' used on polymorphic type 'class itk::EventObject' with /GR-;
unpredictable behavior may result
c:\itk\source\utilities\vxl\core\vnl\vnl_matrix_ref.h(21) : fatal error
C1083: Cannot open include file: 'vnl/vnl_matrix.h': No such file or
directory
Error executing cl.exe.
So in my primitive mind, i therefore concluded, that the easiest for me,
would be just to make a header
file with cmake, something like:
# This is the root ITK CMakeLists file.
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND CMAKE_POLICY)
# This project is designed to be built outside the Insight source tree.
PROJECT(HelloWorld)
# Find ITK.
FIND_PACKAGE(ITK REQUIRED)
INCLUDE(${ITK_USE_FILE})
ADD_EXECUTABLE(HelloWorld HelloWorld.cxx
${CMAKE_CURRENT_BINARY_DIR}/HelloWorld.h)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/HelloWorld.h
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/HelloWorld.cxx
${CMAKE_CURRENT_BINARY_DIR}/HelloWorld.h
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/HelloWorld.cxx
)
TARGET_LINK_LIBRARIES(HelloWorld ITKCommon)
with a cxx file:
#include "itkImage.h"
int main ()
{
}
And include this to my project. But it does not work.
I also tried to combine the projects but without success...
The original helloworld example was working fine. (except the CMD just
"flashed" in and out... normal?)
Any help is much welcomed!!!!
Sincerely,
toni
--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/integrating-the-ITK-libraries-into-external-application-with-VC6-tp6513729p6513729.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.
More information about the Insight-users
mailing list