Skip to content
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

"long int" error from sound2.c #23

Closed
happycamper31 opened this issue Apr 22, 2024 · 8 comments
Closed

"long int" error from sound2.c #23

happycamper31 opened this issue Apr 22, 2024 · 8 comments

Comments

@happycamper31
Copy link

Hello guys,
I got an issue when compiling the source.
This is the error it throws out from make:

sound2.c:117:21: error: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘long int’ [-Werror=format=]
  117 |         printf("%6lld\n", hi_p-(__POINTER__)sfx_p);
      |                 ~~~~^     ~~~~~~~~~~~~~~~~~~~~~~~
      |                     |         |
      |                     |         long int
      |                     long long int
      |                 %6ld
cc1: all warnings being treated as errors
make: *** [Makefile:36: sound2.o] Error 1

Hope you can help me out here. As far as I understood the instructions, I should have all dependencies (gcc, make, sdl2).

BR happycamper

@urxp
Copy link
Owner

urxp commented Apr 23, 2024

hi, you can just comment out this line, it is only for logging, or cast to (long long)(hi_p-(POINTER)sfx_p)

@happycamper31
Copy link
Author

Thanks, that seemed to work for now.
But the next error appears 😅

___3e3cch.c: In function ‘___3e3cch’:
___3e3cch.c:18:5: error: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
   18 |     fscanf(fd, "%s", ___1a0d60h);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:36: ___3e3cch.o] Error 1

@urxp
Copy link
Owner

urxp commented Apr 24, 2024

Comment out this line FLAGS += -Werror -Wno-unused-result in Makefile, you'll most likely get a bunch of warnings but you should pass the compilation. What is your platform a compiler version btw?

@happycamper31
Copy link
Author

I'm on linux, gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
We're slowly getting there 😉 but there is another one.
My sdl2 version is 2.0.20, seems there is a header missing. (Sorry I'm not very good at figuring out these errors.)

db_ipx.c:8:10: fatal error: SDL2/SDL_net.h: No such file or directory
    8 | #include <SDL2/SDL_net.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:36: db_ipx.o] Error 1

@urxp
Copy link
Owner

urxp commented Apr 24, 2024

Looks like you don't have sdl2_net development package installed

@happycamper31
Copy link
Author

Ah, ok now the make exited without an error. It might be good to mention that, as it doesn't come with sdl2 automatically.
That's in the readme:

Linux requirements

  • GCC/Clang C compiler
  • GNU/Make
  • SDL2

I'm confused how to continue now. Do I need to "make install" now?

@urxp
Copy link
Owner

urxp commented Apr 24, 2024

Well it is only a remnant from multiplayer implementation attempts, shouldn't even be there. Now you simply copy compiled executable to folder with death rally assets and execute

@happycamper31
Copy link
Author

Nice, that should be it. I forgot about the binaries, which I put into another folder.
Works fine for now. Thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants