After wrestling with compiling the default `main.c` project that comes from `/raylib/projects/VSCode/` this was the post that finally made everything work! I decided to make an account and leave my two-cents in return.
Hopefully the OP @blitzcoder has long since figured-out his issues, but for those like me who are just starting out here is the solution that worked for me.
In the project-specific makefile, copied from the `/raylib/projects/VSCode/` starter-example, the file `
raylib.rc.data` is added to the CFLAGS argument list.
Look here:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 | # Additional flags for compiler (if desired)
#CFLAGS += -Wextra -Wmissing-prototypes -Wstrict-prototypes
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
# resource file contains windows executable icon and properties
# -Wl,--subsystem,windows hides the console window
CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data -Wl,--subsystem,windows
endif
ifeq ($(PLATFORM_OS),LINUX)
ifeq ($(RAYLIB_LIBTYPE),STATIC)
CFLAGS += -D_DEFAULT_SOURCE
endif
ifeq ($(RAYLIB_LIBTYPE),SHARED)
# Explicitly enable runtime link to libraylib.so
CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH)
endif
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
CFLAGS += -std=gnu99
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
#### ~ Trimmed for brevity ~
endif
|
I simply updated the line
| CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data -Wl,--subsystem,windows
|
to
| CFLAGS += -Wl,--subsystem,windows
|
.
For those who wish to know what is happening here the problem-file is a Windows Resource Compiler (.rc) file. It's compiled in such a way that our verson of compiler doesn't like. Visual Studio or the Microsoft Windows SDK will give you the 'rc' tool for compiling your own.
For more information see here:
https://docs.microsoft.com/en-us/...ws/win32/menurc/resource-compiler
For additional context I'm compiling everything with MinGW-m64:
http://mingw-w64.org/doku.php
I was trying anything to see what would stick, and while I was previously using the x86-64 (mingw64) set of tools/compilers I eventually ended-up getting a successful compile with the i686 option (mingw32). You can choose one or the other from the MinGW-m64 installer, and you can use it to install both if you wish. I don't think the specific version, mingw32 vs mingw64 would have mattered if I had just removed the CFLAGS reference earlier.
Thanks to the OP for the thread, and thanks to @raysan5 for the tip!