Winlibs raylib.dll.rc.data linker error

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
Post Reply
Axle
Posts: 41
Joined: May 31, 2022 6:49
Location: Australia

Winlibs raylib.dll.rc.data linker error

Post by Axle »

Hi

I am attempting to compile raylib with FB current version "winlibs-mingw-w64-x86_64-9.3.0-7.0.0-r3-sjlj" and getting a linker error for the rc.data file. Wondering if anyone has encountered this or know how to correct it.
I have tried adding the CFLAG and LDFLAG -m64 but I still get the error. Any thoughts?

Code: Select all

C:\Dev-FreeBASIC\Winlibs\winlibs-mingw-w64-x86_64-9.3.0-7.0.0-r3-sjlj\raylib\src>mingw32-make V=1 -f Makefile PLATFORM=P
LATFORM_DESKTOP RAYLIB_MODULE_RAYGUI=TRUE RAYLIB_LIBTYPE=SHARED GRAPHICS=GRAPHICS_API_OPENGL_33
gcc -shared -o ../src/raylib.dll rcore.o rshapes.o rtextures.o rtext.o utils.o rglfw.o rmodels.o raudio.o raygui.o ./ray
lib.dll.rc.data  -static-libgcc -lopengl32 -lgdi32 -lwinmm -Wl,--out-implib,../src/libraylibdll.a
c:/dev-freebasic/winlibs/winlibs-mingw-w64-x86_64-9.3.0-7.0.0-r3-sjlj/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.3.0/..
/../../../x86_64-w64-mingw32/bin/ld.exe: i386 architecture of input file `./raylib.dll.rc.data' is incompatible with i38
6:x86-64 output
collect2.exe: error: ld returned 1 exit status
mingw32-make: *** [Makefile:489: raylib] Error 1
Axle
Coolman
Posts: 266
Joined: Nov 05, 2010 15:09

Re: Winlibs raylib.dll.rc.data linker error

Post by Coolman »

there are raylib packages compiled for all platforms on the official github. why not just use them!
Axle
Posts: 41
Joined: May 31, 2022 6:49
Location: Australia

Re: Winlibs raylib.dll.rc.data linker error

Post by Axle »

Hi Coolman

The pre-compiled binaries only contain raylib and I also want raygui and maybe physac. Other extras under consideration... Therefore I have to compile the dll/so myself. All fine under later versions of GCC such as V11.2.0.

I just thought compiling the shared library under the same version GCC as FB would reduce the risk of version errors.
So, If you think compiling raylib + raygui etc under the latest versions of GCC wont risk conflicts that's fine, but I have no way of confirming this at the moment :)

So, let me know if It is confirmed that I can use the latest GCC without conflicts in FB?
And still if anyone has any ideas as to why raylib wont compile under "winlibs-mingw-w64-x86_64-9.3.0-7.0.0-r3-sjlj" I would still be interested?

Axle
Last edited by Axle on Jul 02, 2022 9:17, edited 1 time in total.
Axle
Posts: 41
Joined: May 31, 2022 6:49
Location: Australia

Re: Winlibs raylib.dll.rc.data linker error

Post by Axle »

Update from discussion with Raysan5 (Raymon)

It looks like the source raylib.dll.rc.data is compiled as 32 bit and for some reason the raylib supplied w64devkit is forcing/defaulting to 32 bit.

As per raylib FAQ

Code: Select all

windres resource.rc -o resource.rc.data --target=pe-x86-64
windres raylib.dll.rc -o raylib.dll.rc.data --target=pe-x86-64
will result in a 64 bit compile under "winlibs-mingw-w64-x86_64-9.3.0-7.0.0-r3-sjlj"

So I may just ditch that "w64devkit" https://github.com/raysan5/raylib/relea ... .mingw.exe and go back to the TDM-Dragon or Winlibs build for everything ("winlibs-mingw-w64-x86_64-9.3.0-7.0.0-r3-sjlj" for anything FB Win)

Axle
Axle
Posts: 41
Joined: May 31, 2022 6:49
Location: Australia

Re: Winlibs raylib.dll.rc.data linker error

Post by Axle »

Hi, just update what I have done to solve most of the issues I have been having...

Quote as per post at raysan5/discussions
I gave up on raylib_installer_v4.0.mingw.exe.
Now using Winlibs. I am using "winlibs-mingw-w64-x86_64-9.3.0-7.0.0-r3-sjlj.7z" for FB V1.09.0 compatibility.

Folder structure:

C:\Winlibs\
\raylib-4.0.0\
\winlibs-mingw-w64-x86_64-9.3.0-7.0.0-r3-sjlj\mingw64\bin
Copy .\raygui-3.1\raygui.h to .\raylib-4.0.0\src\extras\raygui.h (Overwrite)

Batch launch the Makefile:

Code: Select all

REM Makefile laucher for 64-bit Compile.
REM Set the compiler and source path as required.
SET PATH=%PATH%;SET PATH=%PATH%;C:\Dev-FreeBASIC\Winlibs\winlibs-mingw-w64-x86_64-9.3.0-7.0.0-r3-sjlj\mingw64\bin
SET PATH=%PATH%;C:\Dev-FreeBASIC\Winlibs\raylib-4.0.0\src
REM Recompile the Resource file for Windows x86-64
windres raylib.dll.rc -o raylib.dll.rc.data --target=pe-x86-64
REM Using OpenGL V2.1 for VirtualBox compatability.
REM mingw32-make V=1 -f Makefile PLATFORM=PLATFORM_DESKTOP RAYLIB_MODULE_RAYGUI=TRUE RAYLIB_LIBTYPE=SHARED GRAPHICS=GRAPHICS_API_OPENGL_33
mingw32-make V=1 -f Makefile PLATFORM=PLATFORM_DESKTOP RAYLIB_MODULE_RAYGUI=TRUE RAYLIB_LIBTYPE=SHARED GRAPHICS=GRAPHICS_API_OPENGL_21
pause
Everything compiles as expected. .\src\extras\raylib.h is found and converted to raygui.c and copied to .\src\raylib.c
So no need to manually copy/create raylib.c, and no need to copy .\src\extras*.h to .\src

So all I can think of at the moment is some issue with raylib_installer_v4.0.mingw.exe, w64devkit and windows10 not playing nice with paths
¯\_(ツ)_/¯ ... Win10 can be a bit weird like that.
(P.S. I did check directory and user permissions for R/W)

I haven't yet tested this under the later Winlibs versions with DW2 or SEH yet.

I just posted this up in case anyone else reads the thread and can see what I did to solve the issue, with your guidance.
Much thanks

So ditching "w64devkit" build tools has got me back to a sane world where the compiler behaves as I would expect.
Axle
Post Reply