Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Integrating ns3 with Qt
Forum Updated to NodeBB v4.3 + New Features

Integrating ns3 with Qt

Scheduled Pinned Locked Moved 3rd Party Software
3 Posts 2 Posters 3.0k 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.
  • A Offline
    A Offline
    asif
    wrote on 19 Aug 2013, 03:00 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
    • A Offline
      A Offline
      asif
      wrote on 28 Aug 2013, 02:07 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
      • I Offline
        I Offline
        IMAN4K
        wrote on 3 Jun 2017, 06:35 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
        • P Pl45m4 referenced this topic on 8 Mar 2024, 02:35

        • Login

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