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

Compiler Error - Problem with forward referencing. #52

Closed
legionnairex2 opened this issue Aug 19, 2016 · 2 comments
Closed

Compiler Error - Problem with forward referencing. #52

legionnairex2 opened this issue Aug 19, 2016 · 2 comments

Comments

@legionnairex2
Copy link

I got a program that gives me an error when I try to pass a pointer to a method but only when I pass one of its fields:

Method InitLevel1()
    ufoManager = New UfoManager(playerManager.player.pos) '************

End Method

to this method on another Class:

Method New(playerPos:PVector2D) '******************
    Super.New()
    state = State.ENTERING
    Self.playerPos = playerPos '****************
End Method

and I get this error:

/Users/ayoitseve/Desktop/monkeypatrol/monkeypatrol.buildv1.0.3/build_cache/desktop_debug_macos/monkeypatrol_src_2entity.h:11:8: note: forward declaration of 't_default_PVector2D'
struct t_default_PVector2D;
^
1 error generated.
***** Fatal mx2cc error *****

Internal mx2cc build error

If I pass the object I don't get the error only if I pass the field:

Method InitLevel1()
    ufoManager = New UfoManager(playerManager.player) '**********

End Method

Method New(player:Vehicle) '********************************************
    Super.New()
    state = State.ENTERING
    Self.playerPos = player.pos  '*************************************
End Method

this does not give me an error and works fine.

@AmonUK
Copy link

AmonUK commented Sep 1, 2016

Is the field you are passing from the Class public, private etc?

@blitz-research
Copy link
Owner

I may have fixed this, but I can't really test your code 'as is'.

You'll need to post some 'runnable' code, ie: code I can just copy, paste and run without having to 'guess' all the missing bits.

blitz-research pushed a commit that referenced this issue Aug 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants