Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
error on function returning _mem
#1
Hello,
I don't understand why the following code crashes during compilation.
I understood that a function should not return a type defined by TYPE, but that native types were permitted ?
Code: (Select All)
print test.size

declare function test as _mem

function test ()
    test = _memnew(1753)
end function
compilelog.txt says that :
g++  -no-pie -std=gnu++17 -fno-strict-aliasing -Wno-conversion-null -DFREEGLUT_STATIC -I./internal/c/libqb/include -I./internal/c/parts/core/freeglut/include -I./internal/c/parts/core/glew/include -DDEPENDENCY_NO_SOCKETS -DDEPENDENCY_NO_PRINTER -DDEPENDENCY_NO_ICON -DDEPENDENCY_NO_SCREENIMAGE internal/c/qbx.cpp -c -o internal/c/qbx.o
In file included from internal/c/qbx.cpp:1742:
internal/c/../temp/main.txt: In function ‘float FUNC_TEST()’:
internal/c/../temp/main.txt:30:31: error: cannot convert ‘mem_block’ to ‘float’ in assignment
  30 | *_FUNC_TEST_SINGLE_TEST=(func2=func__memnew( 1753 ));
      |                        ~~~~~~^~~~~~~~~~~~~~~~~~~~~~
      |                              |
      |                              mem_block
make: *** [Makefile:413 : internal/c/qbx.o] Erreur 1
Reply


Messages In This Thread
error on function returning _mem - by Herve - 07-04-2025, 07:52 PM
RE: error on function returning _mem - by Herve - 07-04-2025, 08:29 PM
RE: error on function returning _mem - by Jack - 07-04-2025, 08:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Mac debugger not connecting, a user error! BlameTroi 0 98 02-07-2026, 06:18 PM
Last Post: BlameTroi
Star Suggestion for new REPLACE$() function zaadstra 3 236 01-26-2026, 05:11 PM
Last Post: grymmjack
  ERROR MESSAGES COLORS ? aurel 5 377 01-02-2026, 11:26 AM
Last Post: aurel
  Is there a menu function? Mad Axeman 17 1,018 12-17-2025, 04:43 AM
Last Post: SMcNeill
  Using CONST & _RGB used together seem to error... Dav 12 670 12-12-2025, 12:29 AM
Last Post: Dav

Forum Jump:


Users browsing this thread: 1 Guest(s)