WohlSoft / AudioCodecs

A portable collection of audio codecs as set of dependencies for SDL Mixer X audio library
14 stars 8 forks source link

Can not build SDL ... #14

Closed onon1101 closed 5 months ago

onon1101 commented 5 months ago

Problem

I can not build in my windows, the error show this in compile.txt ..., but i don't know what happen is...

CMakeFiles\SDL3-shared.dir\build.make:771: recipe for target 'CMakeFiles/SDL3-shared.dir/src/hidapi/SDL_hidapi.c.obj' failed
CMakeFiles\Makefile2:86: recipe for target 'CMakeFiles/SDL3-shared.dir/all' failed
[  8%] Building C object CMakeFiles/SDL3-static.dir/src/hidapi/SDL_hidapi.c.obj
[ 75%] Building C object libADLMIDI/CMakeFiles/ADLMIDI_version_check.dir/version_check.c.obj
CMakeFiles\SDL3-static.dir\build.make:771: recipe for target 'CMakeFiles/SDL3-static.dir/src/hidapi/SDL_hidapi.c.obj' failed
CMakeFiles\Makefile2:112: recipe for target 'CMakeFiles/SDL3-static.dir/all' failed
Makefile:154: recipe for target 'all' failed
CMakeFiles\SDL2HG.dir\build.make:84: recipe for target 'external/SDL2/src/SDL2HG-stamp/SDL2HG-build' failed
CMakeFiles\Makefile2:481: recipe for target 'CMakeFiles/SDL2HG.dir/all' failed
[ 75%] Built target ADLMIDI_version_check
Makefile:154: recipe for target 'all' failed

, and sometime i get this error too...( i will supply detail log later )

[CMakeFiles/SDL2-static.dir/src/video/windows/SDL_windowsvideo.c.obj] Error 1

Version

546b03d

Operating System

Windows 11 22H2 22621.3296

CMake version

cmake version 3.27.6

CMake Error

cmake -G "MinGW Makefiles" -DDOWNLOAD_SDL2_DEPENDENCY=ON -DCMAKE_INSTALL_PREFIX=%UserProfile%\MyLibs\ .. > result.txt

result.txt

AudioCodecs\build$ cmake --build . --config release --target install -- -j 2 > compile.txt

compile.txt <-- error in here

Wohlstand commented 5 months ago

Please try to use the -DUSE_LOCAL_SDL2=ON instead of the "download SDL2"...

The download option seems broken and I need to fix it soon. Anyway, the local build should be preferred.

Wohlstand commented 5 months ago

Actually, the problem was in the CMake script where the main was specified and right now it contains the WIP SDL3 which can't be used. I tweaked that CMake script and now it should download the SDL2 branch instead.

onon1101 commented 5 months ago

oh, thank for you help. I will check that.

onon1101 commented 5 months ago

emm... stil some error here

it say

ted only once for each function it appears in
In file included from c:\users\adven\audiocodecs\sdl2\src\sdl_internal.h:50:0,
                 from C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:21:
c:\users\adven\audiocodecs\sdl2\src\dynapi/SDL_dynapi_overrides.h:233:26: error: expected ';' before 'SDL_LoadFunction_REAL'
 #define SDL_LoadFunction SDL_LoadFunction_REAL
                          ^
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:508:58: note: in expansion of macro 'SDL_LoadFunction'
             Direct3DCreate9ExFunc = (Direct3DCreate9Ex_t)SDL_LoadFunction(*pD3DDLL, "Direct3DCreate9Ex");
                                                          ^~~~~~~~~~~~~~~~
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:510:17: error: unknown type name 'IDirect3D9Ex'
                 IDirect3D9Ex *pDirect3D9ExInterface;
                 ^~~~~~~~~~~~
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:511:30: error: called object 'Direct3DCreate9ExFunc' is not a function or function pointer
                 HRESULT hr = Direct3DCreate9ExFunc(D3D_SDK_VERSION, &pDirect3D9ExInterface);
                              ^~~~~~~~~~~~~~~~~~~~~
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:506:33: note: declared here
             Direct3DCreate9Ex_t Direct3DCreate9ExFunc;
                                 ^~~~~~~~~~~~~~~~~~~~~
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:514:26: warning: implicit declaration of function 'IDirect3D9Ex_QueryInterface' [-Wimplicit-function-declaration]
                     hr = IDirect3D9Ex_QueryInterface(pDirect3D9ExInterface, &IDirect3D9_GUID, (void **)pDirect3D9Interface);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:515:21: warning: implicit declaration of function 'IDirect3D9Ex_Release' [-Wimplicit-function-declaration]
                     IDirect3D9Ex_Release(pDirect3D9ExInterface);
                     ^~~~~~~~~~~~~~~~~~~~
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c: At top level:
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:577:5: warning: "HAVE_DXGI_H" is not defined [-Wundef]
 #if HAVE_DXGI_H
     ^~~~~~~~~~~
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c: In function 'SDL_DXGIGetOutputInfo_REAL':
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:614:6: warning: "HAVE_DXGI_H" is not defined [-Wundef]
 #if !HAVE_DXGI_H
      ^~~~~~~~~~~
CMakeFiles\SDL2.dir\build.make:2370: recipe for target 'CMakeFiles/SDL2.dir/src/video/windows/SDL_windowsvideo.c.obj' failed
mingw32-make.exe[5]: *** [CMakeFiles/SDL2.dir/src/video/windows/SDL_windowsvideo.c.obj] Error 1
CMakeFiles\Makefile2:141: recipe for target 'CMakeFiles/SDL2.dir/all' failed
mingw32-make.exe[4]: *** [CMakeFiles/SDL2.dir/all] Error 2
Makefile:134: recipe for target 'all' failed
mingw32-make.exe[3]: *** [all] Error 2
CMakeFiles\SDL2HG.dir\build.make:84: recipe for target 'external/SDL2/src/SDL2HG-stamp/SDL2HG-build' failed
mingw32-make.exe[2]: *** [external/SDL2/src/SDL2HG-stamp/SDL2HG-build] Error 2
CMakeFiles\Makefile2:481: recipe for target 'CMakeFiles/SDL2HG.dir/all' failed
mingw32-make.exe[1]: *** [CMakeFiles/SDL2HG.dir/all] Error 2
Makefile:154: recipe for target 'all' failed
mingw32-make.exe: *** [all] Error 2

this is my logs log.txt

I run again this command.

C:\Users\adven\AudioCodecs\build>cmake --build . --config release --target install -- -j 1
[  0%] Performing build step for 'SDL2HG'
[ 17%] Built target sdl_headers_copy
[ 17%] Built target SDL2main
[ 18%] Building C object CMakeFiles/SDL2.dir/src/video/windows/SDL_windowsvideo.c.obj
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c: In function 'D3D_LoadDLL':
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:501:72: error: unknown type name 'IDirect3D9Ex'
         typedef HRESULT (WINAPI* Direct3DCreate9Ex_t)(UINT SDKVersion, IDirect3D9Ex** ppD3D);
                                                                        ^~~~~~~~~~~~
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:506:13: error: unknown type name 'Direct3DCreate9Ex_t'
             Direct3DCreate9Ex_t Direct3DCreate9ExFunc;
             ^~~~~~~~~~~~~~~~~~~
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:508:38: error: 'Direct3DCreate9Ex_t' undeclared (first use in this function)
             Direct3DCreate9ExFunc = (Direct3DCreate9Ex_t)SDL_LoadFunction(*pD3DDLL, "Direct3DCreate9Ex");
                                      ^~~~~~~~~~~~~~~~~~~
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:508:38: note: each undeclared identifier is reported only once for each function it appears in
In file included from c:\users\adven\audiocodecs\sdl2\src\sdl_internal.h:50:0,
                 from C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:21:
c:\users\adven\audiocodecs\sdl2\src\dynapi/SDL_dynapi_overrides.h:233:26: error: expected ';' before 'SDL_LoadFunction_REAL'
 #define SDL_LoadFunction SDL_LoadFunction_REAL
                          ^
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:508:58: note: in expansion of macro 'SDL_LoadFunction'
             Direct3DCreate9ExFunc = (Direct3DCreate9Ex_t)SDL_LoadFunction(*pD3DDLL, "Direct3DCreate9Ex");
                                                          ^~~~~~~~~~~~~~~~
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:510:17: error: unknown type name 'IDirect3D9Ex'
                 IDirect3D9Ex *pDirect3D9ExInterface;
                 ^~~~~~~~~~~~
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:511:30: error: called object 'Direct3DCreate9ExFunc' is not a function or function pointer
                 HRESULT hr = Direct3DCreate9ExFunc(D3D_SDK_VERSION, &pDirect3D9ExInterface);
                              ^~~~~~~~~~~~~~~~~~~~~
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:506:33: note: declared here
             Direct3DCreate9Ex_t Direct3DCreate9ExFunc;
                                 ^~~~~~~~~~~~~~~~~~~~~
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:514:26: warning: implicit declaration of function 'IDirect3D9Ex_QueryInterface' [-Wimplicit-function-declaration]
                     hr = IDirect3D9Ex_QueryInterface(pDirect3D9ExInterface, &IDirect3D9_GUID, (void **)pDirect3D9Interface);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:515:21: warning: implicit declaration of function 'IDirect3D9Ex_Release' [-Wimplicit-function-declaration]
                     IDirect3D9Ex_Release(pDirect3D9ExInterface);
                     ^~~~~~~~~~~~~~~~~~~~
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c: At top level:
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:577:5: warning: "HAVE_DXGI_H" is not defined [-Wundef]
 #if HAVE_DXGI_H
     ^~~~~~~~~~~
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c: In function 'SDL_DXGIGetOutputInfo_REAL':
C:\Users\adven\AudioCodecs\SDL2\src\video\windows\SDL_windowsvideo.c:614:6: warning: "HAVE_DXGI_H" is not defined [-Wundef]
 #if !HAVE_DXGI_H
      ^~~~~~~~~~~
CMakeFiles\SDL2.dir\build.make:2370: recipe for target 'CMakeFiles/SDL2.dir/src/video/windows/SDL_windowsvideo.c.obj' failed
mingw32-make.exe[5]: *** [CMakeFiles/SDL2.dir/src/video/windows/SDL_windowsvideo.c.obj] Error 1
CMakeFiles\Makefile2:141: recipe for target 'CMakeFiles/SDL2.dir/all' failed
mingw32-make.exe[4]: *** [CMakeFiles/SDL2.dir/all] Error 2
Makefile:134: recipe for target 'all' failed
mingw32-make.exe[3]: *** [all] Error 2
CMakeFiles\SDL2HG.dir\build.make:84: recipe for target 'external/SDL2/src/SDL2HG-stamp/SDL2HG-build' failed
mingw32-make.exe[2]: *** [external/SDL2/src/SDL2HG-stamp/SDL2HG-build] Error 2
CMakeFiles\Makefile2:481: recipe for target 'CMakeFiles/SDL2HG.dir/all' failed
mingw32-make.exe[1]: *** [CMakeFiles/SDL2HG.dir/all] Error 2
Makefile:154: recipe for target 'all' failed
mingw32-make.exe: *** [all] Error 2

C:\Users\adven\AudioCodecs\build>
Wohlstand commented 5 months ago

Now I paid the attention to the build log, and I do see you trying to use the old MinGW toolchain:

-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0

You probably need to try out the MinGW-w64 which implements the more complete WinAPI: https://www.mingw-w64.org/. Download is here. At my projects I do use this thing.

P.S. If you want to build for Windows XP, you probably need mine toolchains:

I didn't yet tuned up newer toolchains yet.

onon1101 commented 5 months ago

oh, thanks. bcz i saw here... image

Wohlstand commented 5 months ago

I guess, I should clarify this to note the SDL2 will require MinGW-w64 thing.

onon1101 commented 5 months ago

it work. I appreciate your help very much. and I'm sorry my poor English To those people that meet the same problem, this is my logs success.txt

Wohlstand commented 5 months ago

Have fun! I am glad to help you :)

I'm sorry my poor English

Absolutely don't worry, mine isn't the best too (and it's not native). :)