How do I link my simulation against external libraries on UNIX?

Categories:
Solution Number:
S20600
Last Modified:
2013-08-20
Issue

How do I link my simulation against external libraries on UNIX?

Solution

For proper simulation linking, your environment database file ($HOME/op_admin/env_db<n.n>) should be modified so that the paths to the system library are included. For example, to link your external system library /usr/local/lib/libxyz.a, include the following lines: bind_static_flags: -L /usr/local/lib bind_static_libs: -lxyzIf you are using dynamically created simulations (i.e., shared objects by using op_runsim), then use the environment attribute bind_shobj_flags and bind_shobj_libs to include the desired dynamically loaded libraries, such as /usr/local/lib/libxyz.so: bind_shobj_flags: -L /usr/local/lib bind_shobj_libs: -lxyzNote that you may have to set your LD_LIBRARY_PATH to include the location of your libraries (for example, /usr/local/lib): setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/local/libFor these changes to take effect, before re-running your simulation you may need to remove your simulation nt.s1.so repository: rm <project>-<scenario>.nt.s1.soFor more information, please refer Chapter External Compiler Interface in the OPNET External Interfaces Manual.

Environment

DES Kernel->Other

Attachments
NOTICE: Riverbed® product names have changed. Please refer to the Product List for a complete list of product names.
Can't find an answer? Create a case