Tag Archives: Linux

[Solved] Linux Error: configure: error: C compiler cannot create executables

Prompt when compiling and configuring source code:

[wlf@wlf185 otp_src_21.3]$ ./configure --prefix=/home/wlf/erlang
Ignoring the --cache-file argument since it can cause the system to be erroneously configured
Disabling caching
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/wlf/otp_src_21.3':
configure: error: C compiler cannot create executables
See `config.log' for more details

See config.log:

configure:2576: $?= 0
configure:2565: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)
configure:2576: $?= 0
configure:2565: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2576: $?= 4
configure:2565: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:2576: $?= 4
configure:2596: checking whether the C compiler works
configure:2618: gcc    conftest.c  >&5
collect2: fatal error: cannot find 'ld'
compilation terminated.
configure:2622: $?= 1
configure:2660: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:2665: error: in `/home/wlf/otp_src_21.3':
configure:2667: error: C compiler cannot create executables
See `config.log' for more details

If LD can’t be found, let’s confirm:

[wlf@wlf185 otp_src_21.3]$ which ld
/usr/bin/which: no ld in (/usr/local/mongodb/bin:/opt/jdk/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/wlf/.local/bin:/home/wlf/bin)

There is no LD, isn’t it? Then switch to root and install it

[root@wlf185 bin]# yum install binutils
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Package binutils-2.25.1-22.base.el7.x86_64 already installed and latest version
Nothing to do
[root@wlf185 bin]# ld -v
-bash: ld: command not found

Seeing the ghost, I’m pretending, but I can’t use it. Come back

[root@wlf185 bin]# yum reinstall binutils
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package binutils.x86_64 0:2.25.1-22.base.el7 will be reinstalled
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
 Package                                Arch                                 Version                                            Repository                         Size
========================================================================================================================================================================
Reinstalling:
 binutils                               x86_64                               2.25.1-22.base.el7                                 DVD                               5.4 M

Transaction Summary
========================================================================================================================================================================
Reinstall  1 Package

Total download size: 5.4 M
Installed size: 22 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : binutils-2.25.1-22.base.el7.x86_64                                                                                                                   1/1 
failed to read link /usr/bin/ld: No such file or directory
  Verifying  : binutils-2.25.1-22.base.el7.x86_64                                                                                                                   1/1 

Installed:
  binutils.x86_64 0:2.25.1-22.base.el7                                                                                                                                  

Complete!
[root@wlf185 bin]# ld -v
GNU ld version 2.25.1-22.base.el7

OK, switch back to WLF user and recompile the configuration

The meaning of eagain and resource temporarily unavailable in Linux

After the project goes online, how to reduce customers’ doubts about the delivery?Here is the secret script of three moves>>>

In Linux development, we often encounter many errors (setting errno), among which eagain is a common one (for example, in non blocking operation)
literally, it’s a prompt to try again. This error often occurs when an application performs some non blocking operation (on a file or socket). For example, take o_ The Nonblock flag opens the file/socket/FIFO, if you do read operations continuously and there is no data to read. At this time, the program will not block until the data is ready to return. The read function will return an error eagain, indicating that your application has no data to read. Please try again later
for another example, when a system call (such as fork) fails due to insufficient resources (such as virtual memory), eagain will be returned to prompt it to call again (maybe it will succeed next time)
linux – non blocking socket programming deals with eagain error
when non blocking socket receives data in Linux, resource temporarily unavailable and errno code 11 (eagain) often appears. What does this mean
this indicates that you call the blocking operation in non blocking mode and return this error before the operation is completed. This error will not destroy the synchronization of the socket. Don’t worry about it. The next cycle will be followed by recv. Eagain is not an error for non blocking sockets. On VxWorks and windows, eagain is called ewouldblock
in addition, if the Eintr, that is, errno is 4, and the error description interrupted system call occurs, the operation should continue
finally, if the return value of recv is 0, it means that the connection has been disconnected, and our receiving operation should also end
iReadSizeOnce=read(iOpenCom,RxBuf+iReadSize,1024);
if (iReadSizeOnce != ZERO)
{
if (iReadSizeOnce != EAGAIN)
{
continue;
}
else
{
// stccomapilog. Logerror (“read serial port operation error”)
return(FUN_ ERROR);
}
}

Failed to create symbolic link ‘/usr/bin/utserver’: File exists with Error: Cannot find…

With multi-dimensional model as the core, let the factory digital transformation and upgrading “within reach”>>>

Nodejs download address (official website)

https://nodejs.org/en/download/

After downloading, it is a tar, XZ compressed package

Upload the compressed package to the Linux server through xftp

If I put it in the root directory

Using xshell to connect to remote server

CD to the current directory (the default is the root directory)

Execute the following command to unzip

Tar xvjf node-v10.16.3-linux-x64.tar.xz or tar XF node-v10.16.3-linux-x64.tar.xz

The difference is that xvjf can see the decompression, but XF can’t

xvJf

xf

Establishing a soft connection

Configure node

ln -s /root/node-v10.16.3-linux-x64/bin/node /usr/local/bin/node

Configure NPM

ln -s /root/node-v10.16.3-linux-x64/bin/npm /usr/local/bin/npm

PS: pay attention

/Root/node-v10.16.3-linux-x64/is the installation path of node

The last English of the soft connection should correspond to the English after bin (note that there is a space in the middle, such as/node/USR)

If the following error occurs when executing the command, such as NPM install Vue

Error: Cannot find module ‘/root/node-v10.16.3-linux-x64/install’

Then it’s possible that you made a mistake when setting up the soft connection

PS: pay attention

If a soft connection is established (the last English of the soft connection should follow bin, for example: ln – S/root/node-v10.16.3-linux-x64/bin/node/usr/local/bin/NPM)

Congratulations (when you execute node – V or NPM – V, you will report an error when you execute NPM install Vue)

At this time, you may be re executing the soft connection(

ln: failed to create symbolic link ‘/usr/local/bin/npm’: File exists)

The reason is already related in your/usr/local/bin/NPM

terms of settlement:

ln -sf /root/node-v10.16.3-linux-x64/bin/npm /usr/local/bin/npm

The references are as follows:

https://askubuntu.com/questions/379647/failed-to-create-symbolic-link-usr-bin-utserver-file-exists

OK, solve it

To configure Taobao image

npm install -g cnpm –registry= https://registry.npm.taobao.org

Configure soft connection

ln -s /root/node-v10.16.3-linux-x64/bin/cnpm /usr/local/bin/cnpm

[Solved] Linux No access to the system error: Failed to load SELinux policy. Freezing

Cause of error

SELinux is shut down by configuration, resulting in misoperation

The value of the "SELINUX" parameter in the configuration file /etc/selinux/config should be changed to
# SELINUX=enforcing Original configuration
SELINUX=disabled Correct

However, "SELINUXTYPE" is mistaken for "SELINUX" and the SELINUXTYPE parameter is set as follows
#SELINUXTYPE=targeted Original configuration This does not need to be changed.
SELINUXTYPE=disabled Error

Wrong result

After restart, the machine will report a failed to load SELinux policy. Freezing error, which causes it to fail to start all the time

Solution:

1. On the startup page, select the kernel you want to start and press e to enter grub edit page

2. Find the line linux16 in lang = zh_ Cn.utf-8 space plus SELinux = 0 or forcing = 0 (Note: I joined SELinux = 0 to take effect.)

3. Then start with Ctrl + X to see the familiar login interface

4. Modify SELinux configuration file and close SELinux properly

vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#    enforcing - SELinux security policy is enforced.
#    permissive - SELinux prints warnings instead of enforcing.
#    disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#    targeted - Targeted processes are protected,
#    minimum - Modification of targeted policy. Only selected processes are protected. 
#    mls - Multi Level Security protection.
SELINUXTYPE=targeted

After modification, restart

Grub cannot be started after Linux is installed

Why can’t you stop buying 618?From the technical dimension to explore>>>

After using unetbootin to make a startup USB disk and install Linux, there is a problem in the installation process. After restart, it will display:
error: invalid arch independent elf magic.
grub rescue & gt

The solution is as follows:

After booting with USB flash drive

1. Check the partition

sudo fdisk -lu /dev/sda

The display is as follows:

Disk /dev/sda: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes/512 bytes

I/O size (minimum/optimal): 512 bytes/512 bytes

Disk identifier: 0xde6c93b8

Device Boot Start End Blocks Id System

/dev/sda1 63 58589054 29294496 83 Linux

/dev/sda2 58589184 976773119 459091968 5 Extended

/dev/sda5 58591232 967903231 454656000 83 Linux

/dev/sda6 967905280 976773119 4433920 82 Linux swap/Solaris

2. Mount the system as a partition of Linux

Sudo mount/dev/sdax/MNT # x is the partition where/is located

Sudo mount/dev/sdax/MNT/boot ᦇ when/boot is a separate partition

If there is no/MNT/boot, you can use MKDIR to create it

3. Repair grub

sudo grub-install –root-directory=/mnt /dev/sda

References:

http://blog.sina.com.cn/s/blog_ a2d4803001013vqk.html

When there is no file or command when using grub install, try the following methods:
reason: grub does not find the command file in the partition where the system is located
1. Restart grub save # the error message is error: file not found
2. Use set command to view prefix and root
3. Use LS command to view hard disk partition # display (HD0, msdos1)
(HD0, Msdos1) is equivalent to sda1, and so on
4. Find the location of the system and grub command file one by one on the hard disk partition
system search: LS (HD…)/# be careful not to lose ‘/’
# if there are many system files in the result, it may be the partition where the system is located
# but in most cases, because the partition has been selected when installing the system, Therefore, this step is mainly to verify the
grub command file search: LS (HD…)/boot/grub
?If there are a large number of mod files, it is the location of grub command file
5. According to the results of the previous step, set prefix and root
set prefix = (HD…)/boot/grub # grub command file location
set root = (HD…) # system file partition
6 Insmod normal # load normal module
7, normal # enter normal mode
8, insmod Linux # load Linux command module
9, Linux/boot/vmlinuz -… Root =/dev/sdxy ro # load Linux core
# vmlinuz -… File should be in system file/boot, you can use tab to automatically complete
# sdxy is the partition of the system, such as sda1. It should be determined according to the previous search results
# do not lose the last ‘ro’
10, initrd/boot/initrd -… # load initrd
11, boot # start the system
12, the previous changes are not actually written to grub, so you need to save the settings in the boot system
you can use updata grub and grub install to repair

Reference materials:
1 https://help.ubuntu.com/community/Grub2/Troubleshooting

Attachment: in addition to the above methods, you can use boot repair
boot repair is a grub repair tool with graphical interface
it is recommended to download ISO file, burn boot disk or make boot U disk
for specific information, please refer to: https://help.ubuntu.com/community/Boot-Repair

Addrconf (netdev) appears in cable network card under Linux_ Up: eth0: link is not ready

Open source software supply chain lighting plan, waiting for you>>>

addrconf (netdev) appears on the cable network card under Linux_ Up): eth0: link is not ready

Reference article:

(1) Addrconf (netdev) appears in cable network card under Linux_ Up: eth0: link is not ready

(2) https://www.cnblogs.com/dakewei/p/9082942.html

Let’s make a note.

Linux: MySQL Start Error: Starting MySQL.Manager of pid-file quit without updating file.[FAILED]

Just after installing mysql, the following error will be reported at startup:

StartingMySQL.Managerofpid-filequitwithoutupdatingfile.[FAILED]

Solve the starting mysql.manager of PID file quit without updating file. [failed]

Try various methods found from Google in turn, and find that you can solve the problem by executing the following MySQL initialization command:

/usr/local/mysql/bin/mysql_install_db--user=mysql

The following is a collection of solutions to this problem found from Google. Maybe the causes of the problems encountered by everyone will be different for reference:

1、 View error log

The error log is the direction light for us to solve the problem. Without the direction light, we have no direction

I had an error in the installation log once, and there was such an error:

/usr/local/mysql/bin/mysqld:errorwhileloadingsharedlibraries:libstdc++.so.5:cannotopensharedobjectfile:Nosuchfileordirectory

Obviously, the library file libstdc + +. So. 5 is missing. At this time, we can search for the package installation related to libstdc

2、 Maybe it’s SELinux

If it is a CentOS system, SELinux will be turned on by default. At this time, you can turn it off first, open/etc/SELinux/config, change SELinux = enforcing to SELinux = disabled, save the disk, exit and restart the machine

3、 Residual data

It may also be the second time that MySQL is installed on the machine, and some residual data affects the startup of the service. Go to the data directory/data of MySQL, and if there is mysql-bin.index, delete it as soon as possible. It is the culprit

4、 Determine the permissions of the data directory

The data directory is generally & lt; prefix>/ Data, check its ownership. If it is not the owner of MySQL, users and groups of MySQL will be created when installing mysql. At this time, users and groups should be modified

chown-Rmysql:mysql/var/data

5、 No data directory specified

When MySQL does not specify a configuration file, it will use the/etc/my.cnf configuration file. Please open this file to see if there is a specified data directory (dataDir) under the [mysqld] section. If not, set this line under [mysqld]:

datadir=/usr/local/mysql/data

6、 And the MySQL process is running

If this is the second time to install MySQL on the machine, it is very likely that this situation will occur. At this time, there is likely to be a MySQL process running on the system. You can execute the following commands to view the data:

ps-ef|grepmysql

If the result is more than one line, kill it as soon as possible

7、 What’s wrong with the skip federated field

You can check the/etc/my.cnf file to see if there are any skip federated fields that have not been commented out. If so, comment them out immediately

8、 The error log directory does not exist

Maybe you don’t know where the MySQL error log is right now?At this time, you can execute the command to view:

cdmysql/bin
./mysql_safe

At this time, an error will be reported, and the error will be displayed in the error, and the error will be written in the file of the directory. Here, check whether the directory and the file are in, and then solve it according to the log instructions. If not, create the directory and modify the permissions and ownership. Generally, it will be/var/lib/MySQL/MySQL. Error. Note that mysql. Error does not need to be created

cd/var/lib
mkdirmysql
chmod777mysql
chownmysql:mysqlmysql

Now try again. If you still can’t, leave a message for you to see

9、 Maybe it’s data/mysql-bin.index

Antecedent: because the hard disk is full, MySQL can’t start. Log in to have a look and find out why. Delete the log file of MySQL, restart mysql, and find an error: starting mysql.manager of PID file quit without updating file. [failed]

There are many explanations for this reason on the Internet, but none of them are what I want to say. The reason I want to say is actually idiotic: data/mysql-bin.index is not deleted. Data/mysql-bin.index is the file where the index of log file is stored. It is obviously impossible to delete the log file without processing the index file of log file

Delete the data/mysql-bin.index file, and then service mysqld start

 

linux find: missing argument to `-exec’

Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>

When using the find command in Linux, an error is reported: find: missing argument to ‘- exec’

The specific execution commands are as follows:

Shell code

find/u03-nameserver.xml-execgrep’9080′{}\;

The purpose is to find the file named server.xml in the directory of/u03, and grep search is carried out according to the search results, which contains 9080 text

-The format of exec is:

Shell code

-execcommand{}\;

There must be a space between {} and \, otherwise the above error will be reported

Re execute the command after adding a space:

Shell code

find/u03-nameserver.xml-execgrep’9080′{}\;