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

[build] Option to Remove Console #324

Closed
msmshazan opened this issue Jul 6, 2017 · 7 comments
Closed

[build] Option to Remove Console #324

msmshazan opened this issue Jul 6, 2017 · 7 comments

Comments

@msmshazan
Copy link
Contributor

Please add option to remove console for shipping build of the game.

@raysan5
Copy link
Owner

raysan5 commented Jul 6, 2017

Hiding the console is a compiler/linker configuration parameter.

When compiling with GCC, the parameter is -Wl,--subsystem,windows or just -mwindows

When compiling with MSVC (Visual Studio) use /SUBSYSTEM:WINDOWS /ENTRY:main on linker configuration.

@raysan5 raysan5 changed the title Option to Remove Console [build] Option to Remove Console Jul 6, 2017
@msmshazan
Copy link
Contributor Author

msmshazan commented Jul 8, 2017

@raysan5 I added the linker flags to MSVC you said but the i get these errors.

build.bat
main.cpp
glfw3.lib(win32_init.c.obj) : error LNK2001: unresolved external symbol __imp__free
glfw3.lib(vulkan.c.obj) : error LNK2001: unresolved external symbol __imp__free
glfw3.lib(wgl_context.c.obj) : error LNK2001: unresolved external symbol __imp__free
glfw3.lib(egl_context.c.obj) : error LNK2001: unresolved external symbol __imp__free
glfw3.lib(monitor.c.obj) : error LNK2001: unresolved external symbol __imp__free
glfw3.lib(win32_window.c.obj) : error LNK2001: unresolved external symbol __imp__free
glfw3.lib(win32_joystick.c.obj) : error LNK2001: unresolved external symbol __imp__free
glfw3.lib(win32_monitor.c.obj) : error LNK2001: unresolved external symbol __imp__free
main.obj : error LNK2001: unresolved external symbol __imp__free
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp__free
glfw3.lib(window.c.obj) : error LNK2001: unresolved external symbol __imp__free
glfw3.lib(input.c.obj) : error LNK2001: unresolved external symbol __imp__free
main.obj : error LNK2001: unresolved external symbol __imp__malloc
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp__malloc
main.obj : error LNK2001: unresolved external symbol _memcpy
glfw3.lib(win32_window.c.obj) : error LNK2001: unresolved external symbol _memcpy
main.obj : error LNK2001: unresolved external symbol __imp__memmove
raylib.lib(utils.obj) : error LNK2001: unresolved external symbol __imp__memmove
glfw3.lib(win32_joystick.c.obj) : error LNK2001: unresolved external symbol _memset
glfw3.lib(win32_monitor.c.obj) : error LNK2001: unresolved external symbol _memset
glfw3.lib(win32_init.c.obj) : error LNK2001: unresolved external symbol _memset
main.obj : error LNK2001: unresolved external symbol _memset
glfw3.lib(window.c.obj) : error LNK2001: unresolved external symbol _memset
glfw3.lib(init.c.obj) : error LNK2001: unresolved external symbol _memset
glfw3.lib(win32_window.c.obj) : error LNK2001: unresolved external symbol _memset
main.obj : error LNK2001: unresolved external symbol __imp__strchr
main.obj : error LNK2001: unresolved external symbol _strlen
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp__ftell
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp__fputc
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp__srand
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp__fopen
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp__fclose
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp__fseek
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp__rand
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp__strncpy
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp___chdir
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp__rewind
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp___getcwd
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp__fwrite
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp__fopen_s
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp__fputs
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp___time64
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp__fmaxf
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp__round
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp__fminf
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp__fread
raylib.lib(core.obj) : error LNK2001: unresolved external symbol __imp__strrchr
glfw3.lib(vulkan.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
glfw3.lib(wgl_context.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
glfw3.lib(egl_context.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
glfw3.lib(win32_window.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
glfw3.lib(win32_joystick.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
glfw3.lib(win32_monitor.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
glfw3.lib(win32_init.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
raylib.lib(textures.obj) : error LNK2001: unresolved external symbol __imp__calloc
glfw3.lib(window.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
glfw3.lib(input.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
glfw3.lib(monitor.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
raylib.lib(textures.obj) : error LNK2001: unresolved external symbol __imp__realloc
glfw3.lib(win32_monitor.c.obj) : error LNK2001: unresolved external symbol __imp__realloc
raylib.lib(textures.obj) : error LNK2001: unresolved external symbol __imp__strncmp
glfw3.lib(context.c.obj) : error LNK2001: unresolved external symbol __imp__strncmp
raylib.lib(textures.obj) : error LNK2001: unresolved external symbol __imp__strtol
raylib.lib(textures.obj) : error LNK2001: unresolved external symbol __imp__ldexp
raylib.lib(textures.obj) : error LNK2001: unresolved external symbol __imp__feof
raylib.lib(text.obj) : error LNK2001: unresolved external symbol __imp__fgets
raylib.lib(text.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsprintf
glfw3.lib(init.c.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsprintf
raylib.lib(text.obj) : error LNK2001: unresolved external symbol __imp__strstr
glfw3.lib(context.c.obj) : error LNK2001: unresolved external symbol __imp__strstr
glfw3.lib(win32_joystick.c.obj) : error LNK2001: unresolved external symbol __imp__strstr
raylib.lib(text.obj) : error LNK2001: unresolved external symbol __imp__strncat
raylib.lib(text.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
glfw3.lib(context.c.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vsscanf
raylib.lib(utils.obj) : error LNK2001: unresolved external symbol __imp__exit
raylib.lib(utils.obj) : error LNK2001: unresolved external symbol __imp____acrt_iob_func
raylib.lib(utils.obj) : error LNK2001: unresolved external symbol __imp____stdio_common_vfprintf
raylib.lib(utils.obj) : error LNK2001: unresolved external symbol __imp__frexp
glfw3.lib(monitor.c.obj) : error LNK2001: unresolved external symbol __imp___strdup
glfw3.lib(win32_window.c.obj) : error LNK2001: unresolved external symbol __imp___strdup
glfw3.lib(win32_joystick.c.obj) : error LNK2001: unresolved external symbol __imp___strdup
glfw3.lib(monitor.c.obj) : error LNK2001: unresolved external symbol __imp__qsort
glfw3.lib(win32_joystick.c.obj) : error LNK2001: unresolved external symbol __imp__qsort
glfw3.lib(monitor.c.obj) : error LNK2001: unresolved external symbol __libm_sse2_pow_precise
glfw3.lib(win32_joystick.c.obj) : error LNK2001: unresolved external symbol __libm_sse2_sqrt_precise
MSVCRT.lib(_ftol3_.obj) : error LNK2001: unresolved external symbol __except1
rfxgen.exe : fatal error LNK1120: 47 unresolved externals

@raysan5
Copy link
Owner

raysan5 commented Jul 8, 2017

In the project build linker options set:

/SUBSYSTEM:WINDOWS 
/ENTRY:mainCRTStartup

@CarlVitasa
Copy link

Hiding the console is a compiler/linker configuration parameter.

When compiling with GCC, the parameter is -Wl,--subsystem,windows or just -mwindows

When compiling with MSVC (Visual Studio) use /SUBSYSTEM:WINDOWS /ENTRY:main on linker configuration.

What is the equivalent for Mac?

@msmshazan
Copy link
Contributor Author

Hiding the console is a compiler/linker configuration parameter.

When compiling with GCC, the parameter is -Wl,--subsystem,windows or just -mwindows

When compiling with MSVC (Visual Studio) use /SUBSYSTEM:WINDOWS /ENTRY:main on linker configuration.

What is the equivalent for Mac?

Check this Stack overflow answer
https://stackoverflow.com/a/23870490

@Unterfrauner
Copy link

But the problem is that this does also disable other prints to the console

@ShreyasMahesh
Copy link

I am using GCC.
I used -Wl,--subsystem,windows and -mwindows but nothing works.

This is my makefile:

debug:
	g++ -c src/*.cpp -g -std=c++2b -Wall -m64 -I include && g++ *.o -o bin/debug/main -L lib -lraylib -lopengl32 -lgdi32 -lwinmm && start bin/debug/main.exe

release:
	g++ -c src/*.cpp -O3 -std=c++2b -Wall -m64 -Wl,--subsystem,windows -mwindows -I include && g++ *.o -o bin/release/main -L lib -lraylib -lopengl32 -lgdi32 -lwinmm && start bin/release/main.exe

clean:
	rm bin/debug/main.exe
	rm bin/release/main.exe

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

5 participants