import error (import must appear at top of file)
BlitzMax Forums/BlitzMax Programming/import error (import must appear at top of file)| 
 | ||
| Hi, I was trying to make a .bmx file that I include and this .bmx file imports a bunch of c stuff at the very beginning. The problem is, even if I put include before anything else in the main program, it says import must appear at top of file.. heres a basic example of what im talking about. game.bmx include "get_externs.bmx" 'do game stuff here get_externs.bmx Import "fastmaths.c" Extern Function fsqr:Float( s:Float )="fsqr" End Extern am i doing something wrong? can you import from an include? | 
| 
 | ||
| I believe you  get that when import is included in anything other than the main file. try using include instead of import. | 
| 
 | ||
| you can not import in an included file Import must appear in the main file. | 
| 
 | ||
| I assume it because include is before import that it causes the error. Why not just import "get_externs.bmx"? | 
| 
 | ||
| importing get_externs.bmx did the trick. I just didnt know you could import a .bmx :p Thanks for the help! |