Compiling a omnet project with --std=c++0x

710 views
Skip to first unread message

Ivo Calado

unread,
Dec 20, 2012, 11:31:58 AM12/20/12
to omn...@googlegroups.com
Hi guys,
   is it possible to compile a omnet project with --std=c++0x flag? The Omnet IDE presents different menu options to a pure C++-based project and a Omnet-based project. In the first one, I can define this in "C/C++ Build -> Settings -> GCC C++ Compiler -> Miscellaneous". However, such option does not appear in a Omnet project. Any tip?

Regards

--
Ivo Calado

Quidquid latine dictum sit, altum viditur

Putt's Law:
       Technology is dominated by two types of people:
               Those who understand what they do not manage.
               Those who manage what they do not understand.

Ivo Calado

unread,
Dec 20, 2012, 12:16:06 PM12/20/12
to omn...@googlegroups.com
Hi, I found the answer for my doubt. I have to recompile all Omnet, enabling customized options in configure.user

CFLAGS_DEBUG='-g -Wall --std=c++0x'
CFLAGS_RELEASE='-O2 -DNDEBUG=1 --std=c++0x'

dmbrito

unread,
Feb 26, 2013, 9:56:17 AM2/26/13
to omn...@googlegroups.com, ivo.c...@ee.ufcg.edu.br
Hi, Ivo

I also need to compile using " --std=c++0x" flag... I have tried to change the configure.user file just like you said, and then entered:

./configure
make clean
make

But after this, I still see that the compiler ignores the portion of codes after #ifdef __GXX_EXPERIMENTAL_CXX0X__, for example. I also get informed that "lambda expressions" I'm trying to use "are only available with -std=c++0x or -std=gnu++0x".

Can you see what is it that I'm doing wrong?

Thanks in advance for your help!

Dayal

Ivo Calado

unread,
Feb 26, 2013, 10:22:33 AM2/26/13
to omn...@googlegroups.com, day...@gmail.com
Hi Dayal,
   did you clean up de omnet installation before run ./configure ... ?

Please, check this. I'm sending you my configure.user for comparison.

Regards,

 Ivo

--
--
Sent from the OMNeT++ mailing list. To configure your membership,
visit http://groups.google.com/group/omnetpp
 
---
You received this message because you are subscribed to the Google Groups "omnetpp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
configure.user
Message has been deleted

dmbrito

unread,
Feb 26, 2013, 1:31:58 PM2/26/13
to omn...@googlegroups.com, day...@gmail.com, ivo.c...@ee.ufcg.edu.br
Thank you for the response, Ivo!
 
What do you mean by cleaning the installation? I'm entering the following as shown in the omnet Install Guide:
make clean

After that I enter "./configure", and then "make".

The configure.user file is exactly as yours:

CFLAGS_DEBUG='-g -Wall -std=c++0x'
CFLAGS_RELEASE='-O2 -DNDEBUG=1 -std=c++0x'

It should work now, but I get the errors shown in the image attached.

Any ideas?

Thank you very much!!
Print - mingw stdcpp0.jpg

Ivo Calado

unread,
Feb 26, 2013, 1:40:27 PM2/26/13
to dmbrito, omn...@googlegroups.com
I mean that you should try run make clean before running ./configure (just a guess). Nevertheless, I compiled my omnet in a linnux environment . I did not tested in a Windows OS. That may be the reason.

dmbrito

unread,
Feb 27, 2013, 1:00:39 PM2/27/13
to omn...@googlegroups.com, dmbrito, ivo.c...@ee.ufcg.edu.br
Ivo,

As a matter of fact, I have to use Omnet through MinGW, and it seems that it doesn't support gcc 4.7
Thus I can´t compile using --std=c++0x, but I´m using --std=gnu++0x and it works fine!

Thank you very much for your help.

Best regards,

Dayal

Rudolf Hornig

unread,
Feb 28, 2013, 8:11:12 AM2/28/13
to omn...@googlegroups.com, dmbrito, ivo.c...@ee.ufcg.edu.br
omnet 4.3rc1 does support gcc 4.7

Rudolf

dmbrito

unread,
Mar 1, 2013, 9:07:22 AM3/1/13
to omn...@googlegroups.com, dmbrito, ivo.c...@ee.ufcg.edu.br
Thanks for the info, Rudolf.

I am indeed using Omnet 4.2.2

Dayal
Reply all
Reply to author
Forward
0 new messages