如何将控制台隐藏在makefile中
我在Raylib C ++中做点什么,每次打开.exe
文件时,控制台和Raylib窗口都会打开。如何停止/隐藏控制台打开。
这是当前的makefile。
default:
g++ ../Test.cpp -o Test -O2 -Wall -Wno-missing-braces -I ..\include/ -L ..\lib/ -lraylib -lopengl32 -lgdi32 -lwinmm
我的C ++文件
//@ Makefile: mingw32-make
//@ Exe: ./build/Test.exe
#include "include/raylib.h"
#include "include/raymath.h"
#include "include/physac.h"
int main() {
int screenWidth = 1000;
int screenHeight = 1000;
InitWindow(screenWidth, screenHeight, "Ball");
// void SetWindowIcon(Image "");
Vector2 ballPosition = {(float)screenWidth/2, (float)screenHeight/2};
SetTargetFPS(60);
while (!WindowShouldClose()) {
if (IsKeyDown(KEY_D)) ballPosition.x += 5.0f;
if (IsKeyDown(KEY_A)) ballPosition.x -= 5.0f;
if (IsKeyDown(KEY_W)) ballPosition.y -= 5.0f;
if (IsKeyDown(KEY_S)) ballPosition.y += 5.0f;
BeginDrawing();
ClearBackground(Color {255, 255, 255, 255});
DrawText("move the ball with wasd keys", 10, 10, 50, DARKGRAY);
DrawCircleV(ballPosition, 50, MAROON);
EndDrawing();
}
CloseWindow();
return 0;
}
I am making something in Raylib C++ and every time I open the .exe
file, the console and the raylib window opens up. How can stop/hide the console from opening up.
This is the makefile currently.
default:
g++ ../Test.cpp -o Test -O2 -Wall -Wno-missing-braces -I ..\include/ -L ..\lib/ -lraylib -lopengl32 -lgdi32 -lwinmm
My C++ file
//@ Makefile: mingw32-make
//@ Exe: ./build/Test.exe
#include "include/raylib.h"
#include "include/raymath.h"
#include "include/physac.h"
int main() {
int screenWidth = 1000;
int screenHeight = 1000;
InitWindow(screenWidth, screenHeight, "Ball");
// void SetWindowIcon(Image "");
Vector2 ballPosition = {(float)screenWidth/2, (float)screenHeight/2};
SetTargetFPS(60);
while (!WindowShouldClose()) {
if (IsKeyDown(KEY_D)) ballPosition.x += 5.0f;
if (IsKeyDown(KEY_A)) ballPosition.x -= 5.0f;
if (IsKeyDown(KEY_W)) ballPosition.y -= 5.0f;
if (IsKeyDown(KEY_S)) ballPosition.y += 5.0f;
BeginDrawing();
ClearBackground(Color {255, 255, 255, 255});
DrawText("move the ball with wasd keys", 10, 10, 50, DARKGRAY);
DrawCircleV(ballPosition, 50, MAROON);
EndDrawing();
}
CloseWindow();
return 0;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将
-mwindows
添加到链接标志。Add
-mwindows
to the linker flags.