Including INET in a new project

354 views
Skip to first unread message

bruno vieira

unread,
May 20, 2019, 6:56:52 AM5/20/19
to OMNeT++ Users
Dear all,

I'm creating a omnet++ project from scratch and want to use some of inet components, but, i'm having some problems on being able to do it... on one of my applications .h i have this:

(...).h:16:17: error: ‘inet’ is not a namespace-name
 using namespace inet;
                 ^~~~
(...).h:16:21: error: expected namespace-name before ‘;’ token
 using namespace inet;

I believe these happen because inet is not correctly included on my project... Note that i'm using the IDE to build the project (which i don't have much experience with).
Already added the inet folder into my workspace, as well as, added it to my "project references"...

What am I missing?

(using omnetpp 5.4 and inet 3.99 versions)

Best regards,
Bruno Vieira



Alfonso Ariza Quintana

unread,
May 20, 2019, 7:03:51 AM5/20/19
to omn...@googlegroups.com
Have you included some header that defined the namepace inet?


De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de bruno vieira <brunov...@gmail.com>
Enviado: lunes, 20 de mayo de 2019 12:56
Para: OMNeT++ Users
Asunto: [Omnetpp-l] Including INET in a new project
 
--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/546066e4-87ec-46f2-8a03-b2fc59e000bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

bruno vieira

unread,
May 20, 2019, 7:12:12 AM5/20/19
to OMNeT++ Users
I believe not... i'll check it though...

However, that shouldn't be an issue, I have this exact same application's code in another project, and it can compile with success. (using exactly the same setup)


segunda-feira, 20 de Maio de 2019 às 12:03:51 UTC+1, Alfonso Ariza Quintana escreveu:
Have you included some header that defined the namepace inet?


De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de bruno vieira <brunov...@gmail.com>
Enviado: lunes, 20 de mayo de 2019 12:56
Para: OMNeT++ Users
Asunto: [Omnetpp-l] Including INET in a new project
 
Dear all,

I'm creating a omnet++ project from scratch and want to use some of inet components, but, i'm having some problems on being able to do it... on one of my applications .h i have this:

(...).h:16:17: error: ‘inet’ is not a namespace-name
 using namespace inet;
                 ^~~~
(...).h:16:21: error: expected namespace-name before ‘;’ token
 using namespace inet;

I believe these happen because inet is not correctly included on my project... Note that i'm using the IDE to build the project (which i don't have much experience with).
Already added the inet folder into my workspace, as well as, added it to my "project references"...

What am I missing?

(using omnetpp 5.4 and inet 3.99 versions)

Best regards,
Bruno Vieira



--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.com.

Alfonso Ariza Quintana

unread,
May 20, 2019, 7:34:27 AM5/20/19
to OMNeT++ Users
Enviado: lunes, 20 de mayo de 2019 13:12
Para: OMNeT++ Users
Asunto: Re: [Omnetpp-l] Including INET in a new project
 
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.

bruno vieira

unread,
May 20, 2019, 8:57:02 AM5/20/19
to OMNeT++ Users
It makes sense... I was missing this line:

#include "inet/mobility/contract/IMobility.h"

It was only useful so i could use the inet namespace as it's mentioned on the link you provided.

However, I can't seem to be able to get that include to work:

(...).h:10:10: fatal error: inet/mobility/contract/IMobility.h: No such file or directory
 #include "inet/mobility/contract/IMobility.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

What is missing on my steps to be able to get this include done?

Alfonso Ariza Quintana

unread,
May 20, 2019, 10:03:37 AM5/20/19
to omn...@googlegroups.com

Have you included the project reference?



Enviado: lunes, 20 de mayo de 2019 14:57
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.

bruno vieira

unread,
May 20, 2019, 10:05:17 AM5/20/19
to OMNeT++ Users
Yes, I did:

Alfonso Ariza Quintana

unread,
May 20, 2019, 10:11:53 AM5/20/19
to omn...@googlegroups.com

In project->properties->omnet++->MakeMake
Check if the route is correct
-KINET_PROJ=/home/alfonso/modelos/inet
-DINET_IMPORT
-L$(INET_PROJ)/src -lINET$(D)

Must include the route to  inet
-KINET_PROJ=/home/alfonso/modelos/inet



Enviado: lunes, 20 de mayo de 2019 16:05
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.

bruno vieira

unread,
May 20, 2019, 10:21:49 AM5/20/19
to omn...@googlegroups.com
These are my options for the project:

--nolink -f --deep -O out -KINET_PROJ=../inet -DINET_IMPORT -I. -I$(INET_PROJ) -I$(INET_PROJ)/src -L$(INET_PROJ)/src -lINET$(D) -d src -X.

My inet folder is on the same main folder as my project:

image.png


Alfonso Ariza Quintana

unread,
May 20, 2019, 10:52:43 AM5/20/19
to omn...@googlegroups.com
The route should be correct if the makemake is working correctly

Enviado: lunes, 20 de mayo de 2019 16:21
Para: omn...@googlegroups.com

bruno vieira

unread,
May 20, 2019, 10:57:13 AM5/20/19
to omn...@googlegroups.com
How can I debug if makemake is working correctly? analyzing the output I get from the IDE, only the missing include appears to be the issue

Alfonso Ariza Quintana

unread,
May 20, 2019, 10:58:26 AM5/20/19
to omn...@googlegroups.com
Let me your project

Enviado: lunes, 20 de mayo de 2019 16:56

bruno vieira

unread,
May 20, 2019, 11:43:51 AM5/20/19
to OMNeT++ Users
I can't send you the full project as it has some code that I can't share, however, i'll send you the folders and you can try to create a custom application on the projects src/ folder and try to include any inet header. Sent in attachment, just link it to your local inet version.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.
DSME4Car.zip

Alfonso Ariza Quintana

unread,
May 20, 2019, 11:56:47 AM5/20/19
to omn...@googlegroups.com
This file doesn't have any source code

Enviado: lunes, 20 de mayo de 2019 17:43
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.

bruno vieira

unread,
May 20, 2019, 11:58:40 AM5/20/19
to OMNeT++ Users
As I said, I can't share my source code since it can't be shared outside my institution, however, you can create a custom application just to try and include any inet header with my configurations.

Alfonso Ariza Quintana

unread,
May 20, 2019, 12:18:26 PM5/20/19
to omn...@googlegroups.com
I can compile the project and generate the executable

Enviado: lunes, 20 de mayo de 2019 17:58
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.

bruno vieira

unread,
May 20, 2019, 12:19:44 PM5/20/19
to omn...@googlegroups.com
can you send me the folder you have? with the custom source code you have

Alfonso Ariza Quintana

unread,
May 20, 2019, 12:32:58 PM5/20/19
to omn...@googlegroups.com
Enviado: lunes, 20 de mayo de 2019 18:19
DSME4Car.7z

Alfonso Ariza Quintana

unread,
May 20, 2019, 12:33:30 PM5/20/19
to omn...@googlegroups.com
You can see that the executable has been created.

De: omn...@googlegroups.com <omn...@googlegroups.com> en nombre de Alfonso Ariza Quintana <aari...@hotmail.com>
Enviado: lunes, 20 de mayo de 2019 18:32
Para: omn...@googlegroups.com
Asunto: RE: [Omnetpp-l] Including INET in a new project
 

bruno vieira

unread,
May 20, 2019, 12:44:42 PM5/20/19
to OMNeT++ Users
 It was created because you didnt include any source code that required any inet include... That's the issue here.

Alfonso Ariza Quintana

unread,
May 20, 2019, 4:24:05 PM5/20/19
to omn...@googlegroups.com
This is the reason that I asked about the source code, I cannot check your problem without any source code

Enviado: lunes, 20 de mayo de 2019 18:44

Para: OMNeT++ Users
Asunto: Re: [Omnetpp-l] Including INET in a new project
 It was created because you didnt include any source code that required any inet include... That's the issue here.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.

bruno vieira

unread,
May 21, 2019, 4:25:12 AM5/21/19
to OMNeT++ Users
 This issue is solved.

ROCHETTE Andy

unread,
May 21, 2019, 5:42:43 AM5/21/19
to OMNeT++ Users
Can you share what you did to solve this issue please ?

Le mardi 21 mai 2019 10:25:12 UTC+2, bruno vieira a écrit :
 This issue is solved.

bruno vieira

unread,
May 21, 2019, 5:51:27 AM5/21/19
to omn...@googlegroups.com
I'm having a problem using the IDE right now, so I actually don't remember what solved this... (If you could check my mos recent issue on the forum, I would appreciate it)

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.
Reply all
Reply to author
Forward
0 new messages