I am unable to install the package capt-src
package from AUR. It is the official driver provided by Canon for some of its printers such as LBP2900B.
I get the following error when compiling this package (last few lines).
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/var/tmp/pamac-build-apoorvpotnis/capt-src/src/cndrvcups-common-3.21/cngplp':
configure: error: C compiler cannot create executables
See `config.log' for more details
==> ERROR: A failure occurred in package().
Aborting...
What is the problem? Is there any problem with permissions? Should I change the permissions of the /var/tmp/pamac-build-apoorvpotnis/capt-src/src/cndrvcups-common-3.21/cngplp
directory? Or do I need to install an older version of gcc
?
Is a binary available for this package? As stated on the AUR page, the driver is old (2017) and it may not properly compile with newer versions of gcc
.
Did you read the AUR comments on the page?
The pinned on from 2020:
Do not expect this driver to work in the near future if Canon doesn’t release a new version soon. This driver is from 2017 and the GCC environment started deprecating a lot of stuff used by this driver. Please, ask for better Linux support to Canon.
There is not much else to do. You could try the open source re-implementation AUR (en) - captdriver-git where the first comment tells you:
Just install it for Canon LBP2900, works.
Yes, I have read it. I have also installed the other driver, but it does not have all the options the official driver provides (I am mainly interested in increasing toner density; the prints from the open source driver look faint). Since it worked in the past (I had successfully installed it around 6 months back), I thought there would be some way to make it work.
Is there a way to change the makefile of the capt-src package to use a previous version of gcc for compilation purposes?
You could compile it with an “older” GCC compiler. But this is not for the faint of heart. 
Hmm. Do you know of any or resource to do so? I shall take a look if it looks doable for me.
That is not the area of my expertise.
However, a lot of different versions of the GCC are available in the AUR. As far as I know, they can be installed and used in parallel.
trizen -Ss gcc|grep -E 'aur/gcc[0-9]+ '
** GET https://aur.archlinux.org/rpc?v=5&type=search&arg=gcc ==> 200 OK
aur/gcc43 4.3.6-8 [40+] [0.00%] [30 Sep 2021]
aur/gcc44 4.4.7-6 [68+] [0.00%] [30 Sep 2021]
aur/gcc45 4.5.4-3 [1+] [0.00%] [29 Sep 2021]
aur/gcc46 4.6.4-4 [15+] [0.00%] [25 Sep 2022]
aur/gcc47 4.7.4-2 [21+] [0.00%] [28 Sep 2021]
aur/gcc48 4.8.5-1 [11+] [0.00%] [28 Sep 2021]
aur/gcc49 4.9.4-3 [21+] [0.00%] [22 Feb 2023]
aur/gcc10 10.4.0-1 [2+] [0.00%] [24 Apr 2023]
aur/gcc6 6.5.0-8 [21+] [0.02%] [23 Apr 2023]
aur/gcc5 5.5.0-3 [16+] [0.08%] [24 Sep 2022]
aur/gcc8 8.5.0-2 [8+] [0.34%] [11 Jul 2022]
aur/gcc7 7.5.0-4 [out-of-date] [17+] [0.67%] [19 May 2022]
aur/gcc9 9.5.0-1 [9+] [0.84%] [5 Feb 2023]
aur/gcc11 11.3.0-6 [2+] [1.07%] [13 Apr 2023]
But you’d rather have someone who regularly cross compiles to help you. They are used to the problems with different versions and the associated libraries and will point with their fingers at the right points
