<b>Hello all,<br> <br> 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.<br>These are the errors:</b><br><br>1>..\..\src\readImage\readImage.cxx(17) : error C2598: linkage specification must be at global scope<br>
1>..\..\src\readImage\readImage.cxx(17) : warning C4518: 'const int ' : storage-class or type specifier(s) unexpected here; ignored<br>1>..\..\src\readImage\readImage.cxx(17) : warning C4502: 'linkage specification' requires use of keyword 'extern' and must precede all other specifiers<br>
1>..\..\src\readImage\readImage.cxx(17) : error C2537: 'football.jpg' : illegal linkage specification<br>1>..\..\src\readImage\readImage.cxx(17) : error C2513: 'int' : no variable declared before '='<br>
1>Build log was saved at "file://w:\Registration_Review\bin\readImage\readImage.dir\Debug\BuildLog.htm"<br>1>readImage - 3 error(s), 2 warning(s)<br>2>------ Build started: Project: ALL_BUILD, Configuration: Debug x64 ------<br>
2>"Build all projects"<br>2>Build log was saved at "file://w:\Registration_Review\bin\readImage\ALL_BUILD.dir\Debug\BuildLog.htm"<br>2>ALL_BUILD - 0 error(s), 0 warning(s)<br>========== Build: 1 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========<br>
<br><b>CMake Lists.txt that I use is:</b><br><br># This project is designed to be built outside the Insight source tree.<br><br>PROJECT(readImage)<br><br># Find ITK<br><br>INCLUDE_REGULAR_EXPRESSION("^.*$")<br><br>
FIND_PACKAGE(ITK REQUIRED)<br><br>IF(ITK_FOUND)<br> INCLUDE(${ITK_USE_FILE})<br>ENDIF(ITK_FOUND)<br><br>ADD_EXECUTABLE(readImage readImage.cxx )<br><br>TARGET_LINK_LIBRARIES(readImage ITKIO)<br><br><br><b>And file *.cxx is: </b><br>
<br><br>#if defined(_MSC_VER)<br>#pragma warning ( disable : 4786 )<br>#endif<br><br>#include "itkImage.h"<br>#include "itkImageFileReader.h"<br><br>int main( int , int argv[1])<br>{<br> typedef unsigned int PixelType;<br>
const unsigned int Dimension = 3;<br><br> typedef itk::Image< PixelType, Dimension > ImageType;<br> typedef itk::ImageFileReader< ImageType > ReaderType;<br><br> ReaderType::Pointer reader = ReaderType::New();<br>
const int "football.jpg" = argv[1];<br> reader->SetFileName("football.jpg");<br> reader->Update();<br> ImageType::Pointer image = reader->GetOutput();<br><br> return 0;<br>}<br><br><b>thanks in advance to all those who can help me with this problem because I am just a novice in this language programming </b><br>
-- <br><br>Leidy Paola Dorado-Muņoz<br>