SYMPTOM:
When attempting to compile a custom Export executable on Windows, and following the steps in the on-line Ansys CFX documentation, errors similar to the following are generated at the link stage and the compilation fails:

Linking...
libmeshexport.lib(cfxExport.o) : error LNK2001: unresolved external symbol _pgtCloseAPI
libmeshexport.lib(cfxExport.o) : error LNK2001: unresolved external symbol _pgtLastError
libmeshexport.lib(cfxExport.o) : error LNK2001: unresolved external symbol _pgtLoadCCL
libmeshexport.lib(cfxExport.o) : error LNK2001: unresolved external symbol _pgtOpenAPI
libmeshexport.lib(cfxExport.o) : error LNK2001: unresolved external symbol _pgtDomainRotationVelocity
...
...
Release/CFXExport2.exe : fatal error LNK1120: 12 unresolved externals
Error executing link.exe.

Similar errors are produced when attempting to compile on Unix platforms.

PROBLEM:
The documentation fails to mention the full list of library files which must be included when compiling any custom Export programs.


WORKAROUND:
Make sure that the 'pgtapi' and 'units' libraries are added to the list to link against when compiling.

On Unix, use the following command line:

cc <source_file>.c -o <target_file>.exe -I<install_dir>/include -L<install_dir>/lib/<os_dir> -lmeshexport -lio -lm -lpgtapi -lunits -lc -lcclapilt

On Windows, using Microsoft Visual C/C++ V6.0, when selecting libraries to add to the project (using Project>Add to Project>Files) make sure you also include the libraries:

<install_dir>liblibpgtapi.lib
<install_dir>libMSWin32-86-perlioautoCFX5UnitsUnits.lib

FIXED IN:
Release 11.0.





Show Form
No comments yet. Be the first to add a comment!