Category Archives: How to Fix

error: ‘for‘ loop initial declarations are only allowed in C99 mode

Using gcc to compile code

error: ‘for’ loop initial declarations are only allowed in C99 mode

note: use option -std=c99 or -std=gnu99 to compile your code

Error, because the increment is initialized directly in the for loop in GCC:

for(int i=0; i<len; i++)
{

}

This syntax is wrong in GCC. You must first define the I variable:

int i;
for(i=0;i<len;i++)
{
 
}

This is because GCC is based on the C89 standard. If you change to the C99 standard, you can define the I variable in the for loop and add it in the makefile

CFLAGS += -std=c99

MySQL — initialize failed to generate temporary password in error log after initialization

1. Version

1) Operating system version

cat /proc/version
Linux version 3.10.0-957.1.3.el7.x86_ 64 ( [email protected] ) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Thu Nov 29 14:49:43 UTC 2018

2) Database version

mysql –version
mysql   Ver 8.0.13 for linux-glibc2.12 on x86_ 64 (MySQL Community Server – GPL)

2. Problem description

   In versions after 5.7.6, MySQL will be generated in the error log after initialization (specify the — initialize parameter for initialization)   root@localhost Temporary password for the user. However, in this deployment, after starting mysql, it was found that no temporary password was generated in the errorlog

3. Problem solving

Later, it was found that the file in/etc/my.cnf was accidentally deleted   log_ The error parameter is commented out, so that when initializing the instance, all information is sent to the standard output. When MySQL is started, it is based on the log_ The default value of error generates a log_ error

Solve the software startup error while loading shared libraries: libgd. So. 2: cannot open shared object error

This error is reported when installing and starting nginx today: error while loading shared libraries: libgd. So. 2: cannot open shared object. I checked the relevant information on the Internet and solved it. This record also allows friends who encounter this problem to solve it quickly.

First, let’s talk about the solution to help those who are anxious to solve the problem. This is because the GD library is missing. Just install it. Installation method: 1. It is easiest to directly Yum install GD . 2. If Yum can’t search the installation package of GD library, you can manually download the corresponding RPM package at: http://rpmfind.net/linux/rpm2html/search.php?query=libgd.so.2 Install after downloading.

After installation, start nginx normally.

Let’s talk about the troubleshooting steps. You can refer to this method to solve similar problems in the future.

According to the error prompt, the libgd. So. 2 class library file failed to load. In this case, either lib is not installed or the installation location is not in the correct location. Check the class library files that nginx depends on through the LDD command:

ldd /usr/local/nginx/sbin/nginx  
linux-vdso.so.1 =>  (0x00007fffd5fb6000)  
libpthread.so.0 => /lib64/libpthread.so.0 (0x000000379e200000)  
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x000000393f200000)  
libpcre.so.0 => /lib64/libpcre.so.0 (0x00000033d5800000)  
libssl.so.10 => /usr/lib64/libssl.so.10 (0x0000003c60200000)  
libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x0000003df9800000)  
libdl.so.2 => /lib64/libdl.so.2 (0x000000390be00000)  
libz.so.1 => /lib64/libz.so.1 (0x0000003a25600000)  
libc.so.6 => /lib64/libc.so.6 (0x0000003a24200000)  
libgd.so.2 => not found  
/lib64/ld-linux-x86-64.so.2 (0x0000003a23e00000)  
libfreebl3.so => /lib64/libfreebl3.so (0x000000393ea00000)  
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x000000379fa00000)  
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x000000379d200000)  
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x000000379e600000)  
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x0000003df9c00000)  
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x0000003dfa800000)  
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x0000003dfa400000)  
libresolv.so.2 => /lib64/libresolv.so.2 (0x0000003a26a00000)  
libselinux.so.1 => /lib64/libselinux.so.1 (0x0000003df7c00000)  

This is not found, libgd. So. 2 = & gt; not found

A search on the Internet shows that this library comes with the GD installation package. If you confirm that GD has been installed, then this library is on the system. Find this file through the find command

find/-name 'libgd.so.2'

After finding it, you can copy it to the corresponding lib directory. If not, you can only reinstall it. How do we know the name of the package to be installed?Very simple. You can baidu search libgd. So. 2 to find out which installation package the library file comes from. Or you can check this website, http://rpmfind.net/linux/rpm2html/search.php?query=libgd.so.2 , it is found that this class library is from the GD installation package

First

Yum search GD search. If yes, you can directly Yum install GD

It’s OK. If not, you can also find the installation package that conforms to your own system through the website above (mainly depending on the operating system version number, 32-bit or 64 bit, and the new version is 64 bit), download it, and then install it through the corresponding command. Other class library files are missing, and the solution is similar.

1. Error running ‘application’ occurs when the command line is too long

    error running ‘application’

    1. First find the idea/workspace.xml file in the project, and then find the following line
    & lt; component name=“PropertiesComponent”>& lt;/component >

      then add the following line in the component tag
      & lt; property name=“dynamic.classpath” value=“true” />

      3. Just restart the project. Personal verification, can be used.

dpkg:error: dpkg frontend is locked by another process

An error occurred while installing the. DEB file with dpkg
dpkg: error: dpkg frontend is locked by another process
solution:

sudo rm /var/lib/dpkg/lock
sudo rm /var/lib/dpkg/lock-frontend 
sudo rm /var/cache/apt/archives/lock 

You can remove the error
re enter the command to install DEB files to install

sudo dpkg -i xxxxxx.deb

(26)RuntimeError: Error(s) in loading state_dict for YoloBody:size mismatch for yolo_head3.1.weight

Run B_ Yolov4 an error is reported when calculating the map:

RuntimeError: Error(s) in loading state_dict for YoloBody:
	size mismatch for yolo_head3.1.weight: copying a param with shape torch.Size([75, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([255, 256, 1, 1]).
	size mismatch for yolo_head3.1.bias: copying a param with shape torch.Size([75]) from checkpoint, the shape in current model is torch.Size([255]).
	size mismatch for yolo_head2.1.weight: copying a param with shape torch.Size([75, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([255, 512, 1, 1]).
	size mismatch for yolo_head2.1.bias: copying a param with shape torch.Size([75]) from checkpoint, the shape in current model is torch.Size([255]).
	size mismatch for yolo_head1.1.weight: copying a param with shape torch.Size([75, 1024, 1, 1]) from checkpoint, the shape in current model is torch.Size([255, 1024, 1, 1]).
	size mismatch for yolo_head1.1.bias: copying a param with shape torch.Size([75]) from checkpoint, the shape in current model is torch.Size([255]).

resolvent:

Check class in train.py_ Names and num_ The classes are all right, so it is determined that it is a problem in several programs called when calculating map. Finally, it is found that the number of classes in yolo.py is wrong,

"classes_path"      : 'model_data/coco_classes.txt',

Replace with:

"classes_path"      : 'model_data/voc_classes.txt',

ginseng https://github.com/bubbliiiing/yolo3-pytorch/issues/17

https://blog.csdn.net/nangg1047/article/details/116073131