undefined reference to `WindowFromPoint@4'?
BlitzMax Forums/BlitzMax Programming/undefined reference to `WindowFromPoint@4'?
| ||
The function is declared in the module. Why isn't it able to link?:Import pub.win32 Local point:Int[4] WindowFromPoint(point) End Building untitled1 Compiling:untitled1.bmx flat assembler version 1.68 (1867431 kilobytes memory) 3 passes, 552 bytes. Linking:untitled1.exe C:/Program Files (x86)/BlitzMax/tmp/.bmx/untitled1.bmx.gui.release.win32.x86.o: undefined reference to `WindowFromPoint@4' Build Error: Failed to link C:/Program Files (x86)/BlitzMax/tmp/untitled1.exe Process complete |
| ||
Possibly because WindowFromPoint takes an Int Ptr, not an Int Array. BlitzMax is extremely inconsistent with automatically typecasting, so it might not be casting for you here. Try casting it yourself with VarPtr(point[0]). |
| ||
It takes a POINT struct not a pointer so will probably simplest to wrap call in a C stub. |
| ||
Strangely enough, if I do this it works fine:Extern "win32" Function WindowFromPoint:Int(x:Int,y:Int) EndExtern Last edited 2010 |
| ||
It takes a POINT struct not a pointer so will probably simplest to wrap call in a C stub. It must have been changed in an update I don't have then, because it definitely says Int Ptr here. EDIT: Come to think of it. I'm not sure I see that it makes any difference. An array of 4 ints would be the same as POINT struct, and passing the pointer to the first entry in the array would achieve the same thing, no? Last edited 2010 |