Re: Bad Routine Number
- Posted by Icy_Viking Jun 02, 2019
- 1408 views
ghaberek said...
Icy_Viking said...
I figured it out. I was also able to make the window appear. It appears the SDL2 DLL is using the _cdecl format, so you need the '+' in front of the function name.
Good to hear. This is definitely a problem that's tripped me up before. It's also not always intuitive from the headers you're trying to wrap. Sometimes you have to play follow-the-macro to see where the calling convention gets declared.
Icy_Viking said...
Now I have to add that "+" for the rest of the 2000+ functions :P.
If you use Notepad++, you can either do a Find/Replace:
- Find: sdl2,"SDL
- Replace: sdl2,"+SDL
Or use the multi-line selection feature (Shift+Alt+Up/Down) to insert the same character on every line. This does require your define_c_func/proc lines be vertically aligned, however.
-Greg
Thanks for the tip.