Category Archives: How to Fix

Solutions to error c2143: syntax error: missing ‘;’ before ‘type’ in C + + program compilation

People make the rules. Why didn’t I know about QAQ?(> The man & lt; ). ~ Purr…
In pure C, variable declarations must come first in a block of code

    found a problem when running the program, VC 6.0 compiler C language is always prompted with an error: error C2143: syntax error: missing ‘; ‘before’ type ‘. The solution is to put the declaration of all variables before the executable code. The problem occurs because the file is saved in.c format. It will compile normally if it is in CPP format. If you change it to.cpP, it will work, regardless of where your variable is declared. * Generally in ANSI C or C++, it is allowed to define variables at any time in executable code, but in K& It’s not allowed in R C, and that’s why we have this error. VC6.0, VS2008 are used K& R C to implement the C language, so the compilation process will report errors. No such File or Directory appears about C free 5. Wait for a few mistakes to appear together. Solution: If the name of the installation directory has Spaces, the system may not find the path.
    we can try to change the name of the installation directory to simple, no Spaces.

I am so happy that the problem that has been bothering me has been solved. Only in the process of solving the problem can I feel that kind of happiness. I hope it will be helpful to those who have the same problem.
Wrote by markpain 20160908

error LNK2038: mismatch detected for ‘RuntimeLibrary’: value ‘MTd_StaticDebug’ doesn’t match value ‘

I see all kinds of solutions on the web, but my reason is to add extra libraries.
Removing the following libraries from the configuration solves the problem. In fact, opencV3.0 configuration becomes as simple as adding these two libraries
opencv_ts300d.lib
opencv_world300d.lib

These libraries do not have to be added.
IlmImfd.lib libjasperd.lib

libjpegd.lib

libpngd.lib

libtiffd.lib

libwebpd.lib

opencv_calib3d300d.lib

opencv_core300d.lib

opencv_features2d300d.lib

opencv_flann300d.lib

opencv_highgui300d.lib

opencv_imgcodecs300d.lib

opencv_imgproc300d.lib

opencv_ml300d.lib

opencv_objdetect300d.lib

opencv_photo300d.lib

opencv_shape300d.lib

opencv_stitching300d.lib

opencv_superres300d.lib

opencv_video300d.lib

opencv_videoio300d.lib

opencv_videostab300d.lib

zlibd.lib

Linux GCC compilation error: “collect2: LD returned 1 exit status”

bmeta_info.cpp:4280: undefined reference to ‘crypt’
collect2: ld returned 1 exit status
Information found online shows:

Undefined reference to error: this type of error is in the process of connection, there may be two reasons: one is the user to define a function or global variable in a source code file that is not compile, link, or simply has not been defined, it requires the user to modify source program according to the practical situation, presents the definition of a global variable or function body; The second is that the undefined symbol is a standard library function, which is used in the source program, and the corresponding library name is not given during the connection process, or the directory name of the archive has a problem

Use the Man crypt command to find the following information:

GNU EXTENSION
       The glibc2 version of this function has the following additional features.  If salt is a character string starting with the three characters "$1$" followed by at most eight characters, and optionally terminated by "$", then instead of using  the  DES  machine, the  glibc crypt function uses an MD5-based algorithm, and outputs up to 34 bytes, namely "$1$<string>$", where "<string>" stands for the up to 8 characters following "$1$" in the salt, followed by 22 bytes chosen from the set [a–zA–Z0–9./].  The entire key is significant here (instead of only the first 8 bytes).
       Programs using this function must be linked with -lcrypt.

Program using this function must be linked with -lcrypt. The program must be linked with -lcrypt
Reference: [http://blog.sina.com.cn/s/blog_64c238860100wzoo.html]

Error parsing XML: error after document element

Many developers may be warning about errors like Error parsing XML: junk after document element, where Android123 hints that usually legal XML files have only one parsing node, such as the parsing node

< android123>
& lt; item1/>
& lt; item2/>
& lt; item3/>
< /android123>
If you make a mistake like an Error parsing XML: junk after document element, your focus may be to have multiple nodes at the root, such as Parsing XML
& lt; android123>
& lt; item1/>
< /android123>
< android123>
& lt; item2/>
& lt; item3/>
< /android123>
 
 

XML cannot be parsed, because it may not be written in the correct XML format, considering that the root node is not correct.

From:
the Error parsing XML: junk after the document element such mistakes – CSDN blog
https://blog.csdn.net/sunmoon631/article/details/6438617

Error when connecting to database: DB2 SQL error: sqlcode = – 204, sqlstate = 42704, sqlerrmc= YXUAT.CUST_ BLK_ REL, DRIVER=4.25.13

DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC= yxuat. CUST_BLK_REL, DRIVER=4.25.13

Reason: When using MyBATIS, the remote database was connected, and the login user did not specify which schemas to use, that is, the user name was not specified. This led to the fact that Mybaits could not find the schemas we wanted, so it reported an error.
Solution 1: When you write SQL statements, you simply add schemas before the table names in the SQL
For example: SELECT * from cmis_uat1.cust_blk_rel
Solution 2: Add schemas when configuring datasource.
For example: spring: a datasource: url: JDBC: db2:// 10.10.0.36:50000/HNCKC: currentSchema = CMIS_UAT1; username: yxuat password: xfjr2016

DB2 create table error – 104 42601 illegal symbol encountered in SQL statement

Use PowerDesigner to design the database table, put the SQL statement generated by it into DB2 for execution, and report an error: an invalid symbol was encountered in the 104 42601 SQL statement
Some SQL statements are as follows:
create table user
(
UserId int the not null,
The username varchar null,
Hobby varchar null,
Constraint PK_USER primary key clustered (userId)
);
Upon verification, it was found that the above SQL statement set the field to NULL, which cannot be written in DB2.

Error ora-00600 [ksfd] in logical standby database of DataGuard_ DECAIOPC]

I just arrived at the company this morning and found the following error in the alarm log of a logic backup library:

Fri Nov 25 07:44:08 2011

Errors in file /home/oracle/admin/cms2009/bdump/cms2009_lsp0_19249.trc:

ORA-12801: error signaled in parallel query server P004

ORA-00600: internal error code, arguments: [kollasg:client lob on server], [], [], [], [], [], [], []

LOGSTDBY Apply process P005 pid=47 OS id=19263 stopped

Errors in file /home/oracle/admin/cms2009/bdump/cms2009_lsp0_19249.trc:

ORA-12801: error signaled in parallel query server P000

ORA-00600: internal error code, arguments: [KSFD_DECAIOPC], [0x24C52A500], [], [], [], [], [], []

LOGSTDBY Apply process P005 pid=47 OS id=19263 stopped

LOGSTDBY Apply process P004 pid=46 OS id=19261 stopped

LOGSTDBY Apply process P009 pid=50 OS id=19271 stopped

LOGSTDBY Apply process P010 pid=51 OS id=19273 stopped

LOGSTDBY Apply process P008 pid=49 OS id=19269 stopped

Fri Nov 25 07:44:14 2011

TLCR process death detected. Shutting down TLCR

So immediately check:

select * from v$Logstdby_state;

Finding that the logging application has stopped, you attempt to restart its logging application.

alter database start logical standby apply immediate;

The log application was found to be in good working order.

Since then, I have been searching for the cause of the error.
may be due to a bug:

Bug 7312623: Ora-00600 [KSFD_DECAIOPC] ON LOGICAL STANDBY DATABASE.

From “ITPUB blog” link: http://blog.itpub.net/23073818/viewspace-712043/, if you want to reprint, please indicate the source, otherwise will be investigated for legal responsibility.

Reproduced in: http://blog.itpub.net/23073818/viewspace-712043/

Expanding the file system based on XFS in LVM

did not contact CentsOS 7 before, do not understand its changed characteristics, accidentally in centos 7 contact LVM, the method to create LVM and 6 is no different, but the LVM is a little different, the use of the previous method for capacity expansion has not been effective, it took a long time to figure out its capacity expansion method. Xfs is the default file system type for CentOS7, and different file system types have different create, check, and adjust commands.

Xfs is the default file system type for CentOS7, and different file system types have different create, check, and adjust commands.

In the XFS file system, you can only increase the partition, not decrease it.

[root@localhost ~]# ls /lib//modules/3.10.0-229.20.1.el7.x86_64/kernel/fs   #View all file system types supported by the kernel
binfmt_misc.ko  ceph    dlm    fat      gfs2   lockd       nfs_common  overlayfs  udf
btrfs           cifs    exofs  fscache  isofs  mbcache.ko  nfsd        pstore     xfs
cachefiles      cramfs  ext4   fuse     jbd2   nfs         nls         squashfs

I’ve created new partitions and added them to the VG, and I’ve extended the physical boundaries.
When extending logical boundaries, errors are reported as follows:

[root@localhost ~]# resize2fs -p /dev/mapper/centos-root     
resize2fs 1.42.9 (28-Dec-2013)
resize2fs: Bad magic number in super-block When trying to open the /dev/mapper/centos-root 时
Can't find a valid file system superblock.

First, I thought of using FSCK for repair, but it didn’t work. When I saw the error message, I knew that XFS file should be repaired with XfS_REPAIR

[root@localhost ~]# fsck /dev/mapper/centos-root      
fsck,from util-linux 2.23.2
If you wish to check the consistency of an XFS filesystem or
repair a damaged filesystem, see xfs_repair(8).

Then try to fix it, but it doesn’t work, you need to unmount it to fix it, and the filesystem is mounted to /, so don’t even think about it.

[root@localhost ~]# xfs_repair /dev/mapper/centos-root 
xfs_repair: /dev/mapper/centos-root contains a mounted filesystem
xfs_repair: /dev/mapper/centos-root contains a mounted and writable filesystem
 
fatal error -- couldn't initialize XFS library

Finally, a web search reveals that there is one more step to go after the logical extension of the XFS filesystem:

[root@localhost ~]# lvs
  LV   VG     Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root centos -wi-ao---- 95.00g                                                    
  swap centos -wi-ao----  3.88g             
[root@localhost ~]# df  -lh
File   System Capacity Used Available Used % Used Mount Points
/dev/mapper/centos-root   46G   42G  4.5G   91%/  ------------>46G
devtmpfs                 1.9G     0  1.9G    0% /dev
tmpfs                    1.9G  164K  1.9G    1% /dev/shm
tmpfs                    1.9G  8.7M  1.9G    1% /run
tmpfs                    1.9G     0  1.9G    0% /sys/fs/cgroup
/dev/sda1                497M  208M  290M   42% /boot                                       
[root@localhost ~]# xfs_growfs /dev/mapper/centos-root      #This step is required to perform the adjustment, after the expansion.
meta-data=/dev/mapper/centos-root isize=256    agcount=4, agsize=2987776 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0
data     =                       bsize=4096   blocks=11951104, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal               bsize=4096   blocks=5835, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 11951104 to 24903680
 
[root@localhost ~]# df -lh
File System Capacity Used Available Used % Used Mount Points
/dev/mapper/centos-root   95G   42G   54G   44%/     ------------>Expansion has been completed
devtmpfs                 1.9G     0  1.9G    0% /dev
tmpfs                    1.9G  164K  1.9G    1% /dev/shm
tmpfs                    1.9G  8.7M  1.9G    1% /run
tmpfs                    1.9G     0  1.9G    0% /sys/fs/cgroup
/dev/sda1                497M  208M  290M   42% /boot

XFS related common commands

xfs_admin: Adjusting various parameters of the xfs file system  
xfs_copy: copies the contents of the xfs file system to one or more targets (in parallel).  
xfs_db: debugging or inspecting the xfs file system (looking at file system fragments, etc.)  
xfs_check: checks the integrity of the xfs file system.  
xfs_bmap: View a block map of a file.  
xfs_repair: Attempts to repair damaged xfs filesystems  
xfs_fsr: Defragmentation  
xfs_quota: manages disk quotas for xfs filesystems  
xfs_metadump: copies the metadata of the xfs file system to a file  
xfs_mdrestore: restores metadata from a file to the xfs file system  
xfs_growfs: Resize an xfs file system (only expandable)  
xfs_freeze Suspend (-f) and Restore (-u) xfs filesystems
xfs_logprint: prints the xfs filesystem log.  
xfs_mkfile: Creates the xfs file system.  
xfs_info: Queries file system details  
xfs_ncheck: generate pathnames from i-numbers for XFS  
xfs_rtcp: XFS real-time copy command   
xfs_io: debugging xfs I/O paths

Note:
becomes ext2 after using the mke2fs command on the Xfs filesystem. You need to change the filesystem type in /etc/fstab!

This paper address: http://www.linuxprobe.com/lvm+xfs++.html

Postgres solves permission denied for relation

I think you’ve all had privileges on database
grant all privileges on database XXX to XXX
is not in use.
and don’t want a table, to assign permissions.
Enter database
psql-u postgres-d postgres
\c mydb // switch TO mydb database
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO xiaoming; // give ALL PRIVILEGES ON ALL tables TO xiaoming
GRANT ALL PRIVILEGES ON tuser TO wechart; // gives wechart user, tuser table all permissions