0

I'm trying to simulate a video streaming network using OPNET 14.5A.

I setup OPNET to use Visual Studio 2012 as a compiler and I'm using OpenCV 2.4.10.

When running an OPNET simulation I get the following error:

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)

----

I've setup Microsoft.Cpp.Win32.user.props file the following way:

- C/C++ -> General -> Additional Include Directories  
C:\OpenCV2.4\opencv\build\include  
C:\OpenCV2.4\opencv\build\include\openc­v  
C:\OpenCV2.4\opencv\build\include\openc­v2  

- 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;

Please help me understand what I am doing wrong in setting up my testing environment.

Unheilig
  • 16,196
  • 193
  • 68
  • 98

1 Answers1

1

I received and answer to this question from another source, here's the answer for reference.

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