[Insight-users] Problem with VS 10 and itk 3.18.0

Md Rahman rahman at sfu.ca
Wed Apr 21 15:28:01 EDT 2010


Hi Luis,

 Thanks for your kind reply.

 Now I'm trying to use ITK version 3.16 and VS 9 (Visual C++ Express Edition 2008). And this time I'm successful with the 'Hello World' program. 

 But when I'm trying to configure the myProject.cxx program of 

http://www.itk.org/CourseWare/Training/GettingStarted-I.pdf    with CMake it shows me 

"Error in configuration process, project files may be invalid" in a pop-up message and shows me the following error in CMake---

"CMake Error in CMakeLists.txt:
  Cannot find source file "myProject.cpp".  Tried extensions .c .C .c++ .cc
  .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx


"   


  To tell in brief what I'm doing is--- creating a file in  VC++ for myProject.cpp with the code in the getting started document and creating a CMakeLists.txt file from the same document. Then creating  a new folder with only the myProject.cpp and CMakeLists.txt files and then trying to configure it with CMAKE.

  I'm attaching these two files.


 Any help to get rid of this tangle will be greatly appreciated.

 Thanks and Regards,

 Md. Mostafizur Rahman (Rajib)

 Department of Computing Science

 Simon Fraser University.
   






----- Original Message -----
From: "Luis Ibanez" <luis.ibanez at kitware.com>
To: "Md Rahman" <rahman at sfu.ca>
Cc: Insight-users at itk.org
Sent: Monday, April 19, 2010 3:24:13 PM GMT -08:00 US/Canada Pacific
Subject: Re: [Insight-users] Problem with VS 10 and itk 3.18.0


Hi Mostafizur, 


ITK (any version) does not support Visual Studio 10 yet. 


There were some structural changes made to Visual Studio 10, 
that require CMake to manage the configuration process in a 
way different from what is done with Visual Studio 9. 


We will have Visual Studio 10 support for ITK in our top priorities 
for the development cycle of ITK 3.19. 



Regards, 


Luis 



--------------------------------------------------------------------------------------- 

On Mon, Apr 19, 2010 at 4:42 PM, Md Rahman < rahman at sfu.ca > wrote: 


Hi , 

I was trying to compile the Hello World program using the latest version of ITK release and MS Visual Studio 10 trial version. Then I was getting the following error-- 
LINK : fatal error LNK1104: cannot open file "ITKCommon.lib" 

Every time I was building the project using only Debug mode. Then I realized that I had to open and compile the ITK.sln file from the binary directory. But when I tried to compile the ITK.sln, it fails to build and giving me errors like-- 

""" 

28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C2146: syntax error : missing ';' before identifier 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT' 
28> c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(636) : see reference to class template instantiation 'itk::hashtable<Value,Key,HashFcn,ExtractKey,EqualKey,Alloc>' being compiled 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C2433: 'itk::==' : 'friend' not permitted on data declarations 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C2365: 'itk::operator ==' : redefinition; previous definition was 'function' 
28> c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(354) : see declaration of 'itk::operator ==' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C2091: function returns function 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): warning C4183: 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT': missing return type; assumed to be a member function returning 'int' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(1154): error C2953: 'std::identity' : class template has already been defined 
28> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\utility(66) : see declaration of 'std::identity' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C2146: syntax error : missing ';' before identifier 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT' 
28> c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(230) : see reference to class template instantiation 'itk::hash_map<Key,T,HashFcn,EqualKey,Alloc>' being compiled 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C2433: 'itk::==' : 'friend' not permitted on data declarations 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C2365: 'itk::operator ==' : redefinition; previous definition was 'function' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C2091: function returns function 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): warning C4183: 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT': missing return type; assumed to be a member function returning 'int' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(292): error C2146: syntax error : missing ';' before identifier 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT' 
28> c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(327) : see reference to class template instantiation 'itk::hash_multimap<Key,T,HashFcn,EqualKey,Alloc>' being compiled 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(292): error C2433: 'itk::==' : 'friend' not permitted on data declarations 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(292): error C2365: 'itk::operator ==' : redefinition; previous definition was 'function' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(292): error C2091: function returns function 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(292): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(292): warning C4183: 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT': missing return type; assumed to be a member function returning 'int' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C2146: syntax error : missing ';' before identifier 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT' 
28> c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(138) : see reference to class template instantiation 'itk::hashtable<Value,Key,HashFcn,ExtractKey,EqualKey,Alloc>' being compiled 
28> with 
28> [ 
28> Value=std::pair<const unsigned long,unsigned long>, 
28> Key=unsigned long, 
28> HashFcn=itk::hash<unsigned long>, 
28> ExtractKey=std::select1st<std::pair<const unsigned long,unsigned long>>, 
28> EqualKey=std::equal_to<unsigned long>, 
28> Alloc=std::allocator<char> 
28> ] 
28> c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itkEquivalencyTable.h(61) : see reference to class template instantiation 'itk::hash_map<Key,T,HashFcn>' being compiled 
28> with 
28> [ 
28> Key=unsigned long, 
28> T=unsigned long, 
28> HashFcn=itk::hash<unsigned long> 
28> ] 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C2433: 'itk::==' : 'friend' not permitted on data declarations 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C2365: 'itk::operator ==' : redefinition; previous definition was 'function' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C2091: function returns function 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): warning C4183: 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT': missing return type; assumed to be a member function returning 'int' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C2146: syntax error : missing ';' before identifier 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C2433: 'itk::==' : 'friend' not permitted on data declarations 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C2365: 'itk::operator ==' : redefinition; previous definition was 'function' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C2091: function returns function 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): warning C4183: 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT': missing return type; assumed to be a member function returning 'int' 

""" 


And 

""" 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C2146: syntax error : missing ';' before identifier 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT' 
28> c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(636) : see reference to class template instantiation 'itk::hashtable<Value,Key,HashFcn,ExtractKey,EqualKey,Alloc>' being compiled 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C2433: 'itk::==' : 'friend' not permitted on data declarations 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C2365: 'itk::operator ==' : redefinition; previous definition was 'function' 
28> c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(354) : see declaration of 'itk::operator ==' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C2091: function returns function 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): warning C4183: 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT': missing return type; assumed to be a member function returning 'int' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(1154): error C2953: 'std::identity' : class template has already been defined 
28> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\utility(66) : see declaration of 'std::identity' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C2146: syntax error : missing ';' before identifier 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT' 
28> c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(230) : see reference to class template instantiation 'itk::hash_map<Key,T,HashFcn,EqualKey,Alloc>' being compiled 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C2433: 'itk::==' : 'friend' not permitted on data declarations 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C2365: 'itk::operator ==' : redefinition; previous definition was 'function' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C2091: function returns function 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): warning C4183: 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT': missing return type; assumed to be a member function returning 'int' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(292): error C2146: syntax error : missing ';' before identifier 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT' 
28> c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(327) : see reference to class template instantiation 'itk::hash_multimap<Key,T,HashFcn,EqualKey,Alloc>' being compiled 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(292): error C2433: 'itk::==' : 'friend' not permitted on data declarations 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(292): error C2365: 'itk::operator ==' : redefinition; previous definition was 'function' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(292): error C2091: function returns function 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(292): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(292): warning C4183: 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT': missing return type; assumed to be a member function returning 'int' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C2146: syntax error : missing ';' before identifier 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT' 
28> c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(138) : see reference to class template instantiation 'itk::hashtable<Value,Key,HashFcn,ExtractKey,EqualKey,Alloc>' being compiled 
28> with 
28> [ 
28> Value=std::pair<const unsigned long,unsigned long>, 
28> Key=unsigned long, 
28> HashFcn=itk::hash<unsigned long>, 
28> ExtractKey=std::select1st<std::pair<const unsigned long,unsigned long>>, 
28> EqualKey=std::equal_to<unsigned long>, 
28> Alloc=std::allocator<char> 
28> ] 
28> c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itkOneWayEquivalencyTable.h(61) : see reference to class template instantiation 'itk::hash_map<Key,T,HashFcn>' being compiled 
28> with 
28> [ 
28> Key=unsigned long, 
28> T=unsigned long, 
28> HashFcn=itk::hash<unsigned long> 
28> ] 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C2433: 'itk::==' : 'friend' not permitted on data declarations 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C2365: 'itk::operator ==' : redefinition; previous definition was 'function' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C2091: function returns function 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hashtable.h(474): warning C4183: 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT': missing return type; assumed to be a member function returning 'int' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C2146: syntax error : missing ';' before identifier 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C2433: 'itk::==' : 'friend' not permitted on data declarations 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C2365: 'itk::operator ==' : redefinition; previous definition was 'function' 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C2091: function returns function 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 
28>c:\users\rajib\documents\downloads\insighttoolkit-3.18.0\insighttoolkit-3.18.0\code\common\itk_hash_map.h(188): warning C4183: 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT': missing return type; assumed to be a member function returning 'int' 

""" 


The all other builds are successful. I'm quite new with ITK. So, I'm not quite sure whether I'm doing anything wrong, or the problem with the latest release of ITK, or with the latest realease of MS VS 10 (trial version). 


This is my first e-mail to this group and extremely sorry for such a weird one. 


Any help will be greatly appreciated. 

Thanks and Regards, 

Md. Mostafizur Rahman (Rajib) 
Department of Computing Science 
Simon Fraser University 

_____________________________________ 
Powered by www.kitware.com 

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html 

Kitware offers ITK Training Courses, for more information visit: 
http://www.kitware.com/products/protraining.html 

Please keep messages on-topic and check the ITK FAQ at: 
http://www.itk.org/Wiki/ITK_FAQ 

Follow this link to subscribe/unsubscribe: 
http://www.itk.org/mailman/listinfo/insight-users 

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: myProject.cpp
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100421/2b7dbe0d/attachment.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CMakeLists.txt
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100421/2b7dbe0d/attachment.txt>


More information about the Insight-users mailing list