Unable to include INET headers

1,185 views
Skip to first unread message

Stephanie Dünhaupt

unread,
Jul 20, 2010, 8:49:12 AM7/20/10
to omn...@googlegroups.com
Hello,

I am trying to include the INET header files in my project, but I am
unable to use them. For example, when using
#include <IPAddress.h>, I get the "IPAddress.h: No such file or
directory" error.

What I've done so far:
- I already set the INET project reference using Properties->Project
References.
- The file libinet.dll is present in the folder inet/src. There were no
compilation problems.
- I set a library path for my project via Properties->C/C++
General->Paths and Symbols.
- The LD_LIBRARY_PATH variable is set properly.

However, I am able to use the INET .ned files in the network I've set
up. I am also able to run the INET examples.

Does anyone know why this is happening?
I am using OMNeT++ 4.1b2 on Windows 7 x64.

Any help is appreciated!

LIN Peng

unread,
Jul 20, 2010, 8:53:21 AM7/20/10
to omn...@googlegroups.com
the < > syntax is not for self defined header, neither for INET,
change it with " ".
when you make sure that include path is properly set, that should work.

good luck


2010/7/20 Stephanie Dünhaupt <stephanie...@ruhr-uni-bochum.de>:

> --
> You received this message because you are subscribed to the Google Groups
> "omnetpp" group.
> To post to this group, send email to omn...@googlegroups.com.
> To unsubscribe from this group, send email to
> omnetpp+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/omnetpp?hl=en.
>
>

S.

unread,
Jul 20, 2010, 9:13:22 AM7/20/10
to omnetpp
I did this and it still doesn't seem to be working. Any other ideas?

On Jul 20, 2:53 pm, LIN Peng <stlinp...@gmail.com> wrote:
> the < > syntax is not for self defined header, neither for INET,
> change it with " ".
> when you make sure that include path is properly set, that should work.
>
> good luck
>
> 2010/7/20 Stephanie Dünhaupt <stephanie.duenha...@ruhr-uni-bochum.de>:

LIN Peng

unread,
Jul 20, 2010, 9:19:35 AM7/20/10
to omn...@googlegroups.com
try clean and rebuild your project, you'd better check whether the
former change affacts the makefile, see the -I and -l option

2010/7/20 Stephanie Dünhaupt <stephanie...@ruhr-uni-bochum.de>:

S.

unread,
Jul 20, 2010, 9:53:48 AM7/20/10
to omnetpp
Thank you for your suggestion. I tried cleaning and rebuilding, but
the LIBS entry is not affected.

I also tried Makemake->Options->Link->Additional libraries to link
with and added "inet" in there. Still no luck.


On Jul 20, 3:19 pm, LIN Peng <stlinp...@gmail.com> wrote:
> try clean and rebuild your project, you'd better check whether the
> former change affacts the makefile, see the -I and -l option
>
> 2010/7/20 Stephanie Dünhaupt <stephanie.duenha...@ruhr-uni-bochum.de>:

Durai

unread,
Jul 21, 2010, 11:15:48 AM7/21/10
to omnetpp
I am also facing the same problem. The include (-I) option of make
file not reflected at the time of compilation.

Problem:

#include <UDPBasicApp.h>
"No such file or directory"

Makefile content:

# C++ include paths (with -I)
INCLUDE_PATH = \
-I../../inet/src/networklayer/ipv4 \
-I../../inet/src/networklayer/common \
-I../../inet/src/networklayer/rsvp_te \
-I../../inet/src/networklayer/icmpv6 \
-I../../inet/src/transport/tcp \
-I../../inet/src/networklayer/mpls \
-I../../inet/src/base \
-I../../inet/src/networklayer/ted \
-I../../inet/src/util/headerserializers \
-I../../inet/src/networklayer/contract \
-I../../inet/src/util \
-I../../inet/src/transport/contract \
-I../../inet/src/networklayer/ipv6 \
-I../../inet/src/transport/sctp \
-I../../inet/src/linklayer/mfcore \
-I../../inet/src/world \
-I../../inet/src/applications/pingapp \
-I../../inet/src/linklayer/contract \
-I../../inet/src/networklayer/arp \
-I../../inet/src/networklayer/ldp \
-I../../inet/src/transport/udp \
-I../../inet/src/applications/udpapp \
-I. \
-Iapplications \
-Iapplications/udpapp \
-Inodes

# Additional libraries (-L, -l options)
LIBS = -L -L../../inet/out/$(CONFIGNAME)/src -linet
LIBS += -Wl,-rpath,`abspath ` -Wl,-rpath,`abspath ../../inet/out/$
(CONFIGNAME)/src`

Compilation time :

g++ -c -g -Wall -fno-stack-protector -DHAVE_PCAP -DXMLPARSER=libxml
-I/usr/local/akaroa/include -DWITH_AKAROA -DWITH_PARSIM -
DWITH_NETBUILDER -I. -Iapplications -Iapplications/udpapp -Inodes -I/
usr/local/omnetpp-4.1/include -o ../out/gcc-debug//src/applications/
udpapp/AgentApp.o applications/udpapp/AgentApp.cc

The -I option not correctly included at the time of compilation.

Is it a bug in latest OMNET++ (Version: 4.1, Build id:
100611-4b63c38) ?

please help. Thanks

On Jul 20, 6:53 pm, "S." <stephanie.duenha...@ruhr-uni-bochum.de>
wrote:

S.

unread,
Jul 21, 2010, 3:49:17 PM7/21/10
to omnetpp
That is weird. My include path in the makefile did not even have the
inet project in there, even though I checked its box in Project
References...

Anyway, after much testing and trying, here is what worked for me:

- Added $(INET_PROJ)/src to the library path (via Paths & Symbols, see
my above messages).
- I checked the checkbox inet->[Active] under Properties -> C/C++
General -> Paths & Symbols -> References.
- Checked the checkbox inet under Properties -> Project References
- Set Properties -> OMNeT++ -> Makemake -> Options -> Compile -> DLL
export/import symbol = INET

Your Preview should then look like this:

--deep -pINET -linet --meta:recurse --meta:auto-include-path --
meta:export-library --meta:use-exported-libs

Then, still on the Makemake tab, click Export. You get a file named
makemakefiles. Execute make -f makemakefiles from the command line.
You get a new makefile.
Back in the IDE, right-click the makefile and select Make Targets ->
Create. Make a target named 'all'.
Then go to Make Targets -> Build. Select the target you created, and
build it.

That's it. You should now be able to use the INET headers.

S.

unread,
Jul 21, 2010, 3:56:18 PM7/21/10
to omnetpp
I forgot to mention this:

Make sure your makefile contains the following lines (add them
manually in the makefile if necessary):

# Other makefile variables (-K)
INET_PROJ=../../inet


# Additional libraries (-L, -l options)
LIBS = -L$(INET_PROJ)/src -L$(INET_PROJ)/src/ -L$(INET_PROJ)/out/gcc-
debug/src/ -L../../inet/out/$(CONFIGNAME)/src -linet -linet
LIBS += -Wl,-rpath,`abspath $(INET_PROJ)/src` -Wl,-rpath,`abspath $
(INET_PROJ)/src/` -Wl,-rpath,`abspath $(INET_PROJ)/out/gcc-debug/src/`
-Wl,-rpath,`abspath ../../inet/out/$(CONFIGNAME)/src`

Durai

unread,
Jul 22, 2010, 4:32:28 AM7/22/10
to omnetpp
No luck for me. I hope you are working on windows. Am working on
fedora 13.

On Jul 22, 12:56 am, "S." <stephanie.duenha...@ruhr-uni-bochum.de>
wrote:
Reply all
Reply to author
Forward
0 new messages