LNK2019:OPNET 14.5A 中未解决的外部符号错误
LNK2019: unresolved external symbol error in OPNET 14.5A
我正在尝试使用 OPNET 14.5A 模拟视频流网络。
我将 OPNET 设置为使用 Visual Studio 2012 作为编译器,我使用的是 OpenCV 2.4.10。
当 运行 OPNET 模拟时,我得到以下错误:
Creating library C:\opnet_projectsnodes.projectnodes-scenario1.dev32.i0.nt.lib and object C:\opnet_projectsnodes.projectnodes-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_projectsnodes.projectnodes-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;
请帮助我了解我在设置测试环境时做错了什么。
我从另一个来源收到并回答了这个问题,这里是参考答案。
Since Modeler calls the compiler and linker directly, I do not think the Microsoft.Cpp.Win32.user.props file will be used. Instead, you can add the settings as compiler and linker options in the Modeler preferences.
The include directories can be added to "Common Flags for All Code", the library directories can be added to "Common Network Repositories Flags", and the library names can be added to "Common Network Repository Libraries". (The full names of the preferences may be different in 14.5, but I do not think the tags have changed. They are 'comp_flags_common', 'bind_shobj_flags' and 'bind_shobj_libs', respectively.)
Add '/I' before each include directory, and add '/LIBPATH:' before the library directory.
- See more at: https://splash.riverbed.com/message/22918#22918
我正在尝试使用 OPNET 14.5A 模拟视频流网络。
我将 OPNET 设置为使用 Visual Studio 2012 作为编译器,我使用的是 OpenCV 2.4.10。
当 运行 OPNET 模拟时,我得到以下错误:
Creating library C:\opnet_projectsnodes.projectnodes-scenario1.dev32.i0.nt.lib and object C:\opnet_projectsnodes.projectnodes-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_projectsnodes.projectnodes-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;
请帮助我了解我在设置测试环境时做错了什么。
我从另一个来源收到并回答了这个问题,这里是参考答案。
Since Modeler calls the compiler and linker directly, I do not think the Microsoft.Cpp.Win32.user.props file will be used. Instead, you can add the settings as compiler and linker options in the Modeler preferences.
The include directories can be added to "Common Flags for All Code", the library directories can be added to "Common Network Repositories Flags", and the library names can be added to "Common Network Repository Libraries". (The full names of the preferences may be different in 14.5, but I do not think the tags have changed. They are 'comp_flags_common', 'bind_shobj_flags' and 'bind_shobj_libs', respectively.)
Add '/I' before each include directory, and add '/LIBPATH:' before the library directory. - See more at: https://splash.riverbed.com/message/22918#22918