-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How compile a DLL ? #32
Comments
Are you using autoload or are you importing the dll specifically? |
I'm importing it with |
If you can share some code I may be able to help you get it working. It also depends on whether the dll is compiled as a c or cpp file as the name mangling is different. Also it could be platform dependant, but this relies on many different factors (although dlls actually work on all platforms). Do the example dlls work / run correctly? |
It works flawless on the original DIV for MSDOS. You can take a look to the code here : https://github.com/Zardoz89/csvDll I would make a minimal example program to test it correctly. |
Dlls for DOS work slightly differently (for various reason). There are some subtle changes necessary to get the code to work, although this varies from platform to platform there are some instances where no code changes are required at all. |
Are you able to compile and use the example included dlls? |
@CicTec suggested me to use his fork on the forum . I keep having the same problem, but at least the console log, shows something that could be useful : If could be uselful :
|
Which build of DIV are you using? SDL Version? |
Like I said, I compile "master" branch, "old_master" branch and @CicTec fork master branch. SDL 2.0.10 |
Sorry for duplicating this here and the forum, but toying with @CicTec fork and doing some debug with fprintfs, looks that divlibrary(), divmain() and divend() functions aren't being called. So the DLL functions aren't registered. |
Many of the div functions and options are set by cmake when compiling. SET(HAS_DLL 0) # optional dll support If this is not set, dlls will not load |
Also i asked if you were compiling using c or c++, not the branch. Using c or c++ is also a cmake option |
I find that the problem is that my code it's being compiled using c++ and has missing |
I'm trying to port my CSV DLL to DIV DX . I used the new div.h and compiled with
gcc csv.cpp -o csv.so -fPIC -funsigned-char -fpermissive -shared -O3
. It generates a csv.so . So then I try to use on my DIV game and when I try to compile it, throws a "Unknown name" error when calling my exported functions :Any idea why happens this ? I need to do changes to my code ?
NOTE: I'm trying this to my own compiled version of "old_master" branch (f57f75c) and with "master" branch (dc8b7e5)
The text was updated successfully, but these errors were encountered: