Saturday, August 3, 2013

Teamcenter 9.1: Compiling Issues

Symptom:
------ Build started: Project: Phi4_BOMExport, Configuration: Debug Win32 ------
Compiling...
cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release
Phi4_BOMExport.cxx
Linking...
C:\Program Files\Siemens\TC9\Teamcenter9\lib\itk_main.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
Build log was saved at "file://c:\Users\Admin\Desktop\Bom List all child\Phi4_BOMExport\Phi4_BOMExport\Debug\BuildLog.htm"
Phi4_BOMExport - 1 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Symptom:
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__CUSTOM_register_exit referenced in function
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__EPM_register_action_handler referenced in function
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__tc_strcpy referenced in function
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__MEM_alloc referenced in function
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__SA_ask_groupmember_role referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__CR_ask_decision referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__CR_ask_reviewers referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__AE_import_named_ref referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__AOM_refresh referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__GRM_save_relation referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__GRM_create_relation referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__AOM_lock referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__AOM_save referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__AE_create_dataset_with_id referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__tc_strcat referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__AE_find_datasettype referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__AOM_ask_value_date referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__SA_ask_person_email_address referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__SA_ask_person_attr referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__SA_ask_role_description referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__SA_ask_current_role referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__SA_find_person referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__PROJ_ask_name referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__PROJ_find referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__ITEM_ask_rev_type referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__AOM_ask_name referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__AE_ask_dataset_named_refs referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__GRM_list_secondary_objects_only referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__GRM_find_relation_type referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__ITEM_ask_latest_rev referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__ITEM_find_item referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__AOM_ask_value_string referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__EPM_ask_attachments referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__EPM_ask_root_task referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__TC_write_syslog referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__EMH_ask_error_text referenced in function  
PDFGenerator.obj : error LNK2019: unresolved external symbol __imp__EPM_ask_job referenced in function  
C:\Users\Admin\Documents\Visual Studio 2008\Projects\PDFGenerator\Debug\PDFGenerator.dll : fatal error LNK1120: 37 unresolved externals

Description: The error is telling you that the linker has been run with a target that specifies x64 while the module the linker is reading was created for x86. What's wrong depends on what you are trying to do.
If you are trying to create an x64 code file then the linker target is correct and the module is wrong. If you are trying to create an x86 code file then the linker target is wrong and the module is correct.
Whichever item is wrong is the one you have to correct - either by changing the linker target or by changing the module. If the module is wrong you probably ended up compiling it with the x86 version of the compiler rather than the x64 version.
So the libraries of Teamcenter 9 are not compatible with the 64 bit ver of compiler that we used to compile for earlier version of Teamcenter.
Solution:
1. Install X64 compilers.
2. Restart your machine and set the command shown.

3. Compile using compile.bat. 

4. Link using link_custom_exits.bat.

2 comments:

  1. any ideas how to configure this in visual studio

    ReplyDelete
  2. Hello Rakesh,

    In "Configuration Manager", change "Active Solution Platform" to x64 and build.

    Regards
    Bharat

    ReplyDelete