Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Integrating ns3 with Qt
Qt 6.12 LTS is out! See what's new in the release blog

Integrating ns3 with Qt

Scheduled Pinned Locked Moved 3rd Party Software
3 Posts 2 Posters 3.6k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi,
    I am currently working on a project for which i have created two project files in IDE Netbeans.one is using the ns3, a c/c++ application project and second one is Qt application project used for GUI purpose.I need to integrate them together or in simple words i want to call a function which is there in QT application project from a c/c++ application project.

    can anybody help me how to do that???thanks in advance for your help.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • IMAN4KI Offline
        IMAN4KI Offline
        IMAN4K
        wrote on last edited by
        #3

        Here is .pro format for NS3 integration(for anyone else in future):

        TEMPLATE = app
        CONFIG += console c++11
        CONFIG -= app_bundle
        CONFIG -= qt
         
        NS_BUILD_DIR = <path-to-ns3>/ns-3.26/build
         
        LIBS += -L$$NS_BUILD_DIR
        INCLUDEPATH += $$NS_BUILD_DIR
         
        unix {
            SHARED_LIB_FILES = $$files($$NS_BUILD_DIR/*.so)
            for(FILE, SHARED_LIB_FILES) {
                BASENAME = $$basename(FILE)
                CLEARNAME = $$replace(BASENAME,libns,ns)
                CLEARNAME = $$replace(CLEARNAME,.so,)
                LIBS += -l$$CLEARNAME
            }
        }
         
        SOURCES += main.cpp
        
        1 Reply Last reply
        0
        • Pl45m4P Pl45m4 referenced this topic on

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt
        • Unsolved