Trying to compile ns-3.22 within QtCreator and gcc

165 views
Skip to first unread message

Ivan Senin

unread,
Feb 19, 2015, 9:42:48 AM2/19/15
to ns-3-...@googlegroups.com
Hi all

My purpose is to compile ns-3 project with first.cc example as main.cpp working with QtCreator

I use this guides:


As I realized, I can compile and work with ns3 project without Waf at all (Right? (1) )
I've builded ns3 this way: ./build.py --enable-examples --enable-tests

So, I created in QtCreator "New Project" and included all from ns-3-allinone/ns-3.22/src/<some_directory>/ model or helper /*
Also copy-pasted sample of first.cc into main.cpp

Then, I added next lines to .PRO file:
QMAKE_CXXFLAGS += -std=c++11
INCLUDEPATH
+= ../../ns-3-allinone/ns-3.22/build

DEFINES
+= NS3_LOG_ENABLE
DEFINES
+= NS3_ASSERT_ENABLE



Afterwards, I faced with some problems of GTK-2 including:
.../model-node-creator.h:21: error: gtk/gtk.h: No such file or directory #include <gtk/gtk.h>

I managed it this way:
addition to .PRO file
CONFIG += link_pkgconfig
PKGCONFIG
= gtk+-2.0


Unfortunately, I cant find solution of my next compilation problem:
.../ns-3-allinone/ns-3.22/src/core/model/int64x64-cairo.cc:68: error: 'int64x64_t' has not been declared
int64x64_t::Mul (const int64x64_t & o)


Note: I can build .../ns-3.22/src/core/model/int64x64.cc without errors

Have you any ideas how to fix it?


Regards,
Ivan
 

Ivan Senin

unread,
Feb 20, 2015, 4:27:53 PM2/20/15
to ns-3-...@googlegroups.com
Ok, I want to use second variant of integration NS3 with QtCreator
Could anybody explain more precisely this step:

  • Right-click on the Sources folder and select Add Existing Files.... Use it to add all required models and helpers.
?
1) I must import files from  ns-3.22/src/ <some module> / model or helper    or   from ns-3.22/build/src/ ...   or maybe from ns-3.22/build/ns3/*.h   ?
2) There is, for example, "#include "ns3/core-module.h""  in first.cc tutorial, that tells me to add file  ns-3.22/build/ns3/core-module.h , but I'm not sure that it is right way



Thanks,
Ivan
Reply all
Reply to author
Forward
0 new messages