Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import message files from neighboring directory without adding '../src' to include paths #866

Open
edlongman opened this issue Jan 29, 2021 · 1 comment
Labels
new New issue that has not been yet acknowledged

Comments

@edlongman
Copy link
Contributor

Platform

  • OMNeT++ version: 5.6.2
  • OS: Windows (not relevant)

Describe the bug

When restructuring my project I tried to import a defs.msg with import common.defs into linklayer/linkLayerFrame.msg . defs.msg contains some definitions. The project looked like so:

+-src
    +-common
    |    +-defs.h
    |    +-defs.msg 
    |       +   cplusplus {{
    |       |       #include "common/defs.h"
    |       ╚   }}
    +-linklayer
        +-linkLayerFrame.msg

I had a problem with the message compiler, which would give the following error compilling
linkLayerFrame.msg
Error: cannot resolve import 'common.defs'

import common.defs;
import inet.common.packet.chunk.Chunk;
import inet.linklayer.common.MacAddress;

namespace msg_import_bug;

enum FrameType {
    DATA = 1;
    WU_ACK = 2;
};

class Datagram extends inet::FieldsChunk
{
    FrameType type;
    inet::MacAddress transmitterAddress;
    inet::MacAddress receiverAddress;
}

Which was being compiled with:
opp_msgc --msg6 -s _m.cc -MD -MP -MF ../out/gcc-release/src/linklayer/linkLayerFrame_m.h.d -I../../inet/src linklayer/linkLayerFrame.msg
To Reproduce
Attached project:
msg_import_bug.zip

Does not build unless ../src is added to C/C++ Build -> Paths and Symbols -> Includes

Problem
It is implied that, like .ned files messages will be included if they are within the directory structure of the same package. But this is not the case and it is not explained anywhere that the C/C++ include paths are relevant for the msgtool.

@edlongman edlongman added the new New issue that has not been yet acknowledged label Jan 29, 2021
@Avian688
Copy link

Avian688 commented Sep 1, 2022

Have the same error, any update on a fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new New issue that has not been yet acknowledged
Projects
None yet
Development

No branches or pull requests

2 participants