Graphics.h doesn't work with gcc (Rev1, Built by MSYS2 project) 11.3.0
Closed this issue · 3 comments
Prakash4844 commented
Hey first of all I would like to express gratitude to this repo and its author.
I tried to set up graphic.h and in Visual Studio code, but code doesn't compile with the following error.
> Executing task: C/C++: g++.exe build active file <
Starting build...
C:\msys64\mingw64\bin\g++.exe -g "D:\Users\Zaphkil!\Documents\VS Code\C++ Graphics\Home\src\example.cpp" -o "D:\Users\Zaphkil!\Documents\VS Code\C++ Graphics\Home\build\example.exe" -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../lib/libbgi.a when searching for -lbgi
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../lib\libbgi.a when searching for -lbgi
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../libbgi.a when searching for -lbgi
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../..\libbgi.a when searching for -lbgi
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:\msys64\mingw64\x86_64-w64-mingw32\bin\../../../mingw64/lib/libbgi.a when searching for -lbgi
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:\msys64\mingw64\x86_64-w64-mingw32\bin\../../../mingw64/lib\libbgi.a when searching for -lbgi
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../lib/libbgi.a when searching for -lbgi
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../libbgi.a when searching for -lbgi
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:\msys64\mingw64\x86_64-w64-mingw32\bin\../../../mingw64/lib/libbgi.a when searching for -lbgi
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lbgi: No such file or directory
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../lib/libbgi.a when searching for -lbgi
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../libbgi.a when searching for -lbgi
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:\msys64\mingw64\x86_64-w64-mingw32\bin\../../../mingw64/lib/libbgi.a when searching for -lbgi
collect2.exe: error: ld returned 1 exit status
Build finished with error(s).
Terminal will be reused by tasks, press any key to close it.
I am using gcc which was downloaded through msys2.
graphics.h works as intended with gcc 6.3.0 that is downloaded through mingw64 installer.
How can i fix this issue?
ullaskunder3 commented
Thanks... :)
- We can see you are using
msys64
please don't ,graphics.h
library is old and needMinGW
(32 bit) compiler !important - 😯
graphics.h(winBGI)
works only on 32bit - You can see its saying incompatible
See even I use different compiler for different uses cases
suggestion:
- Install right GNU compiler in this case MinGW link -> sourceforge link
- Follow the instruction STEPS
Let me know :)👍
Prakash4844 commented
ullaskunder3 commented
It's good to hear that... keep it up :) 👍