Posts: 34
Threads: 11
Joined: Jun 2022
Reputation:
6
I get a C++ error while compiling:
In file included from qbx.cpp:2185:
..\\temp\\main.txt: In function 'void SUB_MENU(qbs*, qbs*, qbs*, qbs*, qbs*)':
..\\temp\\main.txt:38620:102: error: cast from 'HANDLE' {aka 'void*'} to 'int' loses precision [-fpermissive]
*__UOFFSET_HFIND=( int32 )CreateFile((char*)(_SUB_MENU_STRING_G)->chr, 384 ,NULL,NULL, 1 ,NULL,NULL);
^
compilation terminated due to -Wfatal-errors.
Posts: 439
Threads: 17
Joined: Apr 2022
Reputation:
21
I also am receiving this error. You should be declaring your external functions with "Declare CustomType Library" when they use data types such as offset. Line 359 is the start of your declare block for some of your functions. You need to change "Declare Library" to "Declare CustomType Library". Even then, I'm not entirely a fan of your declarations as a whole but the program will build after this simple change.
Ask me about Windows API and maybe some Linux stuff
Posts: 249
Threads: 9
Joined: Apr 2022
Reputation:
4
ouff
i never figured what was a real purpose of hex-editors
i am too stupid for hex numbers
Posts: 177
Threads: 37
Joined: Jul 2022
Reputation:
6
08-30-2022, 02:11 AM
(This post was last modified: 08-30-2022, 03:02 AM by eoredson.)
I have tested Hexedit in QB64 PE under Win10 and have not encountered any library errors.
Maybe your Linux Wine is not parsing them correctly.
I also edited Declare Library To Declare CustomType Library without errors.
Maybe replace CreateFile with CreateFileA
Erik.
Posts: 439
Threads: 17
Joined: Apr 2022
Reputation:
21
08-31-2022, 01:53 PM
(This post was last modified: 08-31-2022, 01:56 PM by SpriggsySpriggs.)
(08-30-2022, 02:11 AM)eoredson Wrote: I have tested Hexedit in QB64 PE under Win10 and have not encountered any library errors.
Maybe your Linux Wine is not parsing them correctly.
I also edited Declare Library To Declare CustomType Library without errors.
Maybe replace CreateFile with CreateFileA
Erik.
I wasn't using Linux Wine and I don't think BDS107 was either. I was using Windows 11 with QB64pe. The errors we were receiving were not within the IDE but during compile time. But, as a rule, you should use "Declare CustomType Library" when one of your arguments or your function return is of type OFFSET. You can also just declare the DLL that contains the "CreateFileA" function.
Ask me about Windows API and maybe some Linux stuff