我正在尝试使用OPNET 14.5A模拟视频流网络。
我设置OPNET使用Visual Studio 2012作为编译器,我正在使用OpenCV 2.4.10。
运行OPNET模拟时,我收到以下错误:
Creating library C:\opnet_projects\4nodes.project\4nodes-scenario1.dev32.i0.nt.lib and object C:\opnet_projects\4nodes.project\4nodes-scenario1.dev32.i0.nt.exp
wlan_mac_hcf.dev32.i0.pr.obj : error LNK2019: unresolved external symbol _cvReleaseImage referenced in function _wlan_hcf_completed_frame_forward
wlan_mac_hcf.dev32.i0.pr.obj : error LNK2019: unresolved external symbol _cvCreateMemStorage referenced in function _wlan_mac_hcf
wlan_mac_hcf.dev32.i0.pr.obj : error LNK2019: unresolved external symbol _cvClearMemStorage referenced in function _faceDetection
wlan_mac_hcf.dev32.i0.pr.obj : error LNK2019: unresolved external symbol _cvGetSeqElem referenced in function _faceDetection
wlan_mac_hcf.dev32.i0.pr.obj : error LNK2019: unresolved external symbol _cvLoad referenced in function _wlan_mac_hcf
wlan_mac_hcf.dev32.i0.pr.obj : error LNK2019: unresolved external symbol _cvHaarDetectObjects referenced in function _faceDetection
wlan_mac_hcf.dev32.i0.pr.obj : error LNK2019: unresolved external symbol _cvLoadImage referenced in function _wlan_hcf_completed_frame_forward
myRTPJPEGheader.dev32.i0.ex.obj : error LNK2019: unresolved external symbol _cvCreateImage referenced in function _convertToOPENCV
myRTPJPEGheader.dev32.i0.ex.obj : error LNK2019: unresolved external symbol _cvGet2D referenced in function _getPSNR
C:\opnet_projects\4nodes.project\4nodes-scenario1.dev32.i0.nt.dll : fatal error LNK1120: 9 unresolved externals
bind_so_msvc: Unable to execute Manifest control program "mt.exe" (Win32 error code: 2)
----
<<< Program Abort >>>
Error encountered rebuilding repository -- unable to proceed
T (0), EV (-), MOD (NONE), PROC (sim_load_repos_load)
----
我已按以下方式设置Microsoft.Cpp.Win32.user.props文件:
- C/C++ -> General -> Additional Include Directories
C:\OpenCV2.4\opencv\build\include
C:\OpenCV2.4\opencv\build\include\opencv
C:\OpenCV2.4\opencv\build\include\opencv2
- Linker -> General -> Additional Library Directories
C:\OpenCV2.4\opencv\build\x86\vc11\lib
- Linker -> Input -> Additional Dependencies
opencv_calib3d2410d.lib
opencv_contrib2410d.lib
opencv_core2410d.lib
opencv_features2d2410d.lib
opencv_flann2410d.lib
opencv_gpu2410d.lib
opencv_highgui2410d.lib
opencv_imgproc2410d.lib
opencv_legacy2410d.lib
opencv_ml2410d.lib
opencv_nonfree2410d.lib
opencv_objdetect2410d.lib
opencv_ocl2410d.lib
opencv_photo2410d.lib
opencv_stitching2410d.lib
opencv_superres2410d.lib
opencv_ts2410d.lib
opencv_video2410d.lib
opencv_videostab2410d.lib
- Added the following to my Path System Variable
C:\OpenCV2.4\opencv\build\x86\vc11\bin;
请帮助我了解我在设置测试环境时遇到的错误。
答案 0 :(得分:1)
我从另一个来源收到并回答了这个问题,这是答案供参考。
由于Modeler直接调用编译器和链接器,我认为不会使用Microsoft.Cpp.Win32.user.props文件。相反,您可以在Modeler首选项中将设置添加为编译器和链接器选项。
可以将include目录添加到“Common Flags for All Code”,可以将库目录添加到“Common Network Repositories Flags”,并且可以将库名称添加到“Common Network Repository Libraries”。 (14.5中首选项的全名可能不同,但我认为标签没有变化。它们分别是'comp_flags_common','bind_shobj_flags'和'bind_shobj_libs'。)
在每个include目录之前添加'/ I',并在库目录之前添加'/ LIBPATH:'。 - 请参阅:https://splash.riverbed.com/message/22918#22918