User:Csfore/Common Fixes
Even though this page is in the user namespace, corrections and additions are much appreciated! This is simply wiki policy, this page can be moved to the main wiki as soon as it achieves critical mass more.
Just a place for me to put common fixes that I've probably forgotten. Want to add something? Feel free!
configure: error: C compiler cannot create executables
Probably 90% of the time this occurs in Gentoo is due to a typo in a user's CFLAGS. In this example, app-editors/nano-8.1 will be used:
root #
emerge =app-editors/nano-8.1
checking whether the C compiler works... no configure: error: in `/var/tmp/portage/app-editors/nano-8.1/work/nano-8.1': configure: error: C compiler cannot create executables See `config.log' for more details !!! Please attach the following file when seeking support: !!! /var/tmp/portage/app-editors/nano-8.1/work/nano-8.1/config.log
Checking the file Portage has said to attach, make sure to search for "C compiler cannot create executables". This is because configure checks for a lot of known errors so it can be easy to mistake a known error for being the cause when it really isn't. In this example, this section is the real cause:
configure:6190: x86_64-pc-linux-gnu-gcc -march=native -02 -pipe -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs conftest.c >&5
x86_64-pc-linux-gnu-gcc: error: unrecognized command-line option '-02'
configure:6194: $? = 1
configure:6234: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU nano"
| #define PACKAGE_TARNAME "nano"
| #define PACKAGE_VERSION "8.1"
| #define PACKAGE_STRING "GNU nano 8.1"
| #define PACKAGE_BUGREPORT "nano-devel@gnu.org"
| #define PACKAGE_URL "https://www.gnu.org/software/nano/"
| #define PACKAGE "nano"
| #define VERSION "8.1"
| /* end confdefs.h. */
|
| int
| main (void)
| {
|
| ;
| return 0;
| }
configure:6239: error: in `/var/tmp/portage/app-editors/nano-8.1/work/nano-8.1':
configure:6241: error: C compiler cannot create executables
See `config.log' for more details
From this, the GCC error can be seen:
x86_64-pc-linux-gnu-gcc: error: unrecognized command-line option '-02'
Here, it appears that a 0 (zero) was used in place of an O (capital letter o, pronounced /ˈoʊ/ in IPA) in -O2
, which GCC does not recognize.
Correct this by changing -02
to -O2
CMake wont compile on switch to clang/gcc profile
This happens because CMake was linked to a different libstdc++.
Note: One of few times that --unmerge
is generally accepted.
root #
emerge -1 dev-libs/jsoncpp
root #
emerge --unmerge cmake
root #
emerge -1 cmake
QBitTorrent fails to compile
This happens because net-p2p/qbittorrent only compiles with net-libs/libtorrent-rasterbar version 1.2.19+ or 2.0.9+ and the latest stable libtorrent-rasterbar version is 1.2.18 or 2.0.8, and the qbittorrent ebuild is currently unmaintained. To fix it:
I believe that libtorrent-rasterbar has to be compiled with GCC in order for qbittorrent to pick up on it. I tested it on both and it seemed to turn out that way
root #
echo "=net-libs/libtorrent-rasterbar-1.2.19 ~amd64" > /etc/portage/package.accept_keywords/libtorrent-rasterbar
root #
emerge =net-libs/libtorrent-rasterbar-1.2.19
root #
emerge qbittorrent