-
Notifications
You must be signed in to change notification settings - Fork 20
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 to build on Windows 8/8.1/10/11 #52
Comments
Hello! Well, I made a last try with success, following the official guide "Build your own PHP on Windows", so it's recommended to read it first to get an overview of the build process. 1. Check the operating system I use is Windows 8.1, so this guide will work on 8.0, 10 or 11. 2. Install the IDE Visual Studio 2019 is required. The VS website will make you download the installer for Visual Studio Installer. Install and start it to really install the IDE, which will be in Available tab (the Community version is ok). 3. Install the compiler After previous step, inside Visual Studio Installer, in Installed tab, click on Modify button of Visual Studio Community 2019 element. Then, in Workloads tab, check Desktop development with C++ element, the right panel Installation details will be updated and uncheck all elements except MSVC v142 Build Tools - VS 2019 C++ for x64/x86 (more recent). In Individual components tab, write c++ in search box and check C++ core features, C++ 2019 Redistributable update, MSVC v142 Build Tools - VS 2019 C++ for x64/x86 (more recent), MSVC v142 - VS 2019 C++ Build Tools for x64/x86 (v14.20). The right panel will look like this: Installation details Visual Studio code editor Desktop development with C++ Click on Modify button located at the bottom to proceed. 4. Set up the PHP SDK Download it from this link. Extract it and rename the folder to 5. Set up the build directory Open a terminal inside the folder (I recommend ConEmu). Invoke the starter script:
Create the directory structure:
Now you will be located at 6. Set up PHP This guide is for PHP 8.0.11 x64 Non Thread Safe. Download the source code from this link. Extract it Change the current directory:
Now you will be located at Download dependencies:
Dependencies are located on a previous level, in 7. Set up SDL Download the development version from this link. Extract it and move the content of the folders as follows (I placed the folder at
8. Set up PHP-SDL Download it from this link. Move it to Extract it and rename the folder to Move the content of Inside D:\php-sdk\phpdev\vs16\x64\php-8.0.11-src\ext\sdl create a file named // vim:ft=javascript
ARG_ENABLE('sdl', 'Whether to enable SDL2 support', 'no');
if(PHP_SDL != 'no') {
CHECK_LIB("SDL2.lib", "sdl", PHP_SDL);
CHECK_LIB("SDL2main.lib", "sdl", PHP_SDL);
CHECK_LIB("SDL2test.lib", "sdl", PHP_SDL);
var sdl_sources = 'php_sdl.c blendmode.c cpuinfo.c error.c event.c filesystem.c glcontext.c joystick.c keyboard.c messagebox.c mouse.c mutex.c pixels.c platform.c power.c rect.c render.c rwops.c sdl.c shape.c surface.c timer.c version.c video.c window.c';
EXTENSION('sdl', sdl_sources, PHP_SDL_SHARED);
var sdl_headers = 'php_sdl.h blendmode.h cpuinfo.h error.h event.h filesystem.h glcontext.h joystick.h keyboard.h messagebox.h mouse.h mutex.h pixels.h platform.h power.h rect.h render.h rwops.h sdl.h shape.h surface.h timer.h version.h video.h window.h';
PHP_INSTALL_HEADERS('ext/sdl', sdl_headers);
AC_DEFINE('HAVE_SDL', 1);
} Edit the result = SDLCALL SDL_SaveBMP_RW(surface, rwops, 0); To: result = SDL_SaveBMP_RW(surface, rwops, 0); 9. Compile In your terminal, where you stayed, i.e., buildconf
configure --disable-all --disable-zts --enable-cli --enable-sdl=shared
nmake
nmake snap You will find the long wished DLL at following locations (are the same):
10. Test Download a fresh copy of PHP 8.0.11 x64 Non Thread Safe from this link. Extract it and rename the folder to Copy the DLLs:
Copy and rename the required INI file:
Edit extension_dir = "ext" Edit ...
;extension=pgsql
extension=sdl
;extension=shmop
... Open a new terminal and execute:
You have to view the following window: That's all. Note: You can download the DLLs from this link. |
@santiagolizardo I'm intrigued about removing |
@zorobabel Maybe with macros like #ifdef MINGW32 |
Hi!
I tried to compile the project to generate the DLL without luck, just got very very strange errors.
Please, can you share the right instructions?
BTW, compiling on Ubuntu is a breeze :D
The text was updated successfully, but these errors were encountered: