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

How to organize the files into different folders and still make it Compile ? #1

Open
Universal-Flare opened this issue Jun 1, 2024 · 0 comments

Comments

@Universal-Flare
Copy link

As you have made the Raylib Stater Template for VSCODE-V2.
How do I make the build.bat file to work with the order of the VSCODE-V2 template.

I have change some of the file locations because I installed the Raylib files on different Paths.
This is my build.bat so far but I am receiving an error of "collect2.exe : bad file descriptor"

@echo off
cls

:: ***********************************************************************
   rem Batch file for compiling Raylib and/or RayGUI applications
:: ***********************************************************************

:Initialization
	SET "RAYLIB_DIR=F:\Projects\C++\LIBRARIES\Raylib"
	SET "CURRENT_DIR=..\%cd%"

	SET "INPUT_FILE=%1"
	SET "OUTPUT_FILE=%2"
	SET "INCLUDE_FILES= -I %CURRENT_DIR%\src -I %RAYLIB_DIR%\raylib\src"

	SET "COMPILER= %RAYLIB_DIR%\w64devkit\bin\g++.exe"
	SET "CFLAGS=%RAYLIB_DIR%\raylib\src\raylib.rc.data -Wall -std=c++14 -D_DEFAULT_SOURCE -Wno-missing-braces"
	SET "LDFLAGS= -lraylib -lopengl32 -lgdi32 -lwinmm"
	SET "EXTRAFLAGS="

	IF /I "%3"=="Release" SET EXTRAFLAGS=%EXTRAFLAGS% -O3


:Main
	echo(
	echo ^> Removing Previous Build
	echo ----------------------------
	IF EXIST "%3.exe" del /F "%3.exe"

	echo(
	echo ^> Compiling Program
	echo ----------------------------
	%COMPILER% -o "%OUTPUT_FILE%" *.cpp %INCLUDE_FILES% %CFLAGS% %LDFLAGS% %EXTRAFLAGS%

(My SublimeBuild File) - I changed the location of the build.bat file into the Packages folder of Sublime Text.

{
	"selector" : "main.cpp",

	"quiet": true,

	"shell" : true,

	"working_dir" : "$file_path",

	"variants": [
		{
		"name": "Compile",
		"cmd" : ["$packages\\User\\build.bat", "$file_name", "$file_base_name.exe"]
		},

		{
		"name": "Compile & Run",
		"cmd" : ["$packages\\User\\build.bat", "$file_name", "$file_base_name.exe", "&&", "$file_base_name.exe"], //, "&&", "$file_base_name.exe"
		},

		{
		"name": "Release",
		"cmd" : ["$packages\\User\\build.bat", "$file_name", "$file_base_name.exe", "Release"]
		}
	]
}

Anyways , I say thanks to anyone who helps cuz I might not be online on Githib at that time. 😀

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

1 participant