Ooops
January 16, 2021, 09:45:35 PM

Author Topic: issue during compilation of old (6 year ago) BMX on NG  (Read 282 times)

Offline fielder

  • Full Member
  • ***
  • Posts: 101
issue during compilation of old (6 year ago) BMX on NG
« on: December 08, 2020, 07:20:37 PM »
i receive this strange error:

Code: [Select]
[ 97%] Compiling:EasyEasy.bmx.console.release.win32.x64.c
In file included from C:/Users/Bfield/Google Drive/Sviluppo 2018/EasyEasy/.bmx/EasyEasy.bmx.console.release.win32.x64.c:1:
C:/Users/Bfield/Google Drive/Sviluppo 2018/EasyEasy/.bmx/EasyEasy.bmx.console.release.win32.x64.h:37:37: error: stray '@' in program
 extern BBINT __stdcall  GetCursorPos@4(BBBYTE* bbt_point);
                                     ^
C:/Users/Bfield/Google Drive/Sviluppo 2018/EasyEasy/.bmx/EasyEasy.bmx.console.release.win32.x64.h:37:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant
 extern BBINT __stdcall  GetCursorPos@4(BBBYTE* bbt_point);
                                      ^
C:/Users/Bfield/Google Drive/Sviluppo 2018/EasyEasy/.bmx/EasyEasy.bmx.console.release.win32.x64.c: In function '_bb_main':
C:/Users/Bfield/Google Drive/Sviluppo 2018/EasyEasy/.bmx/EasyEasy.bmx.console.release.win32.x64.c:833:19: error: stray '@' in program
       GetCursorPos@4((BBBYTE*)BBARRAYDATA(_m_EasyEasy_MouseKoords,1));
                   ^
C:/Users/Bfield/Google Drive/Sviluppo 2018/EasyEasy/.bmx/EasyEasy.bmx.console.release.win32.x64.c:833:19: error: expected ';' before numeric constant
       GetCursorPos@4((BBBYTE*)BBARRAYDATA(_m_EasyEasy_MouseKoords,1));
                   ^~
                   ;
Build Error: failed to compile (1) C:/Users/Bfield/Google Drive/Sviluppo 2018/EasyEasy/.bmx/EasyEasy.bmx.console.release.win32.x64.c
Process complete

the final error is: error: stray '@' in program

i can compile without issues other applications (new) for Windows on x86 or 64...

Offline Derron

  • Hero Member
  • *****
  • Posts: 3331
Re: issue during compilation of old (6 year ago) BMX on NG
« Reply #1 on: December 08, 2020, 08:55:30 PM »
I got these stray @ things when having "extern" functions (linking to a DLL).

The definition does not need the "@parametersize" thing with NG.

bye
Ron

Offline fielder

  • Full Member
  • ***
  • Posts: 101
Re: issue during compilation of old (6 year ago) BMX on NG
« Reply #2 on: December 09, 2020, 07:54:15 PM »
yep.. i have this:

Extern "win32"
   Function MousePos(point:Byte Ptr)="GetCursorPos@4"
End Extern

there is a way to port this to NG ? (the app is compiling right with "old" official Bmax release)

i'm using this to move the windowed application using the mouse without having edges to grab.

Offline Derron

  • Hero Member
  • *****
  • Posts: 3331
Re: issue during compilation of old (6 year ago) BMX on NG
« Reply #3 on: December 09, 2020, 09:50:18 PM »
this is how I use it in a DLL I compile with blitzmax - which piggybacks another DLL (thirdparty, commercial closed source)
Code: [Select]
Local dllName:String = "mydll.dll"
Local dllHandle:Byte Ptr = LoadLibraryW(dllName)
If Not dllHandle Then Notify dllName + " not loaded properly."; End

Global TheExternalFunction:Int(point:Byte Ptr) "Win32" = GetProcAddress(dllHandle, "TheExternalFunction")

in your case ... you might just remove the "@4"


if you wrote the DLL in BlitzMax too - then only write this "Win32" part if you exported the function in the DLL with Win32 too

dll:
Function GetVersion:Byte Ptr() Export "Win32"
would need the "win32" part in your "extern" part.


What is needed is depending on the DLL and how it was compiled. If you link into Windows-provided DLLs ... then "win32" will most probaly be ne needed. Is the DLL compiled bye some cross-platform project (so with GCC etc) then it might not be needed.


bye
Ron

Offline fielder

  • Full Member
  • ***
  • Posts: 101
Re: issue during compilation of old (6 year ago) BMX on NG
« Reply #4 on: December 10, 2020, 08:59:04 AM »
The DLL is Windows made dll.. i take these linees to screen grab example for Windows (but i use this for have mouse coords related to entire screen) https://mojolabs.nz/posts.php?topic=83029

removing @4 i have this new error: error: conflicting types for "GetCursorPos"

Code: [Select]
C:/BlitzMax/MinGW32x86/i686-w64-mingw32/include/winuser.h:3615:29: note: previous declaration of 'GetCursorPos' was here
   WINUSERAPI WINBOOL WINAPI GetCursorPos(LPPOINT lpPoint);
with error on "GetCursorPos"

there is anotehr way to retrieve REAL mouse coords? ( not the windowed-application internal values)
                                                 



Offline Henri

  • Sr. Member
  • ****
  • Posts: 288
Re: issue during compilation of old (6 year ago) BMX on NG
« Reply #5 on: December 10, 2020, 09:10:56 AM »
Hi fielder,

try this:
Code: BlitzMax
  1. Extern "win32"
  2. ?bmxng
  3.         Function MousePos:Int(point:Byte Ptr) = "BOOL GetCursorPos(BYTE*)!"
  4. ?Not bmxng
  5.         Function MousePos:Int(point:Byte Ptr) = "GetCursorPos@4"
  6. ?
  7. End Extern
  8.  

-Henri
- Got 01100011 problems, but the bit ain't 00000001

Offline fielder

  • Full Member
  • ***
  • Posts: 101
Re: issue during compilation of old (6 year ago) BMX on NG
« Reply #6 on: December 11, 2020, 09:27:57 AM »
Thank you Henri!!!..

this worked!!!

there is just a typo on "?bmnxng"  that prevent to add the function to NG :)

very thank you!

Offline Henri

  • Sr. Member
  • ****
  • Posts: 288
Re: issue during compilation of old (6 year ago) BMX on NG
« Reply #7 on: December 11, 2020, 09:41:33 AM »
Ooops. Typo fixed..

-Henri
- Got 01100011 problems, but the bit ain't 00000001

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal