weird bug.

This topic contains 4 replies, has 3 voices, and was last updated by  Jesse 2 years ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #7662

    Jesse
    Participant

    I have a class in which I created a field for a class. the problem was that I create it as null:

    [/crayon]

    it parse and translates fine but when it tries to compiles I get this error:

    Mx2cc version 1.1.03

    ***** Building app ‘/Users/jesse/Desktop/surviball1/surviball.monkey2’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling…
    Build error: System command ‘g++ -I”/Users/jesse/monkey2/modules/” -I”/Users/jesse/monkey2/modules/monkey/native” -I”/Users/jesse/Desktop/surviball1/” -std=c++11 -mmacosx-version-min=10.9 -Wno-deprecated-declarations -Wno-tautological-pointer-compare -Wno-undefined-bool-conversion -Wno-int-to-void-pointer-cast -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-parentheses-equality -I”/Users/jesse/monkey2/modules/freetype/freetype-2.6.3/include/” -I”/Users/jesse/monkey2/modules/sdl2/SDL/include/” -c -o “/Users/jesse/Desktop/surviball1/surviball.buildv1.1.03/macos_debug/build/_1src_2surviball_0surviball.cpp.o” “/Users/jesse/Desktop/surviball1/surviball.buildv1.1.03/macos_debug/src/surviball_surviball.cpp”‘ failed.

    g++ -I”/Users/jesse/monkey2/modules/” -I”/Users/jesse/monkey2/modules/monkey/native” -I”/Users/jesse/Desktop/surviball1/” -std=c++11 -mmacosx-version-min=10.9 -Wno-deprecated-declarations -Wno-tautological-pointer-compare -Wno-undefined-bool-conversion -Wno-int-to-void-pointer-cast -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-parentheses-equality -I”/Users/jesse/monkey2/modules/freetype/freetype-2.6.3/include/” -I”/Users/jesse/monkey2/modules/sdl2/SDL/include/” -c -o “/Users/jesse/Desktop/surviball1/surviball.buildv1.1.03/macos_debug/build/_1src_2surviball_0surviball.cpp.o” “/Users/jesse/Desktop/surviball1/surviball.buildv1.1.03/macos_debug/src/surviball_surviball.cpp”

    In file included from /Users/jesse/Desktop/surviball1/surviball.buildv1.1.03/macos_debug/src/surviball_surviball.cpp:2:
    In file included from /Users/jesse/Desktop/surviball1/surviball.buildv1.1.03/macos_debug/include/surviball_surviball.h:5:
    In file included from /Users/jesse/monkey2/modules/monkey/native/bbmonkey.h:12:
    /Users/jesse/monkey2/modules/monkey/native/bbgc.h:225:18: error: ‘t_default_PVector2D’ is an incomplete type
    bbGC::enqueue( dynamic_cast<bbGCNode*>( _ptr ) );
    ^ ~~~~
    /Users/jesse/monkey2/modules/monkey/native/bbgc.h:233:3: note: in instantiation of member function ‘bbGCVar<t_default_PVector2D>::enqueue’ requested here
    enqueue();
    ^
    /Users/jesse/Desktop/surviball1/surviball.buildv1.1.03/macos_debug/include/surviball_GuiMod_2ButtonMod.h:108:38: note: in instantiation of member function ‘bbGCVar<t_default_PVector2D>::bbGCVar’ requested here
    bbGCVar<t_default_PVector2D> m_pos=((t_default_PVector2D*)0);
    ^
    /Users/jesse/Desktop/surviball1/surviball.buildv1.1.03/macos_debug/include/surviball_GuiMod_2ButtonMod.h:15:8: note: forward declaration of ‘t_default_PVector2D’
    struct t_default_PVector2D;
    ^
    1 error generated.

    ***** Fatal mx2cc error *****

    Internal mx2cc build error

    I could not figure it out after trying to solve it for a couple of days. finally I started trying it out by process of elimination and found out that it was the = Null in the field. I removed it and it works fine now. I know I don’t need to initialize a with a null but still, I don’t think it should be giving me that error.

    another thing is that I tried to create a minimized sample code to post it but it works fine. No errors. even with the “=Null”.

    Anyway, I just thought I would mention it. I would have post it to Github but I don’t want to post a 15 file with over 5000 line of code just to present the problem or post a zip file.

    #7663

    peterigz
    Participant

    Is PVector2 a struct? If so then I suspect this is a “Structs can’t be null” bug of some kind, in which case I guess the parser should probably pick it up.

    #7664

    Jesse
    Participant

    no this is one of my old monkey1 classes, I was just converting the code to monkey2. it’s a regular Class none have a structure involved.

    #7665

    Mark Sibly
    Keymaster

    This may in fact be fixed in develop branch – someone had a similar problem with image:Image=Null in a struct and I seem to remember fixing it.

    If you post a runnable example I can test it…generally, it’s always best to post something runnable if something is acting up.

    #7666

    Jesse
    Participant

    as I mentioned above, I tried to create a small program to illustrate the problem but I wasn’t able to reproduce it. I think it has to do with the order of the #Import of files and how they are processed by the compiler. just a wild guess.

    Anyway, I am not sure if what I am running is the developer ver. or the Master ver. I think it’s the Developer ver. I’ll try again. If I can duplicate it with small code, I will post it. Thanks Mark.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.