project-navigation
Personal tools

Author Topic: error: You must have the SDL_mixer development libraries  (Read 20650 times)

Offline Wizard^^

  • Rookie
  • ***
  • Posts: 22
    • View Profile
error: You must have the SDL_mixer development libraries
« on: December 19, 2008, 04:31:39 pm »
Hi.

I need help.

Every time I try and compile with mingw32/msys I get
Code: [Select]
checking for SDL_mixer.h... yes
checking for library containing Mix_OpenAudio... no
configure: error: You must have the SDL_mixer development libraries

Also when tring to build in CodeBlocks I get
Code: [Select]
||=== ufo, windows ===|
E:\Coding\source\ufoai\src\client\cl_renderer.h|205|error: syntax error before "SDL_Thread"|
E:\Coding\source\ufoai\src\client\cl_renderer.h|205|error: syntax error before "SDL_Thread"|
E:\Coding\source\ufoai\src\client\cl_renderer.h|205|warning: no semicolon at end of struct or union|
E:\Coding\source\ufoai\src\client\cl_renderer.h|207|error: syntax error before '}' token|
E:\Coding\source\ufoai\src\client\cl_renderer.h|207|warning: type defaults to `int' in declaration of `renderer_threadstate_t'|
E:\Coding\source\ufoai\src\client\cl_renderer.h|207|warning: data definition has no type or storage class|
E:\Coding\source\ufoai\src\client\cl_renderer.h|209|error: syntax error before "r_threadstate"|
E:\Coding\source\ufoai\src\client\cl_renderer.h|209|warning: type defaults to `int' in declaration of `r_threadstate'|
E:\Coding\source\ufoai\src\client\cl_renderer.h|209|warning: data definition has no type or storage class|
||=== Build finished: 4 errors, 5 warnings ===|
E:\Coding\source\ufoai\src\client\cl_renderer.h|205|warning: no semicolon at end of struct or union|
E:\Coding\source\ufoai\src\client\cl_renderer.h|207|error: syntax error before '}' token|
E:\Coding\source\ufoai\src\client\cl_renderer.h|207|warning: type defaults to `int' in declaration of `renderer_threadstate_t'|
E:\Coding\source\ufoai\src\client\cl_renderer.h|207|warning: data definition has no type or storage class|
E:\Coding\source\ufoai\src\client\cl_renderer.h|209|error: syntax error before "r_threadstate"|
E:\Coding\source\ufoai\src\client\cl_renderer.h|209|warning: type defaults to `int' in declaration of `r_threadstate'|
E:\Coding\source\ufoai\src\client\cl_renderer.h|209|warning: data definition has no type or storage class|
||=== Build finished: 6 errors, 10 warnings ===|
E:\Coding\source\ufoai\src\client\cl_renderer.h|205|error: syntax error before "SDL_Thread"|
E:\Coding\source\ufoai\src\client\cl_renderer.h|205|warning: no semicolon at end of struct or union|
E:\Coding\source\ufoai\src\client\cl_renderer.h|207|error: syntax error before '}' token|
E:\Coding\source\ufoai\src\client\cl_renderer.h|207|warning: type defaults to `int' in declaration of `renderer_threadstate_t'|
E:\Coding\source\ufoai\src\client\cl_renderer.h|207|warning: data definition has no type or storage class|
E:\Coding\source\ufoai\src\client\cl_renderer.h|209|error: syntax error before "r_threadstate"|
E:\Coding\source\ufoai\src\client\cl_renderer.h|209|warning: type defaults to `int' in declaration of `r_threadstate'|
E:\Coding\source\ufoai\src\client\cl_renderer.h|209|warning: data definition has no type or storage class|
||=== Build finished: 9 errors, 15 warnings ===|
E:\Coding\source\ufoai\src\client\cl_renderer.h|205|error: syntax error before "SDL_Thread"|
E:\Coding\source\ufoai\src\client\cl_renderer.h|205|warning: no semicolon at end of struct or union|
E:\Coding\source\ufoai\src\client\cl_renderer.h|207|error: syntax error before '}' token|
E:\Coding\source\ufoai\src\client\cl_renderer.h|207|warning: type defaults to `int' in declaration of `renderer_threadstate_t'|
E:\Coding\source\ufoai\src\client\cl_renderer.h|207|warning: data definition has no type or storage class|
E:\Coding\source\ufoai\src\client\cl_renderer.h|209|error: syntax error before "r_threadstate"|
E:\Coding\source\ufoai\src\client\cl_renderer.h|209|warning: type defaults to `int' in declaration of `r_threadstate'|
E:\Coding\source\ufoai\src\client\cl_renderer.h|209|warning: data definition has no type or storage class|
||=== Build finished: 12 errors, 20 warnings ===|
my systeminfo is
Code: [Select]
OS Name:                   Microsoft(R) Windows(R) XP Professional x64 Edition
OS Version:                5.2.3790 Service Pack 2 Build 3790
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          Wizard^^
System Type:               x64-based PC
Processor(s):              4 Processor(s) Installed.
                           [01]: AMD64 Family 16 Model 2 Stepping 3 AuthenticAMD ~2508 Mhz
                           [02]: AMD64 Family 16 Model 2 Stepping 3 AuthenticAMD ~2508 Mhz
                           [03]: AMD64 Family 16 Model 2 Stepping 3 AuthenticAMD ~2508 Mhz
                           [04]: AMD64 Family 16 Model 2 Stepping 3 AuthenticAMD ~2508 Mhz

I would like to get this working so I can test the game while also learning to code...
« Last Edit: December 21, 2008, 04:59:10 am by Wizard^^ »

Offline Kildor

  • Project Artist
  • Captain
  • ***
  • Posts: 757
  • Project mapper and some other stuff`er
    • View Profile
    • http://ufoai.nx0.ru
Re: error: You must have the SDL_mixer development libraries
« Reply #1 on: December 19, 2008, 04:33:07 pm »
where have you taken c::B and mingw distrib?

Offline Wizard^^

  • Rookie
  • ***
  • Posts: 22
    • View Profile
Re: error: You must have the SDL_mixer development libraries
« Reply #2 on: December 19, 2008, 04:40:42 pm »

Offline RudolfoWood

  • Rookie
  • ***
  • Posts: 85
    • View Profile
Re: error: You must have the SDL_mixer development libraries
« Reply #3 on: December 19, 2008, 04:57:43 pm »
I don't know whether this also has to be done for Codeblocks, but I found that my msys/mingw was searching for sdl headers in wrong directory (during configure). Fixed it like stated here (step 3 of "compile on windows").
Edit: I assume you tried to run ./configure to get that "error: You must have the SDL_mixer development libraries". For Codeblocks this seems to be the same reason (can't find SDL.h). For configure there should be a config.log which could give you some more hints why configure failed. (as the wrong directory in my case)
« Last Edit: December 19, 2008, 05:00:25 pm by RudolfoWood »

Offline BTAxis

  • Administrator
  • PHALANX Commander
  • *******
  • Posts: 2607
    • View Profile
Re: error: You must have the SDL_mixer development libraries
« Reply #4 on: December 19, 2008, 05:28:53 pm »

Offline Wizard^^

  • Rookie
  • ***
  • Posts: 22
    • View Profile
Re: error: You must have the SDL_mixer development libraries
« Reply #5 on: December 19, 2008, 05:51:21 pm »
Ok the new c::B is working but not msys.

I wonder if its a 32 bit library issue?  As I'm running a 64 bit OS..
« Last Edit: December 19, 2008, 05:52:52 pm by Wizard^^ »

Offline RudolfoWood

  • Rookie
  • ***
  • Posts: 85
    • View Profile
Re: error: You must have the SDL_mixer development libraries
« Reply #6 on: December 20, 2008, 10:40:13 am »
what is the error for msys? I assume you tried to run ./configure - that produces a config.log which states all steps (and the little programs that are build and executed to test various settings). Please have a look at that config.log (some lines before end) or post it here. I don't know whether it is a 64bit issue, config.log could help.

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: error: You must have the SDL_mixer development libraries
« Reply #7 on: December 20, 2008, 12:53:57 pm »
In my experience sometimes changing the build target from "windows" to "windows_debug" helps in successfully compiling the program.  I don't know if that will fix the problem in your particular case, but if you haven't tried it it might be worth a try.

Quote
I assume you tried to run ./configure...

If I recall I believe that is for compiling on Linux, with the command-line.  It looks to me like Wizard is attempting to build the program under 64-bit Windows with Codeblocks, which is done differently.
« Last Edit: December 20, 2008, 12:59:06 pm by Destructavator »

Offline RudolfoWood

  • Rookie
  • ***
  • Posts: 85
    • View Profile
Re: error: You must have the SDL_mixer development libraries
« Reply #8 on: December 20, 2008, 08:33:44 pm »
If I recall I believe that is for compiling on Linux, with the command-line.  It looks to me like Wizard is attempting to build the program under 64-bit Windows with Codeblocks, which is done differently.
Also when tring to build in CodeBlocks [...]

I remember I had this error myself. ./configure works for msys environment (which would not be needed for codeblocks) (even for cygwin, but not all dependencies are there in cygwin).

Wizard^^, please provide more details.

Offline Wizard^^

  • Rookie
  • ***
  • Posts: 22
    • View Profile
Re: error: You must have the SDL_mixer development libraries
« Reply #9 on: December 21, 2008, 05:17:00 am »
Ok here is some of the config.log, its to much to put it all in as its over the 20000 limit.

the is in line 722 to 917
Code: [Select]
configure:8609: checking libintl.h presence
configure:8624: gcc -E  conftest.c
configure:8630: $? = 0
configure:8644: result: yes
configure:8672: checking for libintl.h
configure:8680: result: yes
configure:8700: checking for library containing gettext
configure:8741: gcc -o conftest.exe -g -O2   conftest.c  >&5
conftest.c:39: warning: conflicting types for built-in function 'gettext'
C:/DOCUME~1/Wizard^^/LOCALS~1/Temp/cck9aaaa.o: In function `main':E:/Coding/source/ufoai/conftest.c:43: undefined reference to `gettext'
collect2: ld returned 1 exit status
configure:8747: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define SIZEOF_SHORT 2
| #define SIZEOF_INT 4
| #define SIZEOF_LONG 4
| #define SIZEOF_LONG_LONG 8
| #define SIZEOF_INTP 4
| #define HAVE_WINSOCK2_H 1
| #define HAVE_LIBWS2_32 1
| #define HAVE_AI_NUMERICSERV 0
| #define HAVE_STRNCASECMP 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_ZLIB_H 1
| #define HAVE_JPEGLIB_H 1
| #define HAVE_LIBINTL_H 1
| /* end confdefs.h.  */
|
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char gettext ();
| int
| main ()
| {
| return gettext ();
|   ;
|   return 0;
| }
configure:8741: gcc -o conftest.exe -g -O2   conftest.c -lintl   >&5
conftest.c:39: warning: conflicting types for built-in function 'gettext'
configure:8747: $? = 0
configure:8775: result: -lintl
configure:8804: checking for sdl-config
configure:8820: found /usr/local/bin/sdl-config
configure:8831: result: yes
configure:8877: checking SDL.h usability
configure:8894: gcc -c -g -O2 -I/usr/local/include/SDL -D_GNU_SOURCE=1 -Dmain=SDL_main conftest.c >&5
configure:8900: $? = 0
configure:8914: result: yes
configure:8918: checking SDL.h presence
configure:8933: gcc -E -I/usr/local/include/SDL -D_GNU_SOURCE=1 -Dmain=SDL_main conftest.c
configure:8939: $? = 0
configure:8953: result: yes
configure:8981: checking for SDL.h
configure:8989: result: yes
configure:9035: checking SDL_mixer.h usability
configure:9052: gcc -c -g -O2 -I/usr/local/include/SDL -D_GNU_SOURCE=1 -Dmain=SDL_main conftest.c >&5
configure:9058: $? = 0
configure:9072: result: yes
configure:9076: checking SDL_mixer.h presence
configure:9091: gcc -E -I/usr/local/include/SDL -D_GNU_SOURCE=1 -Dmain=SDL_main conftest.c
configure:9097: $? = 0
configure:9111: result: yes
configure:9139: checking for SDL_mixer.h
configure:9147: result: yes
configure:9166: checking for library containing Mix_OpenAudio
configure:9207: gcc -o conftest.exe -g -O2 -I/usr/local/include/SDL -D_GNU_SOURCE=1 -Dmain=SDL_main  conftest.c -lintl  >&5
C:/DOCUME~1/Wizard^^/LOCALS~1/Temp/ccYBbaaa.o: In function `SDL_main':E:/Coding/source/ufoai/conftest.c:45: undefined reference to `Mix_OpenAudio'
e:/Coding/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../libmingw32.a(main.o):main.c:(.text+0x106): undefined reference to `WinMain@16'
collect2: ld returned 1 exit status
configure:9213: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define SIZEOF_SHORT 2
| #define SIZEOF_INT 4
| #define SIZEOF_LONG 4
| #define SIZEOF_LONG_LONG 8
| #define SIZEOF_INTP 4
| #define HAVE_WINSOCK2_H 1
| #define HAVE_LIBWS2_32 1
| #define HAVE_AI_NUMERICSERV 0
| #define HAVE_STRNCASECMP 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_ZLIB_H 1
| #define HAVE_JPEGLIB_H 1
| #define HAVE_LIBINTL_H 1
| #define HAVE_SDL_H 1
| #define HAVE_SDL_MIXER_H 1
| /* end confdefs.h.  */
|
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char Mix_OpenAudio ();
| int
| main ()
| {
| return Mix_OpenAudio ();
|   ;
|   return 0;
| }
configure:9207: gcc -o conftest.exe -g -O2 -I/usr/local/include/SDL -D_GNU_SOURCE=1 -Dmain=SDL_main  conftest.c -lSDL_mixer  -lintl  >&5
e:/Coding/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../libmingw32.a(main.o):main.c:(.text+0x106): undefined reference to `WinMain@16'
collect2: ld returned 1 exit status
configure:9213: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define SIZEOF_SHORT 2
| #define SIZEOF_INT 4
| #define SIZEOF_LONG 4
| #define SIZEOF_LONG_LONG 8
| #define SIZEOF_INTP 4
| #define HAVE_WINSOCK2_H 1
| #define HAVE_LIBWS2_32 1
| #define HAVE_AI_NUMERICSERV 0
| #define HAVE_STRNCASECMP 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_ZLIB_H 1
| #define HAVE_JPEGLIB_H 1
| #define HAVE_LIBINTL_H 1
| #define HAVE_SDL_H 1
| #define HAVE_SDL_MIXER_H 1
| /* end confdefs.h.  */
|
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char Mix_OpenAudio ();
| int
| main ()
| {
| return Mix_OpenAudio ();
|   ;
|   return 0;
| }
configure:9241: result: no
configure:9251: error: You must have the SDL_mixer development libraries

"@ Destructavator" yes this is how you compile with  linux, but the MSYS+minGW32 gives you the option to use the same commands in windows.
« Last Edit: December 21, 2008, 09:18:20 am by Wizard^^ »

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: error: You must have the SDL_mixer development libraries
« Reply #10 on: December 21, 2008, 09:04:37 am »
the linker flags should (usually) be:
Code: [Select]
-lmingw32 -lSDLmain -lSDL -mwindows
patches are welcome ,)

Offline RudolfoWood

  • Rookie
  • ***
  • Posts: 85
    • View Profile
Re: error: You must have the SDL_mixer development libraries
« Reply #11 on: December 21, 2008, 10:37:42 am »
I don't know why during configure no sdl linker flags are used.
Step 5 of my walkthrough states a workaround - you could temporarly change sdl-config to include the linking flags in compile flags. You can remove that parts from Makefile -> SDL_CFLAGS after configure (it leads to many warnings "linking is not done" otherwise)

Offline Wizard^^

  • Rookie
  • ***
  • Posts: 22
    • View Profile
Re: error: You must have the SDL_mixer development libraries
« Reply #12 on: December 21, 2008, 10:59:52 am »
I looked at that before and could not find where to put "-lmingw32 -lSDLmain -lSDL -mwindows" from --libs to --cflags
as it is already there.
Code: [Select]
#!/bin/sh

prefix=/usr/local/cross-tools/i386-mingw32
exec_prefix=${prefix}
exec_prefix_set=no
libdir=${exec_prefix}/lib

#usage="\
#Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]"
usage="\
Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]"

if test $# -eq 0; then
      echo "${usage}" 1>&2
      exit 1
fi

while test $# -gt 0; do
  case "$1" in
  -*=*) optarg=`echo "$1" | LC_ALL="C" sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) optarg= ;;
  esac

  case $1 in
    --prefix=*)
      prefix=$optarg
      if test $exec_prefix_set = no ; then
        exec_prefix=$optarg
      fi
      ;;
    --prefix)
      echo $prefix
      ;;
    --exec-prefix=*)
      exec_prefix=$optarg
      exec_prefix_set=yes
      ;;
    --exec-prefix)
      echo $exec_prefix
      ;;
    --version)
      echo 1.2.12
      ;;
    --cflags)
      echo -I${prefix}/include/SDL -D_GNU_SOURCE=1 -Dmain=SDL_main
      ;;
    --libs)
      echo -L${exec_prefix}/lib  -lmingw32 -lSDLmain -lSDL  -mwindows
      ;;
    --static-libs)
#    --libs|--static-libs)
      echo -L${exec_prefix}/lib  -lmingw32 -lSDLmain -lSDL  -mwindows
      ;;
    *)
      echo "${usage}" 1>&2
      exit 1
      ;;
  esac
  shift
done

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: error: You must have the SDL_mixer development libraries
« Reply #13 on: December 21, 2008, 05:09:23 pm »
but it's not used - maybe the wrong sdl-config is used? (at least i didn't see the linker flags in the output you posted above - but maybe i was just blind)

Offline RudolfoWood

  • Rookie
  • ***
  • Posts: 85
    • View Profile
Re: error: You must have the SDL_mixer development libraries
« Reply #14 on: December 21, 2008, 09:57:50 pm »
that is what I tried to tell above: configure seems to use only cflags, not libs. Add them to cflags for configure. After configure run, these are added into makefile definitions, so you have to remove them there. I don't know whether this is something intended for configure or whether there should be some other checks for that.
Code: [Select]
[...]
    --cflags)
      echo -I${prefix}/include/SDL -D_GNU_SOURCE=1 -Dmain=SDL_main -lmingw32 -lSDLmain -lSDL  -mwindows