-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fatal error: cannot load shared library dllsdl2_stubs #33
Comments
If you don't need this function (this is probably the case), just remove it from the sources. diff --git a/src/sdlrwops.ml b/src/sdlrwops.ml
index 64fac6b..185e9f4 100644
--- a/src/sdlrwops.ml
+++ b/src/sdlrwops.ml
@@ -72,7 +72,6 @@ module BigEndian = struct
external read64 : t -> uint64 = "caml_SDL_ReadBE64"
external write16 : t -> uint16 -> unit = "caml_SDL_WriteBE16"
- external write32 : t -> uint32 -> unit = "caml_SDL_WriteBE32"
external write64 : t -> uint64 -> unit = "caml_SDL_WriteBE64"
end
diff --git a/src/sdlrwops.mli b/src/sdlrwops.mli
index 3f6e106..23d0880 100644
--- a/src/sdlrwops.mli
+++ b/src/sdlrwops.mli
@@ -86,9 +86,6 @@ module BigEndian : sig
external write16 : t -> uint16 -> unit = "caml_SDL_WriteBE16"
(** {{:http://wiki.libsdl.org/SDL_WriteBE16}api doc} *)
- external write32 : t -> uint32 -> unit = "caml_SDL_WriteBE32"
- (** {{:http://wiki.libsdl.org/SDL_WriteBE32}api doc} *)
-
external write64 : t -> uint64 -> unit = "caml_SDL_WriteBE64"
(** {{:http://wiki.libsdl.org/SDL_WriteBE64}api doc} *)
end
diff --git a/src/sdlrwops_stub.c b/src/sdlrwops_stub.c
index 0649505..f940c52 100644
--- a/src/sdlrwops_stub.c
+++ b/src/sdlrwops_stub.c
@@ -165,7 +165,6 @@ write_int_stub(Uint8, SDL_WriteU8, "writeU8")
write_int_stub(Uint16, SDL_WriteLE16, "LittleEndian.write16")
write_int_stub(Uint16, SDL_WriteBE16, "BigEndian.write16")
write_int_stub(Uint32, SDL_WriteLE32, "LittleEndian.write32")
-write_int_stub(Uint32, SDL_WriteBE32, "BigEndian.write32")
write_int_stub(Uint64, SDL_WriteLE64, "LittleEndian.write64")
write_int_stub(Uint64, SDL_WriteBE64, "BigEndian.write64")
|
Recent versions of ocaml provide an equivalent function: String.get_int32_be : string -> int -> int32 |
Please confirm:
The issue persists. |
if you don't need this function, just remove it from the sources, |
Sorry, I made the error with
It should be
or
In 1) the changes in the source code means nothing. It is not "applied". It install the old version without changes made in code. But in 2), 3) the changes in the source compile to binary and installs. The issue is no more. We may close this |
i think you're right, if i remember correctly i think i also had a similar issue in the past do you think I should add your explanations in the readme file? or in the install file? or in another file? maybe I should name it "development.txt" ? or just "DEV.txt" ? do you think i should remove the links to all those "SDL_WriteBE32/16/64" functions from the next release, and/or git-head ? do you know if opam accepts .zip files ? (because 'tar cf' is broken on my current computer) what do you think would be the best solutions for all these issues ? |
hi again, extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value); the doc-page doesn't seem to talk about any issue with it. This function doesn't seem to be there in dbuenzli's tsdl.ml, maybe dbuenzli removed it from his thin bindings because there is an issue with it...? ... or is it an issue, because i usually forget to put |
I got an update to debian 12, which brings the same version of sdl2 that you mention ("2.26.5"). I probably did an error somewhere that produces an error in your environment. Did you try to compile a small C test file with this function?
) #include <SDL2/SDL.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
// Initialize SDL
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
fprintf(stderr, "SDL initialization error: %s\n", SDL_GetError());
return 1;
}
// Open the file using SDL_RWFromFile (SDL_RWops)
SDL_RWops *rw = SDL_RWFromFile("output.bin", "wb");
if (!rw) {
fprintf(stderr, "Error opening file: %s\n", SDL_GetError());
SDL_Quit();
return 1;
}
// Integer to write (in Little-Endian on most systems)
Uint32 value = 123456789;
// Write the value in Big-Endian to the file
if (SDL_WriteBE32(rw, value) == 0) {
fprintf(stderr, "Error writing to file: %s\n", SDL_GetError());
SDL_RWclose(rw);
SDL_Quit();
return 1;
}
// Close the file
SDL_RWclose(rw);
// Clean up SDL
SDL_Quit();
printf("Writing completed successfully\n");
return 0;
} |
Hi, I am on manjaro (arch linux base distro)
I tried to compile a game with ocamlc + ocamlfind and it works.
But when I run the executable I get the error :
Fatal error: cannot load shared library dllsdl2_stubs
Reason: /home/idimension/.opam/default/lib/stublibs/dllsdl2_stubs.so: undefined symbol: SDL_WriteBE32
SDL2 version : 2.26.5
OCaml version : 4.14.0
The text was updated successfully, but these errors were encountered: