opnet+vs2019安装过程
远古教程很多是VS2008,或VS2010配置的环境,不会现在还会有人继续用吧。
首先安装VS2019,安装C++的开发调试包。
把Windows下的C++包都装上。
然后添加环境变量path,lib,include。
include
D:\visual studio\VC\Tools\MSVC\14.28.29333\include;
D:\opnet\14.5.A\sys\include;
D:\opnet\14.5.A\models\std\include;
D:\visual studio\VC\Tools\MSVC\14.28.29333\atlmfc\include;
D:\visual studio\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-3.18\include;
D:\visual studio\VC\Auxiliary\VS\include;
D:\visual studio\VC\Auxiliary\VS\UnitTest\include;
D:\Windows Kits\10\Include;D:\Windows Kits\10\Extension SDKs\WindowsMobile\10.0.18362.0\Include;
D:\Windows Kits\10\Extension SDKs\WindowsMobile\10.0.19041.0\Include;
D:\Windows Kits\10\Include\10.0.18362.0\ucrt;
D:\Windows Kits\10\Include\10.0.18362.0\um;
D:\Windows Kits\10\Include\10.0.18362.0\winrt;
D:\Windows Kits\10\Include\10.0.18362.0\cppwinrt\winrt;
D:\Windows Kits\10\Include\10.0.18362.0\shared;
lib
D:\visual studio\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x64;
D:\opnet\14.5.A\sys\pc_intel_win32\lib;
D:\opnet\14.5.A\sys\lib;
D:\visual studio\VC\Auxiliary\VS\UnitTest\lib;
D:\visual studio\VC\Tools\MSVC\14.28.29333\atlmfc\lib;
D:\visual studio\VC\Auxiliary\VS\lib;
D:\Windows Kits\10\bin\10.0.19041.0\x86;
path
D:\visual studio\Common7\IDE;
D:\visual studio\Common7\Tools;
D:\visual studio\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x64;
D:\visual studio\VC\Tools\MSVC\14.28.29333\include;
D:\Windows Kits\10\Windows Performance Toolkit;
D:\Windows Kits\10\bin;
D:\visual studio\Common7\IDE\VC\vcpackages;
C:\Windows\Microsoft.NET\Framework\v3.5;
C:\Windows\Microsoft.NET\Framework\v2.0.50727;
VS2019安装验证:
在命令行分别输入cl、ml、link

值得一提的是,安装opnet需要先新建一个文件夹,软件安装过程中选择文件夹时,它是不允许新建文件夹的,这可能是一个小bug吧。
安装第一个软件时一路Next,其中选择 License类型时,选择Standalone模式,选择modeler类型时,三个选项全选
Tips:需要注意的是安装完成之后,modeler软件的文件路径是
D:\opnet\14.5.A\sys\pc_intel_win32\bin
要以管理员身份运行。发送快捷方式到桌面,在属性-->兼容性里勾选以管理员身份运行此程序即可。
----------------------------------------------------------------------------------
遇到的问题
首先可能就是license的问题,
我感觉我的也有点问题,但是以管理员身份运行的话,是可以继续使用的。留坑代填吧。
环境变量配置带来的问题
没有好办法,我把网上教程给的都添加上去了。应该有许多不必要添加,有机会就删几个试试。
question 1:couldn't find "String.h"或者其他.h文件
根据我的经验是由于环境变量录入不完整所导致的,首先可以在VS目录里搜索String.h,如果搜到就把路径加入到include。
如果搜索不到应该是VS2019安装过程中没有安装完。可以试试把.net选上,我还看到有的教程里面有环境变量里有SDK的,我也安装了一个WindowsSDK,应该也是因为我电脑上缺少SDK。 这个问题到此大致就全部解决了。
question 2:X86和X64不匹配
<<< Recoverable Error >>> Object repository construction failed
due to errors encountered by the binder program(bind_so_msvc)
T (0), EV (-), MOD(NONE), PROC (sim_load_repos_rebuild)
Errors reported by the binder program follow
(these messages have been saved in (C:\Users\xxx\op_admin\tmp\bind_err_11632):
D:\opnet\14.5A\models\std\links\dpt_propdel_bgutil.dev64.io.ps.obj: fatal error LNK1112: 模块计算机类型"X86"与目标计算机类型"X64"冲突
solution:
参考链接
Edit-->Preference里修改一下几项
1.Kernel里Compile for64-Bit, Development, Sequential Kernel ——> TRUE
2.comp_prog里DiscreteEvent Simulation.Code Generation.Compilation下的C++ Compilation Script ——> xxx\OPNET\14.5.A\sys\pc_amd_win64\bin\comp_msvc.exe
3.bind_static_prog里StaticSimulation Linking Script ——> xxx\OPNET\14.5.A\sys\pc_amd_win64\bin\bind_msvc.exe。
4.bind_shobj_prog里NetworkRepositories Linking Script ——> xxx\OPNET\14.5.A\sys\pc_amd_win64\bin\bind_so_msvc.exe
5.bind_static_flags里64-BitStatic Simulation Flags ——> /LIBPATH:xxx\OPNET\14.5.A\sys\pc_amd_win64\lib /DEBUG。(/ DEBUG前面有个空格)
6.bind_shobj_flags里64-BitNetwork Repositories Flags ——> /LIBPATH:xxx\OPNET\14.5.A\sys\pc_amd_win64\lib /DEBUG。/ DEBUG前面有个空格)
最终在configure/run的时候,simulation设置为development;
Kernel Type选中64位
question 3:
*<<< Recoverable Error >>> Object repository construction failed due to errors encountered by the binder program
(D:\opnet\14.5.A\sys\pc_amd_win64\bin\bind_so_msvc.exe) T (0), EV (-), MOD
(NONE), PROC (sim_load_repos_rebuild)
Errors reported by the binder program follow
(these messages have been saved in (C:\Users\**\op_admin\tmp\bind_err_7640):
LINK : fatal error LNK1181: cannot open input file 'kernel32.lib
solution:
SelectEdit --> Preferences
Type "network sim" in the search for field
Click the value field of Network Simulation Repositories
Add “stdmod” to the value field of Network Simulation Repositories
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具