Hi,
I am trying to include in ns-3 an external library (libDAI).
I have already read some threads about it [1-3], still I am
experiencing some difficulties.
The library I am trying to include is in a non-standard path: more
specifically it is placed in src/contrib/myapp/libdai. (The reason is
that I want it to be shipped along with the ns-3 code.)
The library itself (libdai.a) resides in src/contrib/myapp/libdai/lib.
So far, I have managed to have my source codes see the header files of
the lib (which, as a side effect, now have to be included like this:
"#include <ns3/libraryheader.h>).
However, the program is not linked against the library itself (ld
reports undefined references).
This is what I put in src/contrib/myapp/wscript (basically, the
approach suggested in [1]):
def build(bld):
obj = bld.create_ns3_module('myapp', ['core', 'simulator'])
obj.env.append_value('LIBPATH', ['libdai/lib'])
obj.env.append_value('LIB', ['dai'])
obj.source = [
# list of .cc files belonging to 'myapp'
]
headers = bld.new_task_gen('ns3header')
headers.module = 'cogent'
headers.source = [
# list of .h files including both those belonging to 'myapp' and those
belonging to the library
]
obj.includes = 'libdai/include'
I'm running out of clues. Any suggestion?
TIA,
Chris
[1] http://groups.google.com/group/ns-3-users/browse_frm/thread/5352de44e36715c/55e2c5c28b0216f4
[2] http://groups.google.com/group/ns-3-users/browse_frm/thread/94d9b6ccbf47884f/5a76aa7151e9d00f
[3] http://groups.google.com/group/ns-3-users/browse_frm/thread/cd2062d3095e0e0a/1ab8346c161f8d73
--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.
I have resolved that issue after spending some time.I am providing the solution so that it can be helpful to save time:
In order to integrate ns3 and Qt, I;
1)-created the dynamic library of the code written in Qt using IDE netbeans.
2)-In order to link and use that library I place the header file in the build/project folder so that I can use it easily.After that to link the dynamic library in ns3, I added following lines in the script file:
module.ccflags=['-wall','-O3']
module.lib=['QDynLib']
module.libpath=['/home/a/Documents/ns-allinone-3.16/ns-3.16/src/propagation/QDynLib/dist/Debug/GNU-Linux-x86']
module.linkflag=['-g'] #module.install_path=['/home/a/Documents/ns-allinone-3.16/ns-3.16/src/propagation/QDynLib/dist/Debug/GNU-Linux-x86']
module.rpath=['/home/a/Documents/ns-allinone-3.16/ns-3.16/src/propagation/QDynLib/dist/Debug/GNU-Linux-x86']
Here,I used the absolute path to locate the dynamic library.
Location of the Dynamic library;
/home/a/Documents/ns-allinone-3.16/ns-3.16/src/propagation/QDynLib/dist/Debug/GNU-Linux-x86/
Name of the library File:
libQDynLib.so
to find the explanation and detail of these command please refer to the link:
http://docs.waf.googlecode.com/git/book_15/single.html#_c_and_c_projects