Import Problem

BlitzMax Forums/BlitzMax Programming/Import Problem

I have 2 following files:

TypeB.bmx:
Import "typeA.bmx"

Type typeB
  field pointer:typeA
EndType


TypeA.bmx:
import "typeB.bmx"

Type typeA
  field pointer:typeB
EndType


Like you see they have to import each other, but then I get an double declaration error.
Anyone have an idea how to handle it?

Just Include *one* to the other:
include "typeA.bmx"

Type typeB
  Field pointer:typeA
EndType


i have got another problem with import.

i have three files: main.bmx, src/a.bmx, src/b.bmx

main.bmx
Import "src/a.bmx"
.
.
.



src/a.bmx
Import "src/b.bmx" 

Type TypeA
   Field bla:TypeB
.
End Type



src/b.bmx

Type TypeB
.
.
End Type


The problem is now that to compile src/a.bmx the import
command should look like this : Import "b.bmx"
but to compile main.bmx correctly it should be : Import "src/b.bmx"

So you can't use sources in other folders with bmax and thats not very good.

? Why are you specifying import src/b.bmx rather than just b.bmx?

the problem is if u use import "src/b.bmx" blitzmax cannot compile a.bmx and if you use import "b.bmx" bmax cannot compile main.bmx

but they must bee compile both to link them together