Cancel
Showing results for 
Search instead for 
Did you mean: 

linker error itk_main.obj in visual studio 2015

Experimenter
Experimenter

Hi I am newbie to Teamcenter and IDK , getting this error while creating a itk project in vc++ in visual studio 2015 but in vs 2012 it is working fine

 

 

 

Please help me with this

 

Hi I am newbie to Teamcenter and IDK , getting this error while creating a itk project in vc++ in visual studio 2015 but in vs 2012 it is working fine

 

 

 

Please help me with this

 

 Severity Code Description Project File Line Suppression State
Warning LNK4098 defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library ITKFirst C:\Users\***************\documents\visual studio 2015\Projects\TC\ITK\ITKFirst\ITKFirst\LINK 1
Error LNK2019 unresolved external symbol __imp___iob_func referenced in function __catch$main$0 ITKFirst C:\Users\***************\documents\visual studio 2015\Projects\TC\ITK\ITKFirst\ITKFirst\itk_main.obj 1
Error LNK2019 unresolved external symbol __imp_fprintf referenced in function __catch$main$0 ITKFirst C:\Users\***************\documents\visual studio 2015\Projects\TC\ITK\ITKFirst\ITKFirst\itk_main.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) char const * __cdecl std::_Winerror_map(int)" (__imp_?_Winerror_map@std@@YAPEBDH@Z) referenced in function "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std::_System_error_category::message(int)const " (?message@_System_error_category@std@@UEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@H@Z) ITKFirst C:\Users\***************\documents\visual studio 2015\Projects\TC\ITK\ITKFirst\ITKFirst\itk_main.obj 1
Error LNK2019 unresolved external symbol _XcptFilter referenced in function "int __cdecl ERRORXX_filter_exception(int,struct _EXCEPTION_POINTERS *)" (?ERRORXX_filter_exception@@YAHHPEAU_EXCEPTION_POINTERS@@@Z) ITKFirst C:\Users\***************\documents\visual studio 2015\Projects\TC\ITK\ITKFirst\ITKFirst\itk_main.obj 1
Error LNK1120 4 unresolved externals ITKFirst C:\Users\***************\documents\visual studio 2015\Projects\TC\ITK\ITKFirst\x64\Debug\ITKFirst.exe 1

 

5 REPLIES

Re: linker error itk_main.obj in visual studio 2015

Genius
Genius

Show your example code.

 

This error probably mean that you use classic main() function but have  itk_main.obj in <inputs> field in your project settings or check subsystem field in project settings (need to be <Console>)

 

If you use ITK_user_main() then you need itk_main.obj in project settings -> Linker->inputs

 

If you use classic main() as entry point then itk_main.obj not needed.Also ITK_init_from_cpp() call needed in main()

Re: linker error itk_main.obj in visual studio 2015

Experimenter
Experimenter

Hi,

same error comes to me when compiling Visual studio 2008 code in Visual studio 2012.

Please give the hint if you already solved it.

Re: linker error itk_main.obj in visual studio 2015

Genius
Genius

Ramalingam wrote:

Hi,

same error comes to me when compiling Visual studio 2008 code in Visual studio 2012.

Please give the hint if you already solved it.


Read my post above. What code are you compiling?With itk_user_main as entry point or classic main()?

LNK2019mean that some .lib files is missing in your project settings

Re: linker error itk_main.obj in visual studio 2015

Hello RohithM,

 

Use Visual Studio up to 2012 when using ITK under Teamcenter 10. Some changes in base inline functions have made libraries compiled with vs2010 unlinkable under vs2015 unless you are able to change the source code headers.

 

Regards

Re: linker error itk_main.obj in visual studio 2015

Legend
Legend

It's generally a bad idea to mix .objs/.dlls//.libs/etc. compiled from multiple visual studio versions. This can lead to all sorts of problems. If you are lucky, you will catch these conflicts at compilation time. Otherwise these errors manifest themselves at run-time (mostly in crashes).

 

Look at the Teamcenter documentation to see which Visual Studio version is recommended for the Teamcenter version that you are using to run your customization against. Stick to that version of Visual Studio for compiling your code.

 

Check this article that I wrote few years ago...

http://siomsystems.com/mixing-visual-studio-versions/

---

Thanks and Regards

Yogesh Fegade