我已经在 Windows VS 平台上编写了我的代码,当我编译它时没有错误。但是当我尝试使用 g++ 编译器在 linux 上编译它时,我得到如下所示的错误:
[user@ssh ~]$ g++ main.cpp -o main
[user@ssh ~]$ ./main "data1_h1.txt" "data1_r1.txt" 3 "output1_S1"
*** glibc detected *** ./main: free(): invalid pointer: 0x00007fff795578b4 ***
======= Backtrace: =========
/lib64/libc.so.6[0x320ec716af]
/lib64/libc.so.6(cfree+0x4b)[0x320ec758db]
./main(__gxx_personality_v0+0x3b2)[0x4013da]
./main[0x401d4b]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x320ec1d9c4]
./main(__gxx_personality_v0+0x71)[0x401099]
======= Memory map: ========
00400000-00405000 r-xp 00000000 00:16 18302619 /users/lnxsrv1/ee/user/main
00604000-00605000 rw-p 00004000 00:16 18302619 /users/lnxsrv1/ee/user/main
11159000-1117a000 rw-p 11159000 00:00 0
320e800000-320e81c000 r-xp 00000000 fd:00 1585318 /lib64/ld-2.5.so
320ea1c000-320ea1d000 r--p 0001c000 fd:00 1585318 /lib64/ld-2.5.so
320ea1d000-320ea1e000 rw-p 0001d000 fd:00 1585318 /lib64/ld-2.5.so
320ec00000-320ed4f000 r-xp 00000000 fd:00 1585379 /lib64/libc-2.5.so
320ed4f000-320ef4f000 ---p 0014f000 fd:00 1585379 /lib64/libc-2.5.so
320ef4f000-320ef53000 r--p 0014f000 fd:00 1585379 /lib64/libc-2.5.so
320ef53000-320ef54000 rw-p 00153000 fd:00 1585379 /lib64/libc-2.5.so
320ef54000-320ef59000 rw-p 320ef54000 00:00 0
320f000000-320f082000 r-xp 00000000 fd:00 1585438 /lib64/libm-2.5.so
320f082000-320f281000 ---p 00082000 fd:00 1585438 /lib64/libm-2.5.so
320f281000-320f282000 r--p 00081000 fd:00 1585438 /lib64/libm-2.5.so
320f282000-320f283000 rw-p 00082000 fd:00 1585438 /lib64/libm-2.5.so
3212800000-321280d000 r-xp 00000000 fd:00 1585420 /lib64/libgcc_s-4.1.2-20080825.so.1
321280d000-3212a0d000 ---p 0000d000 fd:00 1585420 /lib64/libgcc_s-4.1.2-20080825.so.1
3212a0d000-3212a0e000 rw-p 0000d000 fd:00 1585420 /lib64/libgcc_s-4.1.2-20080825.so.1
3217000000-32170e6000 r-xp 00000000 fd:00 782090 /usr/lib64/libstdc++.so.6.0.8
32170e6000-32172e5000 ---p 000e6000 fd:00 782090 /usr/lib64/libstdc++.so.6.0.8
32172e5000-32172eb000 r--p 000e5000 fd:00 782090 /usr/lib64/libstdc++.so.6.0.8
32172eb000-32172ee000 rw-p 000eb000 fd:00 782090 /usr/lib64/libstdc++.so.6.0.8
32172ee000-3217300000 rw-p 32172ee000 00:00 0
2b43d24f0000-2b43d24f2000 rw-p 2b43d24f0000 00:00 0
2b43d2508000-2b43d250a000 rw-p 2b43d2508000 00:00 0
7fff79543000-7fff79558000 rw-p 7ffffffe9000 00:00 0 [stack]
7fff795fd000-7fff79600000 r-xp 7fff795fd000 00:00 0 [vdso]
ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0 [vsyscall]
Aborted
我该如何解决这个错误?谢谢...