OMNeT++/OMNEST Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000984OMNeT++simulation kernelpublic2017-01-11 20:222017-02-01 15:27
Reportertill 
Assigned Toandras 
PriorityhighSeverityblockReproducibilityalways
StatusresolvedResolutionfixed 
Platformx86-64OSmacOSOS Version10.12
Product Version5.1pre2 
Target VersionFixed in Version5.1pre3 
Summary0000984: error "#include <platdep/sockets.h> must precede <omnetpp.h> (and <platdep/timeutil.h> if present)" not possible in msg-files
DescriptionI get an error with OMNeT++ 5.1preview2:
error "#include <platdep/sockets.h> must precede <omnetpp.h> (and <platdep/timeutil.h> if present)"

Situation is the following:
I have a message file:
packet CTFrame extends EthernetIIFrame

therefore the message file contains:
cplusplus {{
    //INET
    #include "inet/linklayer/ethernet/EtherFrame_m.h"
}}

In the generated code i have #include <omnetpp.h> in top and below:
// cplusplus {{
    //INET
    #include "inet/linklayer/ethernet/EtherFrame_m.h"
// }}

But EtherFrame_m.h includes Ethernet.h that itself includes INETDefs.h that includes precompiled.h that includes sockets.h that defines the error.

I have no idea how to fix that, because the code is generated by the msg compiler. I cannot change the order of the includes!
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0001276)
rhornig (administrator)
2017-01-27 14:25

This is indeed bad. The proper solution will be:
- remove the ordering constraint between omnetpp.h and platdep/sockets.h
- remove platdep/sockets.h from precompiled.h in INET

This solution will work only with OMNET 5.1 pre3+ and INET 3.5
(0001277)
andras (administrator)
2017-02-01 11:10

Solution: in platdep/timeutil.h, don't define timeval ourself, just pull in <winsock2.h> (forget the obsolete <winsock.h>, it should never be used). In platdep/sockets.h, also include <winsock2.h> unconditionally, and remove the #error directive.

- Issue History
Date Modified Username Field Change
2017-01-11 20:22 till New Issue
2017-01-27 14:25 rhornig Note Added: 0001276
2017-02-01 11:10 andras Note Added: 0001277
2017-02-01 11:10 andras Status new => resolved
2017-02-01 11:10 andras Fixed in Version => 5.1pre3
2017-02-01 11:10 andras Resolution open => fixed
2017-02-01 11:10 andras Assigned To => andras


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker