You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the following wont fix everyone but it is a bit more idiot proof for windows. I cant remember C much... its been 30 years after all but the batch file builds still suck but this should help. The only thing better would be creating a full installer imo
REM GO FROM HIGHEST TO LOWET TO GET THE CL VARS IE RUN THE LASTEST VCVARSALL.BAT
if exist "%PROGRAMFILES(X86)%\Microsoft Visual Studio\2018\Community\VC\Auxiliary\Build\vcvarsall.bat" (
echo "FOUND: Microsoft Visual Studio 2018"
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio\2018\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
goto FINAL
)
if exist "%PROGRAMFILES(X86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" (
echo "FOUND: Microsoft Visual Studio 2017"
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
goto FINAL
)
if exist "%PROGRAMFILES(X86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" (
echo "FOUND: Microsoft Visual Studio 14.0"
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
goto FINAL
)
if exist "%PROGRAMFILES(X86)%\Microsoft Visual Studio 13.0\VC\vcvarsall.bat" (
echo "FOUND: Microsoft Visual Studio 13.0"
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio 13.0\VC\vcvarsall.bat" x86
goto FINAL
)
if exist "%PROGRAMFILES(X86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" (
echo "FOUND: Microsoft Visual Studio 12.0"
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
goto FINAL
)
:FINAL
REM the the current working directory
SET CurrentDir=%cd%
SET INCLUDE_DIRS=/I"%CurrentDir%\sdl2\include"
SET OPTS=/c
SET DEBUG=/DDEBUG /Zi /Fddark.pdb
SET LIB_DIRS=/LIBPATH:"%CurrentDir%\sdl2\lib\x86"
SET LIBS=SDL2.lib SDL2main.lib
SET LINKER_OPTS=/SUBSYSTEM:console /DEBUG
cl %INCLUDE_DIRS% %OPTS% %DEBUG% dark.c
link %LIB_DIRS% %LINKER_OPTS% dark.obj %LIBS%
del *.obj
The text was updated successfully, but these errors were encountered:
the following wont fix everyone but it is a bit more idiot proof for windows. I cant remember C much... its been 30 years after all but the batch file builds still suck but this should help. The only thing better would be creating a full installer imo
@echo off
cls
del dark.exe
del *.pdb
REM GO FROM HIGHEST TO LOWET TO GET THE CL VARS IE RUN THE LASTEST VCVARSALL.BAT
if exist "%PROGRAMFILES(X86)%\Microsoft Visual Studio\2018\Community\VC\Auxiliary\Build\vcvarsall.bat" (
echo "FOUND: Microsoft Visual Studio 2018"
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio\2018\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
goto FINAL
)
if exist "%PROGRAMFILES(X86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" (
echo "FOUND: Microsoft Visual Studio 2017"
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
goto FINAL
)
if exist "%PROGRAMFILES(X86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" (
echo "FOUND: Microsoft Visual Studio 14.0"
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
goto FINAL
)
if exist "%PROGRAMFILES(X86)%\Microsoft Visual Studio 13.0\VC\vcvarsall.bat" (
echo "FOUND: Microsoft Visual Studio 13.0"
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio 13.0\VC\vcvarsall.bat" x86
goto FINAL
)
if exist "%PROGRAMFILES(X86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" (
echo "FOUND: Microsoft Visual Studio 12.0"
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
goto FINAL
)
:FINAL
REM the the current working directory
SET CurrentDir=%cd%
SET INCLUDE_DIRS=/I"%CurrentDir%\sdl2\include"
SET OPTS=/c
SET DEBUG=/DDEBUG /Zi /Fddark.pdb
SET LIB_DIRS=/LIBPATH:"%CurrentDir%\sdl2\lib\x86"
SET LIBS=SDL2.lib SDL2main.lib
SET LINKER_OPTS=/SUBSYSTEM:console /DEBUG
cl %INCLUDE_DIRS% %OPTS% %DEBUG% dark.c
link %LIB_DIRS% %LINKER_OPTS% dark.obj %LIBS%
del *.obj
The text was updated successfully, but these errors were encountered: