ullaskunder3/Solution-to-graphics.h

Graphics.h doesn't work with gcc (Rev1, Built by MSYS2 project) 11.3.0

Closed this issue · 3 comments

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?

Thanks... :)

  • We can see you are using msys64 please don't , graphics.h library is old and need MinGW (32 bit) compiler !important
  • 😯 graphics.h(winBGI) works only on 32bit
  • You can see its saying incompatible
    image
    See even I use different compiler for different uses cases
    image

suggestion:


Let me know :)👍

Hey Thanks for quick reply, Yes it is working with gcc 6.3.0 installed via Old MinGW Installer.

Graphics.h in VS Code

Should i close this issue, sorry, this is first time i am using issues feature of github.

It's good to hear that... keep it up :) 👍