Re: Euphoria Wrapper Problem
- Posted by Icy_Viking Jun 03, 2015
- 1905 views
Hello,
I am having the following issue while trying to make an example program. The error says bad routine number (-1).
I've tried looking at all the different files, but I can't see anything wrong or why it would come up with a bad routine error. Am I declaring something wrong, is the DLL I'm using bad? When I run the wrapper file, which is .ew, it runs fine, no errors or anything. However, when I try to run an actual program using the wrapper, I get the bad routine error. Any help is greatly appericated.
Try modifying your wrapper like this:
--Wrapper code if ttf = 0 then puts(2, "Load of Library ttf failed!\n") end if public constant xTTF_Init = define_c_func(ttf,"TTF_Init",{},C_INT) if xTTF_Init = 0 then puts(2, "Load of function TTF_Init failed!\n") end if public function TTF_Init() return c_func(xTTF_Init,{}) end function
And let us know what the output is.
I tried it like this
if ttf = 0 then puts(2,"Failed to open SDL2_tff.dll!\n") --abort(0) end if
It appears it failed to load the DLL. I also tried it like this.
if ttf = -1 then puts(2,"Failed to open SDL2_tff.dll!\n") --abort(0) end if public constant xTTF_Init = define_c_func(ttf,"TTF_Init",{},C_INT) if xTTF_Init = 0 then puts(2,"Failed to load function TTF_Init()") end if
No error came up when I tried that. So I suspect it is failing to load the DLL for whatever reason. However, I can't see why as the previous SDL DLLs all loaded fine.