-1

I will be grateful if you help me to figure out my problems with veins: I successfully installed veins 4a2 and sumo 0.21.0 and Omnet 4.4 , the simulation example works fine.

Next, I imported Crypto++ 5.6.3 in the workspace as a new project under C/C++ → Existing Code as Makefile Project. Then I linked it to veins as follow:

  • in Project References I selected the Crypto++
  • in Makemake options, I select Link → and write Crypto++

I include in my code #include< rsa.h> etc… , it is recognized and there is no syntax errors, but when I run the simulation (omnet.ini), opp_run.exe crash.

The system is Windows 10 and the error is :

<!> Error in module (cCompoundModule) RSUExampleScenario (id=1) during network setup: Class "Veins::ObstacleControl" not found -- perhaps its code was not linked in, or the class wasn't registered with Register_Class(), or in the case of modules and channels, with Define_Module()/Define_Channel().

TRAPPING on the exception above, due to a debug-on-errors=true configuration option. Is your debugger ready?

Simulation terminated with exit code: -2147483645
Working directory: C:/Simulateur/veins-4a2/veins-veins-4a2/examples/veins
Command line: c:/Simulateur/omnetpp-4.4-src-windows/omnetpp-4.4/bin/opp_run.exe -r 0 -n .;../../src/veins --tkenv-image-path=../../images omnetpp.ini

Environment variables:
OMNETPP_ROOT=c:/Simulateur/omnetpp-4.4-src-windows/omnetpp-4.4
PATH=;c:\Simulateur\omnetpp-4.4-src-windows\omnetpp-4.4\bin;c:\Simulateur\omnetpp-4.4-src-windows\omnetpp-4.4\msys\bin;c:\Simulateur\omnetpp-4.4-src-windows\omnetpp-4.4\mingw\bin;c:/Simulateur/omnetpp-4.4-src-windows/omnetpp-4.4/ide/jre/bin/client;c:/Simulateur/omnetpp-4.4-src-windows/omnetpp-4.4/ide/jre/bin;c:/Simulateur/omnetpp-4.4-src-windows/omnetpp-4.4/ide/jre/lib/i386;.;C:\Simulateur\omnetpp-4.4-src-windows\omnetpp-4.4\msys\local\bin;c:\Simulateur\omnetpp-4.4-src-windows\omnetpp-4.4\mingw\bin;C:\Simulateur\omnetpp-4.4-src-windows\omnetpp-4.4\msys\bin;c:\Simulateur\omnetpp-4.4-src-windows\omnetpp-4.4\bin;c:\Windows\system32;c:\Windows;c:\Windows\System32\Wbem;c:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;c:\Program Files (x86)\AMD\ATI.ACE\Core-Static;c:\Windows\system32\config\systemprofile\.dnx\bin;c:\Program Files\Microsoft DNX\Dnvm\;c:\Program Files\Microsoft SQL Server\120\Tools\Binn\;c:\Program Files (x86)\Skype\Phone\;c:\Simulateur\omnetpp-4.4-src-windows\omnetpp-4.4;
OMNETPP_IMAGE_PATH=c:\Simulateur\omnetpp-4.4-src-windows\omnetpp-4.4\images

Question: How to link another C++ library, like Crypto++, to my veins project?

jww
  • 97,681
  • 90
  • 411
  • 885
  • The question is not being well received because you described your problem, described the error, but you *did not* provide relevant code. Some members of SO want code, even for the high level questions. And they even criticize when the have no knowledge of the technology, like Omnet++. Always add some code, even if its minimal and possibly irrelevant. In your case, I would add code for *Network Setup* and *Veins::ObstacleControl* because the error message names them. – jww Jan 23 '16 at 15:35
  • I didn’t add any line of code and I don’t change anything in Veins::ObstacleControl’s code ! all what I want to do is to connect a new library c++ called crypto++ to veins, and just by linked it, the sumulation crash (opp_run) and send an ironic error in ObstacleControl, even I didn’t touch it! My problem its not a problem of coding but a problem of adding a new c++ library, in other words, How to link another c++ library to my veins ?! – henry townshend Jan 23 '16 at 19:17

1 Answers1

1

Veins generates a dynamic library of its simulation modules. When using opp_run you will need to tell it to load this library. Otherwise the simulation will not be able to instantiate any of Veins’ modules.

Try doing the Veins tutorial to see what command line parameters OMNeT++ uses to launch the simulation.

Christoph Sommer
  • 6,893
  • 1
  • 17
  • 35
  • You mean ./configuration in the step 2 of veins tutorial ? I did it but nothing change ! I don’t know what to do ? for information : I linked a static library (crypto++) and after built, I have libveins.a and libcryptopp.a in the src folder. – henry townshend Jan 24 '16 at 17:38
  • If you can, try using dynamic libraries instead. Veins was built for that use case. – Christoph Sommer Jan 26 '16 at 00:43