renie2015 发表于 2016-6-4 23:49:15

fatal error LNK1120: 6 个无法解析的外部命令怎么解决?

完全按照NX9.0二次开发实例 6 使用NXOpen CPP创建圆柱.来做的。却出现了错误
1>------ 已启动全部重新生成: 项目: NX9 Open Wizard1, 配置: Debug x64 ------
1>cl : 命令行 warning D9038: 此平台上不支持 /ZI;请启用 /Zi
1>cl : 命令行 warning D9007: “/Gm”需要“/Zi”;选项被忽略
1>NX9 Open Wizard1.cpp
1>   正在创建库 I:\ug\My_directory\visual studio 2012\NX9 Open Wizard1\x64\Debug\/NX9 Open Wizard1.lib 和对象 I:\ug\My_directory\visual studio 2012\NX9 Open Wizard1\x64\Debug\/NX9 Open Wizard1.exp
1>NX9 Open Wizard1.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class NXOpen::Features::Feature * __cdecl NXOpen::Features::FeatureBuilder::CommitFeature(void)" (__imp_?CommitFeature@FeatureBuilder@Features@NXOpen@@QEAAPEAVFeature@23@XZ),该符号在函数 ufsta 中被引用
1>NX9 Open Wizard1.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class NXOpen::Expression * __cdecl NXOpen::Features::CylinderBuilder::Diameter(void)" (__imp_?Diameter@CylinderBuilder@Features@NXOpen@@QEAAPEAVExpression@3@XZ),该符号在函数 ufsta 中被引用
1>NX9 Open Wizard1.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class NXOpen::Expression * __cdecl NXOpen::Features::CylinderBuilder::Height(void)" (__imp_?Height@CylinderBuilder@Features@NXOpen@@QEAAPEAVExpression@3@XZ),该符号在函数 ufsta 中被引用
1>NX9 Open Wizard1.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl NXOpen::Features::CylinderBuilder::SetOrigin(struct NXOpen::Point3d const &)" (__imp_?SetOrigin@CylinderBuilder@Features@NXOpen@@QEAAXAEBUPoint3d@3@@Z),该符号在函数 ufsta 中被引用
1>NX9 Open Wizard1.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __cdecl NXOpen::Features::CylinderBuilder::SetDirection(struct NXOpen::Vector3d const &)" (__imp_?SetDirection@CylinderBuilder@Features@NXOpen@@QEAAXAEBUVector3d@3@@Z),该符号在函数 ufsta 中被引用
1>NX9 Open Wizard1.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class NXOpen::Features::CylinderBuilder * __cdecl NXOpen::Features::FeatureCollection::CreateCylinderBuilder(class NXOpen::Features::Feature *)" (__imp_?CreateCylinderBuilder@FeatureCollection@Features@NXOpen@@QEAAPEAVCylinderBuilder@23@PEAVFeature@23@@Z),该符号在函数 ufsta 中被引用
1>I:\ug\My_directory\visual studio 2012\NX9 Open Wizard1\x64\Debug\/NX9 Open Wizard1.dll : fatal error LNK1120: 6 个无法解析的外部命令
========== 全部重新生成: 成功 0 个,失败 1 个,跳过 0 个 ==========





我把开头的都加进来了
#if ! defined ( __hp9000s800 ) && ! defined ( __sgi ) && ! defined ( __sun )
#   include <strstream>
#   include <iostream>
    using std::ostrstream;
    using std::endl;   
    using std::ends;
    using std::cerr;
#else
#   include <strstream.h>
#   include <iostream.h>
#endif
#include <uf.h>
#include <uf_ui.h>
#include <uf_exit.h>
#include <uf_defs.h>
#include <NXOpen/NXException.hxx>
#include <NXOpen/Session.hxx>
#include <NXOpen/Axis.hxx>
#include <NXOpen/BasePart.hxx>
#include <NXOpen/Body.hxx>
#include <NXOpen/Builder.hxx>
#include <NXOpen/Direction.hxx>
#include <NXOpen/DirectionCollection.hxx>
#include <NXOpen/Expression.hxx>
#include <NXOpen/ExpressionCollection.hxx>
#include <NXOpen/Features_CylinderBuilder.hxx>
#include <NXOpen/Features_FeatureCollection.hxx>
#include <NXOpen/GeometricUtilities_BooleanOperation.hxx>
#include <NXOpen/NXObject.hxx>
#include <NXOpen/Part.hxx>
#include <NXOpen/PartCollection.hxx>
#include <NXOpen/Point.hxx>
#include <NXOpen/PointCollection.hxx>
#include <NXOpen/Preferences_PartModeling.hxx>
#include <NXOpen/Preferences_PartPreferences.hxx>
#include <NXOpen/Scalar.hxx>
#include <NXOpen/ScalarCollection.hxx>
#include <NXOpen/SelectICurve.hxx>
#include <NXOpen/SelectObject.hxx>
#include <NXOpen/Session.hxx>
#include <NXOpen/TaggedObject.hxx>
#include <NXOpen/Unit.hxx>

我点代码的时候还有定义啊

这个到底该怎么解决啊

admin 发表于 2016-6-5 07:25:30

库不全,加其他的库

renie2015 发表于 2016-6-5 09:45:22

所有都加进去啊?

renie2015 发表于 2016-6-5 09:58:38

按照大哥所说的。。成功了。。我把所有的库都加进去了libufun.lib
libufun_cae.lib
libnxopencpp.lib
libugopenint.lib
libugopenint_cae.lib
libnxopenuicpp.lib
libvmathpp.lib
libugopenint_cae.lib
libugopenint.lib
libufun_cae.lib
libufun.lib
libopenpp.lib
libopenintpp.lib
libnxopenuicpp.lib
libnxopencpp_weld.lib
libnxopencpp_visualreporting.lib
libnxopencpp_validate.lib
libnxopencpp_userdefinedobjects.lib
libnxopencpp_tooling.lib
libnxopencpp_sim.lib
libnxopencpp_sheetmetal.lib
libnxopencpp_shapesearch.lib
libnxopencpp_routing.lib
libnxopencpp_preferences.lib
libnxopencpp_positioning.lib
libnxopencpp_physmat.lib
libnxopencpp_pdm.lib
libnxopencpp_partfamily.lib
libnxopencpp_options.lib
libnxopencpp_optimization.lib
libnxopencpp_motion.lib
libnxopencpp_modldirect.lib
libnxopencpp_mechatronics.lib
libnxopencpp_layout2d.lib
libnxopencpp_layer.lib
libnxopencpp_issue.lib
libnxopencpp_geometricutilities.lib
libnxopencpp_geometricanalysis.lib
libnxopencpp_gateway.lib
libnxopencpp_formboard.lib
libnxopencpp_fields.lib
libnxopencpp_features.lib
libnxopencpp_facet.lib
libnxopencpp_drawings.lib
libnxopencpp_drafting.lib
libnxopencpp_display.lib
libnxopencpp_die.lib
libnxopencpp_cam.lib
libnxopencpp_cae.lib
libnxopencpp_bodydes.lib
libnxopencpp_assemblies.lib
libnxopencpp_annotations.lib
libnxopencpp.lib

KutouAi 发表于 2017-12-6 22:29:43

专门申请了个账号来感谢楼主以及管理员。这个问题困扰了我好几天了。之前一直死扣dll连接的问题,以为引用4个基本的dll就够了,没想到是因为没引用全。终于解决了哈哈。

admin 发表于 2017-12-7 09:09:42

KutouAi 发表于 2017-12-6 14:29
专门申请了个账号来感谢楼主以及管理员。这个问题困扰了我好几天了。之前一直死扣dll连接的问题,以为引用4 ...

这是基本的问题,很常见,看看视频,一劳永逸的方法就是全加进去
页: [1]
查看完整版本: fatal error LNK1120: 6 个无法解析的外部命令怎么解决?