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

Md Rahman rahman at sfu.ca
Mon Apr 19 16:42:04 EDT 2010


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
 


More information about the Insight-users mailing list