[Insight-users] Problems reading an image

Leidy Paola Dorado Muñoz doradoleidypao at gmail.com
Wed Nov 12 10:12:44 EST 2008


*Hello  all,

I'm starting to work with ITK and I'm trying to read an image (*.jpg)  but
some errors occur when I build all project.
These are the errors:*

1>..\..\src\readImage\readImage.cxx(17) : error C2598: linkage specification
must be at global scope
1>..\..\src\readImage\readImage.cxx(17) : warning C4518: 'const int ' :
storage-class or type specifier(s) unexpected here; ignored
1>..\..\src\readImage\readImage.cxx(17) : warning C4502: 'linkage
specification' requires use of keyword 'extern' and must precede all other
specifiers
1>..\..\src\readImage\readImage.cxx(17) : error C2537: 'football.jpg' :
illegal linkage specification
1>..\..\src\readImage\readImage.cxx(17) : error C2513: 'int' : no variable
declared before '='
1>Build log was saved at
"file://w:\Registration_Review\bin\readImage\readImage.dir\Debug\BuildLog.htm"
1>readImage - 3 error(s), 2 warning(s)
2>------ Build started: Project: ALL_BUILD, Configuration: Debug x64 ------
2>"Build all projects"
2>Build log was saved at
"file://w:\Registration_Review\bin\readImage\ALL_BUILD.dir\Debug\BuildLog.htm"
2>ALL_BUILD - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

*CMake Lists.txt that I use is:*

# This project is designed to be built outside the Insight source tree.

PROJECT(readImage)

# Find ITK

INCLUDE_REGULAR_EXPRESSION("^.*$")

FIND_PACKAGE(ITK REQUIRED)

IF(ITK_FOUND)
  INCLUDE(${ITK_USE_FILE})
ENDIF(ITK_FOUND)

ADD_EXECUTABLE(readImage readImage.cxx )

TARGET_LINK_LIBRARIES(readImage ITKIO)


*And file *.cxx is: *


#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif

#include "itkImage.h"
#include "itkImageFileReader.h"

int main( int , int argv[1])
{
  typedef unsigned int          PixelType;
  const unsigned int            Dimension = 3;

  typedef itk::Image< PixelType, Dimension > ImageType;
  typedef itk::ImageFileReader< ImageType >  ReaderType;

  ReaderType::Pointer reader = ReaderType::New();
  const int "football.jpg" = argv[1];
  reader->SetFileName("football.jpg");
  reader->Update();
  ImageType::Pointer image = reader->GetOutput();

  return 0;
}

*thanks in advance to all those who can help me with this problem because I
am just a novice in this language programming *
-- 

Leidy Paola Dorado-Muñoz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20081112/70f40c6d/attachment-0011.htm>


More information about the Insight-users mailing list