82. NX二次开发编译报错:error LNK2019: 无法解析的外部符号 "...
82. NX二次开发编译报错:error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public:情景描述:
我们在创建和编译链接的时候已经添加了库:
libufun.lib
libugopenint.lib
libnxopencpp.lib
libnxopenuicpp.lib
错误如下:
1>------ 已启动生成: 项目: plmhomeToolKits, 配置: Debug x64 ------
1> 正在创建库 C:\PLMHomeToolkits\plmhomeToolKits\x64\Debug\/plmhomeToolKits.lib 和对象 C:\PLMHomeToolkits\plmhomeToolKits\x64\Debug\/plmhomeToolKits.exp
1>plmhomeToolkits_splitProduct.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl NXOpen::Assemblies::CreateNewComponentBuilder::SetDefiningObjectsAdded(bool)" (__imp_?SetDefiningObjectsAdded@CreateNewComponentBuilder@Assemblies@NXOpen@@QEAAX_N@Z),该符号在函数 "public: int __cdecl plmhomeToolKits_splitProduct::createNewComponent(void)" (?createNewComponent@plmhomeToolKits_splitProduct@@QEAAHXZ) 中被引用
1>plmhomeToolkits_splitProduct.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl NXOpen::Assemblies::CreateNewComponentBuilder::SetNewComponentName(class NXOpen::NXString const &)" (__imp_?SetNewComponentName@CreateNewComponentBuilder@Assemblies@NXOpen@@QEAAXAEBVNXString@3@@Z),该符号在函数 "public: int __cdecl plmhomeToolKits_splitProduct::createNewComponent(void)" (?createNewComponent@plmhomeToolKits_splitProduct@@QEAAHXZ) 中被引用
1>plmhomeToolkits_splitProduct.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl NXOpen::Assemblies::CreateNewComponentBuilder::SetReferenceSet(enum NXOpen::Assemblies::CreateNewComponentBuilder::ComponentReferenceSetType)" (__imp_?SetReferenceSet@CreateNewComponentBuilder@Assemblies@NXOpen@@QEAAXW4ComponentReferenceSetType@123@@Z),该符号在函数 "public: int __cdecl plmhomeToolKits_splitProduct::createNewComponent(void)" (?createNewComponent@plmhomeToolKits_splitProduct@@QEAAHXZ) 中被引用
1>plmhomeToolkits_splitProduct.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl NXOpen::Assemblies::CreateNewComponentBuilder::SetReferenceSetName(class NXOpen::NXString const &)" (__imp_?SetReferenceSetName@CreateNewComponentBuilder@Assemblies@NXOpen@@QEAAXAEBVNXString@3@@Z),该符号在函数 "public: int __cdecl plmhomeToolKits_splitProduct::createNewComponent(void)" (?createNewComponent@plmhomeToolKits_splitProduct@@QEAAHXZ) 中被引用
1>plmhomeToolkits_splitProduct.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl NXOpen::Assemblies::CreateNewComponentBuilder::SetLayerOption(enum NXOpen::Assemblies::CreateNewComponentBuilder::ComponentLayerOptionType)" (__imp_?SetLayerOption@CreateNewComponentBuilder@Assemblies@NXOpen@@QEAAXW4ComponentLayerOptionType@123@@Z),该符号在函数 "public: int __cdecl plmhomeToolKits_splitProduct::createNewComponent(void)" (?createNewComponent@plmhomeToolKits_splitProduct@@QEAAHXZ) 中被引用
1>plmhomeToolkits_splitProduct.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl NXOpen::Assemblies::CreateNewComponentBuilder::SetLayerNumber(int)" (__imp_?SetLayerNumber@CreateNewComponentBuilder@Assemblies@NXOpen@@QEAAXH@Z),该符号在函数 "public: int __cdecl plmhomeToolKits_splitProduct::createNewComponent(void)" (?createNewComponent@plmhomeToolKits_splitProduct@@QEAAHXZ) 中被引用
1>plmhomeToolkits_splitProduct.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl NXOpen::Assemblies::CreateNewComponentBuilder::SetComponentOrigin(enum NXOpen::Assemblies::CreateNewComponentBuilder::ComponentOriginType)" (__imp_?SetComponentOrigin@CreateNewComponentBuilder@Assemblies@NXOpen@@QEAAXW4ComponentOriginType@123@@Z),该符号在函数 "public: int __cdecl plmhomeToolKits_splitProduct::createNewComponent(void)" (?createNewComponent@plmhomeToolKits_splitProduct@@QEAAHXZ) 中被引用
1>plmhomeToolkits_splitProduct.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl NXOpen::Assemblies::CreateNewComponentBuilder::SetNewFile(class NXOpen::FileNew *)" (__imp_?SetNewFile@CreateNewComponentBuilder@Assemblies@NXOpen@@QEAAXPEAVFileNew@3@@Z),该符号在函数 "public: int __cdecl plmhomeToolKits_splitProduct::createNewComponent(void)" (?createNewComponent@plmhomeToolKits_splitProduct@@QEAAHXZ) 中被引用
1>plmhomeToolkits_splitProduct.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class NXOpen::Assemblies::CreateNewComponentBuilder * __cdecl NXOpen::Assemblies::AssemblyManager::CreateNewComponentBuilder(void)" (__imp_?CreateNewComponentBuilder@AssemblyManager@Assemblies@NXOpen@@QEAAPEAV023@XZ),该符号在函数 "public: int __cdecl plmhomeToolKits_splitProduct::createNewComponent(void)" (?createNewComponent@plmhomeToolKits_splitProduct@@QEAAHXZ) 中被引用
1>C:\PLMHomeToolkits\plmhomeToolKits\x64\Debug\\plmhomeToolKits.dll : fatal error LNK1120: 9 个无法解析的外部命令
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
解决方案:
**** Hidden Message *****
范德萨范德萨范德萨 看看怎解决的 这问题真的好头疼啊。。。 好帖子,顶 :P有啥方法解决 遇到了同样的问题,看看有没有解决 看一看,急需
合法化,终于看到正确版本了 合法化,终于看到正确版本了