GDB筆記
概覽
基礎(chǔ)
用戶態(tài)會(huì)話
調(diào)試模式
轉(zhuǎn)儲(chǔ)文件調(diào)試
瞬間靜態(tài)分析,進(jìn)程死狀態(tài)。
gdb –core=file交互調(diào)試
調(diào)試新進(jìn)程
gdb exe
gdb –args exe [args]調(diào)試已經(jīng)運(yùn)行的進(jìn)程
gdb –pid= 進(jìn)程號(hào)內(nèi)核調(diào)試
3種調(diào)試已有進(jìn)程
gdb exe
.
gdb –args exe [args]
.
gdb
file exe
run [args]
.
gdb –args gcc a.c -o a
命令行參數(shù)
show args
set args 多次運(yùn)行設(shè)置命令行參數(shù)
環(huán)境變量和執(zhí)行路徑
path directory
.
show paths
.
show environment [varname]
.
set environment varname[=value] 清除或者設(shè)置環(huán)境變量
工作目錄
繼承進(jìn)入gdb工作目錄
改變工作目錄
cd dirctory
顯示路徑
pwd
輸入輸出
info terminal
run > a.txt
tty /dev/ttyb
遠(yuǎn)程調(diào)試可用這些輔助。
inferior 下層 多個(gè)進(jìn)程調(diào)試
inferior gdb維護(hù)的一系列對(duì)象,每個(gè)inf對(duì)應(yīng)一個(gè)調(diào)試目標(biāo)進(jìn)程。
info inferior 顯示下層信息
NULL 程序沒有跑或者已經(jīng)終止
clone-inferior -copies 2 復(fù)制當(dāng)前下層2份
(gdb) info inferiors
Num Description Executable
* 1 process 10087 /home/gao/code/a
(gdb) clone-inferior -copies 2
Added inferior 2.
Added inferior 3.
(gdb) info inferiors
Num Description Executable
3程序沒有跑或者已經(jīng)終止 /home/gao/code/a
2/home/gao/code/a
* 1 process 10087 /home/gao/code/a
(gdb)
切換下程
inferior 2 切換2這個(gè)下程。
進(jìn)程號(hào)是0,沒開始運(yùn)行。
run 運(yùn)行起來。
.
增加一個(gè)運(yùn)行下層
add-inferior -exec executeable 增加一個(gè)運(yùn)行下層
比如說調(diào)試一個(gè)服務(wù)端程序,一個(gè)客戶端程序。
remove-inferior n 刪掉一個(gè)下層
detach inferior 繼續(xù)運(yùn)行 quit
kill inferior 調(diào)試進(jìn)程退了,但是inferior紀(jì)錄還在。
Tab 幫助
(gdb) remove-
remove-inferiors remove-symbol-file
(gdb) remove-
remove-inferiors remove-symbol-file
(gdb) remove-
file 命令
file a.exe 可自行文件和符號(hào)文件是一個(gè)文件
可自行文件和符號(hào)文件分開
exec-file 指定目標(biāo)文件
.
symbol-file 指定符號(hào)文件
run 開始運(yùn)行
可以支持 run > >> < 重定向
set args 清理命令行參數(shù)
附加到進(jìn)程
gdb –pid= pid
attach pid
終止調(diào)試進(jìn)程
detach pid 分離進(jìn)程繼續(xù)運(yùn)行
.
quit 進(jìn)程退出
.
q
ctrl
+D
執(zhí)行控制
斷點(diǎn)
軟件斷點(diǎn)
break 普通
tbreak 一次性
rbreak 正則表達(dá)式一批斷點(diǎn)
- 基于cpu斷點(diǎn)指令,x86 int3機(jī)器碼0xcc。
- 替換斷點(diǎn)位置的指令
- CPU自執(zhí)行這里觸發(fā)斷點(diǎn)異常。
- 沒有斷點(diǎn)數(shù)量限制。
硬件斷點(diǎn)
- 基于cpu調(diào)試寄存器,dr0~dr7,數(shù)量限制。x86可以設(shè)定4個(gè)斷點(diǎn)。數(shù)量限制。
- 不修改代碼,在只讀內(nèi)存上設(shè)置斷點(diǎn)。EEPROM上的代碼設(shè)置。
- 有數(shù)量限制。
location
linespec
- 行號(hào)
- -/+ 偏移
- 文件名 :行號(hào)
- 函數(shù)名
- 函數(shù):標(biāo)號(hào)
- 文件名:函數(shù)
標(biāo)號(hào)
explicit
- -source linename
- -function function
- -label label
-line number
- address location break * address
實(shí)踐
file banner
b main 中斷在main函數(shù)
info funciton useage 顯示useage函數(shù)地址
info *0x88888e4 直接寫地址設(shè)定斷點(diǎn)
info b 顯示所有斷點(diǎn)
list usage 顯示useage函數(shù)
b line.c:11
b +2 當(dāng)前顯示到14行+2行所以設(shè)定在17行
虛擬機(jī)設(shè)定硬件斷點(diǎn)會(huì)失敗.
(gdb)hbreak hd_ioctl
(gdb) info b
物理機(jī)可以設(shè)定.
(gdb) hbreak v
Hardware assisted breakpoint 2 at 0x40053a: v. (2 locations)
(gdb) info b
Num Type Disp Enb Address What
1 breakpoint keep y
breakpoint already hit 1 time
1.1 y 0x000000000040054f in main at a.c:10 inf 1
1.2 y 0x000000000040054f in main at a.c:10 inf 2
2 hw breakpoint keep y
2.1 y 0x000000000040053a in v at a.c:4 inf 1
2.2 y 0x000000000040053a in v at a.c:4 inf 2
(gdb)
管理斷點(diǎn)
info b 顯示斷點(diǎn)
delete 1 刪除
disable 1
enable 1
delete 刪除所有的斷點(diǎn)
clear sum 刪除sum函數(shù)入口的所有斷點(diǎn)
擴(kuò)展斷點(diǎn)
watchpoint 監(jiān)視一個(gè)表達(dá)式,值變化中斷。
watch a*b+c/d
watch *( int * )
watch fd 監(jiān)控局部變量fd
c 繼續(xù)運(yùn)行
info b //
注意,x86硬件調(diào)試,寫操作,執(zhí)行過這一行,gdb顯示下一行,要看上一行。hw watchpoint,在x86平臺(tái)wachtpoint基于硬件實(shí)現(xiàn),其他平臺(tái)可能是基于軟件實(shí)現(xiàn)。 vc6純軟件執(zhí)行,執(zhí)行目標(biāo)速度低。
執(zhí)行位置超過當(dāng)前區(qū)域,無效監(jiān)視點(diǎn)會(huì)被刪除。
訪問監(jiān)視點(diǎn)
rwatch 讀停下來。
awatch 讀或?qū)懲O聛怼?awatch fd
watch -l
b hd_ioctl thread 1
info threads 帶* 當(dāng)前線程
繁忙函數(shù)解決方案
b hd_ioctl thread 1 if fd > 0
當(dāng)斷點(diǎn),斷了后執(zhí)行命令
()command 12
()silent
()print “fd is %d\n”,fd
()continue
()end
動(dòng)態(tài)ping不修改代碼。
tracepoint 遠(yuǎn)程主機(jī)通訊調(diào)試,前端stub立刻恢復(fù)執(zhí)行,但會(huì)記錄下來。
catchpoint
執(zhí)行控制
進(jìn)入子函數(shù)內(nèi)部。單步 step
匯編 stepi
stepi 4
類似nexti
不要進(jìn)入子函數(shù)
next
繼續(xù)執(zhí)行
continue
跑起來直到3號(hào)斷點(diǎn)命中
until 3
跑起來直到3號(hào)斷點(diǎn)命中,快捷禁止其他斷點(diǎn)。
恢復(fù)執(zhí)行直到函數(shù)返回。
finish
調(diào)用函數(shù)!
gdb 杜撰代碼調(diào)用函數(shù)。
call sum(1,2) …
強(qiáng)制返回
強(qiáng)制main函數(shù) return。
return 1
觸發(fā)中斷
異常或斷點(diǎn)進(jìn)入調(diào)試器。
調(diào)試器發(fā)起中斷,讓程序中斷下來。ctrl+C,app收到中斷信號(hào),進(jìn)入調(diào)試器。
符號(hào)
調(diào)試器讀區(qū) 調(diào)試符號(hào)。
二進(jìn)制-調(diào)試符號(hào)-源碼
linux dwarf 存儲(chǔ)調(diào)試符號(hào)信息。gcc
readelf -h filename
里面如果有l(wèi)ine location debug標(biāo)示readelf -w 導(dǎo)出調(diào)試文件
gcc -g 才能輸出符號(hào)
ubuntu 符號(hào)服務(wù)器
< ddebs.ubuntu.com/pool/main/>
分離操作
strip
安裝ubunte的linux 內(nèi)核符號(hào)
https://askubuntu.com/questions/197016/how-to-install-a-package-that-contains-ubuntu-kernel-debug-symbols
安裝libc符號(hào)
dpkg -s /lib/x86_64-linux-gun/libc-2.15.so
dpkg -s libc.so.6
sudo apt-get -c aptproxy.conf install libc6-dbg
libc 調(diào)試符號(hào)
sudo apt-get install libc6-dbg
符號(hào)路徑
gdb 使用file 或 symbol-file 加載符號(hào)文件
自動(dòng)搜索 path 路徑
(gdb)i share
* 共享庫沒調(diào)試信息
搜索符號(hào)
info vaiables regex 類名/函數(shù)名/變量名
內(nèi)存地址與符號(hào)互換
info addriess 函數(shù)名
info symbol 地址
(gdb) info address main
Symbol “main” is a function at address 0x400547.
(gdb) info symbol 0x400547
main in section .text of /home/gao/code/a
.
info os
查看加載的文件內(nèi)存位置
info files
列出全局變量
info variable
info va
顯示源碼
list
list -
dir 源碼路徑
show dir
常用命令源碼
安裝系統(tǒng)工具源碼和調(diào)試
apt-get source coreutils
sudo apt-get install coreutils-dbgsym
gdb /bin/ls
list main
dir ~/src/coreutils-7.4/src
list main
libc
sudo apt-get source libc6-dev
/home/ge/eglibc-2.15
dir 搜索路徑 :分割
$cdir 編譯路徑
cwd 當(dāng)前工作路徑
查看調(diào)試目標(biāo)
觀察寄存器
info reg
棧
子函數(shù)返回地址
函數(shù)參數(shù)
局部變量
bt n 觀察函數(shù)返回地址
frame n 切換棧幀
up n
down n
info frame [address]
info args
info locals
注意,切換棧幀之后可能會(huì)發(fā)生,本地變量值不準(zhǔn)確,因?yàn)橹荡嬖诩拇嫫髦行枰⌒摹?/p>
觀察內(nèi)存
print
p /f 表達(dá)式 表達(dá)式要打印位置
xduotcf
x
x /Nuf
N 打印幾個(gè)單元
u 每個(gè)單元大小 b-1byte w-2byte h-4byte g-8byte
f s字符串i指令格式
x/s 0xfffff81946000 打印字符串
x /32bx arg bit 16禁制
(gdb) x /32bx &i
0x7fffffffc76c: 0x01 0x00 0x00 0x00 0x70 0x05 0x40 0x00
0x7fffffffc774: 0x00 0x00 0x00 0x00 0x40 0xfa 0xa2 0xf7
0x7fffffffc77c: 0xff 0x7f 0x00 0x00 0x58 0xc8 0xff 0xff
0x7fffffffc784: 0xff 0x7f 0x00 0x00 0x58 0xc8 0xff 0xff
(gdb)p arg[0]
p arg[i]
p *&a[0]@10 a0數(shù)組開始的10個(gè)元素
反匯編
disas main main反匯編代碼
x/5i schedule 這個(gè)地址開始的5條匯編指令。
gdb mov 從左往右賦值at&t匯編。
高級(jí)技巧
信號(hào)
- info signals 異常/同步/中斷
stop 要不要中斷下來看
printf 打印信息
pass 要不要傳遞給應(yīng)用程序。
- handle 修改規(guī)則 handle signal act print noprint stop nostop pass nopass
handle SIGPIPE 不要中斷下來,打印一個(gè)信息,網(wǎng)絡(luò)程序常用
(gdb) handle SIGPIPE nostop
Signal Stop Print Pass to program Description
SIGPIPE No Yes Yes Broken pipe
Thread
info threads
LWP-light weight process 線程編號(hào)。
* gdb當(dāng)前線程
切換當(dāng)前線程
thread 2
打印所有線程
thread apply all bt 針對(duì)一群線程的命令避免切換來看。
線程改名字
thread name [name]
我自己經(jīng)驗(yàn) LWP 可以很好的觀察線程負(fù)載情況。
The type java.lang.object cannot be resolved - Eclipse buildpath not working
因?yàn)樘鎿Q了 jvm版本.
build->library -> add library->add jre library.
tomcat部署問題.?
1.清理 部署 重啟.
2.先刪掉部署項(xiàng)目,可以重新配置config.
tomcat 找不到oracle 驅(qū)動(dòng)程序?
請(qǐng)?jiān)?context.xml 中配置
在 server.xml
eclipse 項(xiàng)目屬性, web deployment assembly設(shè)置 source: /webcontent deploypath: /
Setting property 'source' to 'org.eclipse.jst.jee.server 這個(gè)不是問題.
C面向?qū)ο缶幊虆R集
參考資料:
Object-oriented Programming with ANSI-C
1993年,第一份c如何編寫OO的資料,free.
OOC.PDF
https://www.cs.rit.edu/~ats/books/ooc.pdf
中文翻譯:
https://code.google.com/p/ooc/downloads/detail?name=ooc-translate-preview-r26.pdf&can=2&q=
輕量級(jí)的C語言面向?qū)ο缶幊炭蚣?br/> http://sinojelly.blog.51cto.com/479153/281184
UML—OOPC嵌入式C語言開發(fā)精講
里面有一套框架可以 c寫OO.
http://pan.baidu.com/share/link?shareid=3402978666&uk=3188261067&adapt=pc&fr=ftw#path=%252FC%25E8%25AF%25AD%25E8%25A8%2580
你試過這樣寫C程序嗎 --函數(shù)式編程
< >
我所偏愛的 C 語言面向?qū)ο缶幊谭妒剑骑L(fēng)
http://blog.codingnow.com/2010/03/object_oriented_programming_in_c.html
C語言面向?qū)ο缶幊?-- 6篇專欄
http://blog.csdn.net/column/details/object-orient-c.html
測(cè)試代碼的locality。
數(shù)組的讀區(qū)方式不同,按照行讀,被cache也是按行連續(xù)加載的。
如果按照列讀區(qū),那么效率很低,除非cache足夠大,而且也要遍歷所有的數(shù)據(jù),并且cache hash算法也好,實(shí)現(xiàn)的硬件還是多路組相聯(lián)的cache硬件實(shí)現(xiàn)。
** valgrind --tool=cachegrind ./test2**
code1:
#include <stdio.h>
#define MAXROW 8000
#define MAXCOL 8000
int main () {
int i,j;
static int x[MAXROW][MAXCOL];
printf ("Starting!\n");
for (i=0;i<MAXROW;i++)
for (j=0;j<MAXCOL;j++)
x[i][j] = i*j;
printf("Completed!\n");
return 0;
}
code2:
#include <stdio.h>
#define MAXROW 8000
#define MAXCOL 8000
int main () {
int i,j;
static int x[MAXROW][MAXCOL];
printf ("Starting!\n");
for (j=0;j<MAXCOL;j++)
for (i=0;i<MAXROW;i++)
x[i][j] = i*j;
printf("Completed!\n");
return 0;
}
```
##結(jié)果
Command: ./test1
Starting!
Completed!
I refs: 905,721,688
I1 misses: 4,177
LLi misses: 2,808
I1 miss rate: 0.00%
LLi miss rate: 0.00%
D refs: 514,830,867 (386,118,735 rd + 128,712,132 wr)
D1 misses: 4,025,828 ( 23,565 rd + 4,002,263 wr)
LLd misses: 4,008,456 ( 6,997 rd + 4,001,459 wr)
D1 miss rate: 0.8% ( 0.0% + 3.1% )
LLd miss rate: 0.8% ( 0.0% + 3.1% )
LL refs: 4,030,005 ( 27,742 rd + 4,002,263 wr)
LL misses: 4,011,264 ( 9,805 rd + 4,001,459 wr)
LL miss rate: 0.3% ( 0.0% + 3.1% )
gcc -o test2 test2.c
** valgrind --tool=cachegrind ./test2**
I refs: 905,720,801
I1 misses: 4,113
LLi misses: 2,811
I1 miss rate: 0.00%
LLi miss rate: 0.00%
D refs: 514,830,348 (386,118,427 rd + 128,711,921 wr)
D1 misses: 64,025,705 ( 23,462 rd + 64,002,243 wr)
LLd misses: 4,016,427 ( 6,977 rd + 4,009,450 wr)
D1 miss rate: 12.4% ( 0.0% + 49.7% )
LLd miss rate: 0.8% ( 0.0% + 3.1% )
LL refs: 64,029,818 ( 27,575 rd + 64,002,243 wr)
LL misses: 4,019,238 ( 9,788 rd + 4,009,450 wr)
LL miss rate: 0.3% ( 0.0% + 3.1% )
Starting!
Completed!
```
參考:
valgrind調(diào)試CPU緩存命中率和內(nèi)存泄漏
http://laoxu.blog.51cto.com/4120547/1395236
echo 'eval $(dircolors -b $HOME/.dircolors)' >> $HOME/.bashrc
. $HOME/.bashrc 閱讀全文
2. 有1/3重做日志緩沖區(qū)未被寫入磁盤
3. 有大于1M的重做日志緩沖區(qū)未被寫入磁盤
4. 每隔3 秒鐘
5. DBWR 需要寫入的數(shù)據(jù)的SCN大于LGWR記錄的SCN,DBWR 觸發(fā)LGWR寫入。 閱讀全文
dd if=./1Gb.file bs=64k |dd of=/dev/null
dd if=./1Gb.file bs=1MB |dd of=/dev/null 閱讀全文
搞不清楚為什么.也許區(qū)分本地網(wǎng)絡(luò),進(jìn)程間通訊優(yōu)化? 為了程序方便 /ect/hosts 添加127.0.0.1 指向主機(jī)名.
sudo vim /etc/hosts 閱讀全文
問題原因:
exe 是debug版本.
靜態(tài)庫是release版本.
原來的修改 relase 版本多線程靜態(tài)庫 CFLAGS= /MT
編譯的時(shí)候需要配置合適的線程庫
工程中鏈接對(duì)應(yīng)的版本的lib文件.
參考:
構(gòu)建高可用Linux服務(wù)器 2 閱讀全文
小文件太多,不好.IO性能差.
單個(gè)文件太大,如果都用memorybuffer,內(nèi)存占用會(huì)非常的大.
設(shè)計(jì)者考慮2邊的靈活性. 閱讀全文
https://code.google.com/p/xee/downloads/detail?name=Xee2.2.zip&can=1&q=
自己開了一個(gè)分支
https://github.com/gddg/xee 閱讀全文
1.8口交換機(jī)
2.支持vlan
3.支持Qos
4.支持端口聚合.
Cisco SG200-08
5.POE 通過網(wǎng)線供電給USB CAM 功能.
閱讀全文
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
解決辦法?
閱讀全文
或
echo "IRB.conf[:PROMPT_MODE] = :SIMPLE" > ~/.irbrc 閱讀全文
alias ls='ls -F'
alias cls='clear'
alias grep='grep --color=auto'
CLICOLOR="xterm-color"
LSCOLORS="gxfxcxdxcxegedabagacad"
export CLICOLOR LsCOLORS 閱讀全文
http://ethanschoonover.com/solarized/files/solarized.zip 閱讀全文
http://html5ify.com/fks/#index_內(nèi)容貢獻(xiàn)者
前端文摘:Web 開發(fā)模式演變歷史和趨勢(shì)
http://www.cnblogs.com/lhb25/p/web-development-mode-evolve.html
A brief history of web design for designers
http://blog.froont.com/brief-history-of-web-design-for-designers/ 閱讀全文
使用 GNU Libtool 創(chuàng)建庫
https://www.ibm.com/developerworks/cn/aix/library/1007_wuxh_libtool/ 閱讀全文
http://gitbook.liuhui998.com/1_1.html
臺(tái)灣ihower寫的
https://ihower.tw/git/ 閱讀全文
https://ihower.tw/rails4/
笨方法學(xué) Ruby
http://lrthw.github.io/ 閱讀全文
gun tools 替換掉osx
PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH" 閱讀全文
control_L to command_L
option_R to delete
FN 鍵盤+F1 F2 如果你想替換成直接按F1就調(diào)用的話,可以macosx 鍵盤里面找到。發(fā)現(xiàn)FN鍵盤無法移到別的鍵上。
目前還沒看出來mac上option,control 鍵的原生用途。
鍵程和windows很不一樣。 閱讀全文
brew install autoconf
brew install automake
glibtool --help
sh autogen.sh
./configure
make
make check 閱讀全文
/usr/local/etc/nginx/nginx.conf to 8080
ln -sfv /usr/local/opt/nginx/*.plist ~/Library/LaunchAgents
nginx 閱讀全文
GMac:~ XXXX$ brew install cmake 閱讀全文
sudo pmset -a hibernatemode 3 閱讀全文
Swap the Control and Cmd keys 閱讀全文
zeromq -- c++ 實(shí)現(xiàn)
ActiveMQ
JMS -- java的消息服務(wù),j2ee 各家實(shí)現(xiàn)不同
MS Queue --
RabbitMQ
nanomsg
lightq 閱讀全文
1.vc 編譯
頭文件
#include <omp.h
omp_set_num_threads(threadNumber);
#pragma omp parallel default(shared) private(i,riskId)
{
#pragma omp for
}
}
GCC配置
1. 編譯
-fopenmp
設(shè)定線程數(shù)量 export OMP_NUM_THREADS=6
參考
通過 GCC 學(xué)習(xí) OpenMP 框架
http://www.ibm.com/developerworks/cn/aix/library/au-aix-openmp-framework/
安裝了 sql- server2005 express ,安裝默認(rèn)會(huì)關(guān)閉網(wǎng)絡(luò)連接的等.需要打開ip:1433端口.
賬戶密碼需要使用,ms sql–server 登錄登錄.
2.sqlapi 的使用.
正確的sqlapi ++ ms sql server 串
char * dbname = "127.0.0.1\\SQL2005EXPRESS@master";
閱讀全文
#define WORD unsigned short
沖突
解決辦法:
1.因?yàn)?個(gè)頭文件來自不同項(xiàng)目. 修改源文件徹底解決掉這個(gè)問題.
2.先后引用位置 .
3.隱藏不必要的 .h文件,只有需要cpp才添加h引用.這樣防止不必要的引用. 閱讀全文
給出了2段代碼c和java:
1.隨機(jī)數(shù)插入數(shù)組中。
2.sum統(tǒng)計(jì)相加 。
c 結(jié)果不sort 需要21秒,排序后7秒。
java 5秒。
問題在哪里?
分支預(yù)測(cè)資料:
http://comp.lang.cpp.moderated.narkive.com/oZn86c9y/hidden-features-and-dark-corners-of-c-stl
DIAG_ADR_ENABLED=FALSE
DIAG_DDE_ENABLED=FALSE
DIAG_SIGHANDLER_ENABLED=FALSE
DIAG_RESTRICTED=FALSE
閱讀全文
http://www.macx.cn/thread-2051799-1-1.html
http://support.apple.com/zh-cn/HT1528
太難找了,竟然在菜單里,打開root 。
su root
whoami
sudo su
密碼不對(duì)
Mac OS X:sudo 命令需要非空的管理員密碼
c#工程里面選擇 x86.
安裝foxpro odbc驅(qū)動(dòng).
Intellij IDEA和Android Studio默認(rèn)使用JDK6,所以你有如下選擇:
1,安裝JDK6
2,安裝其他版本的JDK,然后修改IDE的指向。
如果選擇2,那么修改方式為:
打開應(yīng)用的.app包,然后在Contents這個(gè)目錄下,有個(gè)文件info.plist,修改JVMVersion這個(gè)key對(duì)應(yīng)的value,從1.6*修改為你安裝的版本即可。
1 用文本編輯器打開
/Applications/IntelliJ IDEA 13.app/Contents/Info.plist
2 搜索JVMVersion,將其值改為1.7*
3 再次運(yùn)行應(yīng)用即可看到應(yīng)用成功運(yùn)行
execute dbms_stats.gather_schema_stats('CORE'); 閱讀全文
#define WIN32_LEAN_AND_MEAN
放在windows.h 之前.
2. 先引入socket2.h文件.
3. 項(xiàng)目 -> 屬性 -> C/C++ -> 預(yù)處理器 -> 預(yù)處理器定義
在其中添加 : WIN32_LEAN_AND_MEAN 閱讀全文
linux DNS 設(shè)置
sudo vim /etc/resolv.conf
wget http://www.alidns.com/static/soft/SetAliDNS.sh -O SetAliDNS.sh && chmod +x SetAliDNS.sh && sudo ./SetAliDNS.sh
卸載sudo ./SetAliDNS.sh restore
鍵盤修改
API對(duì)設(shè)計(jì)流程的影響——Joshua Bloch訪談
http://blog.sina.com.cn/s/blog_6310e0b20100o7cv.html
工程師Joshua Bloch談如何設(shè)計(jì)一款優(yōu)秀的API【附PPT】
http://www.csdn.net/article/2014-02-18/2818441-How-to-design-a-good-API
《Effective Java》: Joshua Bloch訪談
The Java? Tutorials
http://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html
1.5
New Features and Enhancements J2SE 5.0
http://docs.oracle.com/javase/1.5.0/docs/relnotes/features.html
Experiences with the New Java 5 Language Features
1.6
Highlights of Technology Changes in Java SE 6
http://www.oracle.com/technetwork/java/javase/features-141434.html
1.7
Highlights of Technology Changes in Java SE 7
http://www.oracle.com/technetwork/java/javase/jdk7-relnotes-418459.html
http://www.javacodegeeks.com/2014/05/java-8-features-tutorial.html
學(xué)習(xí)步驟
1.c
2.c object
3. stl
4. linux os api
5. socket
6. 分布式
7. web html5
8. mac UI
9. obj c
10.算法。
一些想法:
微博上關(guān)注的人很多淘寶系的很多都不搞技術(shù)了,原因是阿里上市了,足夠的錢退休了,還有些人離職去創(chuàng)業(yè)了,
可能氛圍比較好,看來創(chuàng)業(yè)的都有滋有味。大規(guī)模的系統(tǒng)搞過了,心里有底氣了,知道方向,估計(jì)成功率也會(huì)比較高。
一些人技術(shù)人靠知乎刷存在感,靠名氣說話 。
一些2流技術(shù)角色投稿文章csdn,寫專題blog。很多毫無營(yíng)養(yǎng)。
國(guó)內(nèi)的技術(shù)書,還是一如既往類似官方教程的翻譯版。
blog
Jeff Atwood 大stackoverflo
https://github.com/coding-horror
陳皓
云風(fēng)
何_登成
http://weibo.com/2216172320/BcUmvbyvW?type=repost#_rnd1418722416088
http://www.importnew.com/14105.html
網(wǎng)絡(luò)教學(xué):
PLSQL
先確保執(zhí)行這個(gè). win7 以上才支持 WER windows error report 功能 .
windows 彈出提示框, 然后進(jìn)程管理器,右鍵手工導(dǎo)出也行.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps]
"DumpFolder"="c:\\"
"DumpCount"=dword:00000030
"DumpType"=dword:00000002
"CustomDumpFlags"=dword:00000000
c++ debug版本 + pdb文件
另外需要注意不是所有情況都生成core.
windows 改了注冊(cè)表不生成core的原因:
Requirements and limitations
· Debugging dump files of optimized code can be confusing. For example, compiler inlining of functions can result in unexpected call stacks and other optimizations might change the lifetime of variables.
· Dump files from 64-bit machines must be debugged on an instance of Visual Studio that is running on a 64-bit computer.
· In versions of Visual Studio before VS 2013, dumps of 32-bit apps that were run on 64-bit machines that were collected by some tools (such as Task Manager and 64-bit WinDbg) could not be opened in Visual Studio. This limitation has been removed in VS 2013.
· Visual Studio can debug dump files of native apps from ARM devices. Visual Studio can also debug apps dump files of managed apps from ARM devices, but only in the native debugger.
· To debug kernel-mode dump files in Visual Studio 2013, download the Windows 8.1 Version of Debugging Tools for Windows. See Kernel Debugging in Visual Studio.
· Visual Studio can't debug dump files saved in the older dump format known as a full user-mode dump. Note that a full user-mode dump is not the same a dump with heap.
· To debug with the SOS.dll (SOS Debugging Extension) in Visual Studio, you must install the Debugging Tools for Windows that is part of the Windows Driver Kit (WDK). See Windows 8.1 Preview: Download kits, bits, and tools.
參考:
Collecting User-Mode Dumps --注冊(cè)表
http://msdn.microsoft.com/en-us/library/windows/desktop/bb787181(v=vs.85).aspx
Crash Dump Analysis --- c++ 自己生成dump
http://msdn.microsoft.com/en-us/library/windows/desktop/ee416349(v=vs.85).aspx
Use Dump Files to Debug App Crashes and Hangs in Visual Studio
http://msdn.microsoft.com/en-us/library/d5zhxt22.aspx#bkmk_requirements_and_limitations
Attach to Running Processes with the Visual Studio Debugger
http://msdn.microsoft.com/en-us/library/3s68z0b3.aspx
Just-In-Time Debugging in Visual Studio ------- 還沒看
The Discipline and Method Architecture for Reusable Libraries (2000)
Citations
relocation error: multiget: symbol _Z23wxHandleFatalExceptionsb, version WXU_2.8 not defined in file libwx_baseu-2.8.so.0
下載地址:
http://www.codeblocks.org/downloads/26
http://sourceforge.net/projects/codeblocks/files/Binaries/13.12-RC1/Linux%20(64bit)/
codeblocks-13.12-1.el5.x86_64.tar.bz2
安裝的關(guān)鍵
Note: On RedHat/CentOS 5 and older revisions of 6 (up to 6.2 as far as I know) you need to add repoforge (former rpmforge) to your repolist, to be able to install the needed wxGTK-package. Seehttp://repoforge.org/use for an instruction.
更新yum的源 很重要
http://repoforge.org/use/ 下載對(duì)應(yīng)的rpm
cat /etc/redhat-release
uname –a
wget http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
rpm -ivh package-filename
# yum install gcc # yum install gcc-c++
如果之前失敗過 yum erase wxGTK
# yum install wxGTK
然后
]# ls codeblocks-12.11-1.el6.i686.rpm codeblocks-contrib-12.11-1.el6.i686.rpm codeblocks-contrib-devel-12.11-1.el6.i686.rpm codeblocks-devel-12.11-1.el6.i686.rpm
# rpm -ivh codeblocks*
1. 下載repo文件
下載地址:http://mirrors.163.com/.help/CentOS6-Base-163.repo
2. 備份并替換系統(tǒng)的repo文件
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost ~]# mv CentOS-Base.repo CentOS-Base.repo.bak
[root@localhost ~]# mv /root/CentOS6-Base-163.repo CentOS-Base.repo
3. 執(zhí)行yum源更新
[root@localhost ~]# yum clean all
[root@localhost ~]# yum makecache
[root@localhost ~]# yum update
yum install gcc gcc-g++ autoconfig automake
參考:
http://blog.csdn.net/dupei/article/details/6428346
http://www.cnblogs.com/magialmoon/archive/2013/05/05/3061108.html
sqlplus 外面執(zhí)行正常.
tomcat調(diào)用老有問題.多調(diào)用幾次久正常.
可能是包中的全局變量引起的.
If so, that's because your package is stateful:
The values of the variables, constants, and cursors that a package declares (in either its specification or body) comprise its package state. If a PL/SQL package declares at least one variable, constant, or cursor, then the package is stateful; otherwise, it is stateless.
When you recompile the state is lost:
If the body of an instantiated, stateful package is recompiled (either explicitly, with the "ALTER PACKAGE Statement", or implicitly), the next invocation of a subprogram in the package causes Oracle Database to discard the existing package state and raise the exception ORA-04068.
After PL/SQL raises the exception, a reference to the package causes Oracle Database to re-instantiate the package, which re-initializes it...
You can't avoid this if your package has state. I think it's fairly rare to really need a package to be stateful though, so you should revisit anything you have declared in the package, but outside a function or procedure, to see if it's really needed at that level. Since you're on 10g though, that includes constants, not just variables and cursors.
But the last paragraph from the quoted documentation means that the next time you reference the package in the same session, you won't get the error and it will work as normal (until you recompile again).
existing state of packages has been discarded
means, that your Package had some sort of state.
This is caused by a global variable (or constant) stored in your Package Body.
Since the package has already been used in your session, Oracle assumes that this state is relevant for you. Some of these variables might have different values now, and when you recompile the Body, the values are reset.
This exception is thrown, so that your clients know that they can't rely on those variables any more.
You could try to remove all global variables and constants from the Package Body, or close your session and reconnect before calling the package again.
參考:
http://stackoverflow.com/questions/2502722/pl-sql-package-invalidated
監(jiān)聽器配置少了.
lsnrctl
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = XE )
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(SID_NAME =XE )
)
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
1.安裝 vnc-server
找包
如果window
vncserver :1
輸入密碼
vnc登錄后
xhost +
解決display問題.
vncserver -kill :1
vnc 如果進(jìn)入以后3個(gè) 提示選擇 allow clipboard .
修改/root/.vnc/xstartup文件,把最后一行 twm& 修改成"startkde &" 或者"gnome-session &"
不然的話連接linux時(shí)只出現(xiàn)了一個(gè)終端編輯器窗口。
exec gnome-session &
oracle 安裝
http://blog.itpub.net/7719012/viewspace-1139996
http://lowendtalk.com/discussion/5396/how-to-install-vnc-on-centos
二:使用Xmanager實(shí)現(xiàn)xhost掛接圖形
http://hi.baidu.com/hanyanlovejoy/item/564ed582accef0efe496e017
刪除
:g/.*ABC/m
:g/kernel32/d
:[range]g[lobal]/{pattern}/[cmd] :help :g
vim 查找一個(gè)文章段落, 開頭字符 結(jié)尾字符
/.*#tag1\(.\+\n\+\)\{-}#tag2.*
刪除掉 :
g/.*#tag1\(.\+\n\)\{-}#tag2.*/d
這句話\(.\+\n\+\) 采用分組
.\+ .任意字符 + 一個(gè)或多個(gè)
\n\+ 回車 一個(gè)或多個(gè)
\+1 或更多
\{-} 0 或更多盡可能少. 任意字符
\n 換行符
為什么 /This\_.*text/ 不可以,因?yàn)閈_. 是全緩沖區(qū)匹配模式的.
概念分組、捕獲
http://i.linuxtoy.org/docs/guide/ch26s08.html#id3120909
abc123.456.def
\d{3}表示三個(gè)數(shù)字,(\d{3}\.)表示三個(gè)數(shù)字加“.”為一組,{2}表示這一組內(nèi)容重復(fù)兩次
參考:
http://vimcdoc.sourceforge.net/doc/pattern.html#search-pattern
^\(.\+\n\)\{-}#.*tag1
Vim 中刪除符合條件的行
http://timothyqiu.com/archives/delete-lines-matching-pattern-in-vim/ https://github.com/railsinstaller/railsinstaller-windows/releases
源碼
https://github.com/embedthis/goahead/blob/master/src/utils/gopass.c
goAhead 2.5嵌入式web服務(wù)器移植到arm9 2440 + linux中
http://blog.csdn.net/reille/article/details/6784809
goAhead上實(shí)現(xiàn)文件上傳到嵌入式web服務(wù)器上
http://www.xuebuyuan.com/625754.html
3. 資料
3.1 http://blog.csdn.net/reille/article/details/6871827 本博客轉(zhuǎn)載的文章
3.2
http://www.hackchina.com/r/57970/v2.1.1-_-web-_-upload.htm__html 前端實(shí)現(xiàn)參考
http://www.hackchina.com/r/57970/v2.1.1-_-LINUX-_-upldForm.c__html 服務(wù)器端實(shí)現(xiàn)參考
RiskUnit0001.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
obj/Debug/src/RiskUnit0001/RiskUnit0001.o: could not read symbols: Bad value
為什么需要
解決辦法編譯器已經(jīng)提示了:recompile with -fPIC
但是我們應(yīng)該重新編譯誰帶上這個(gè)參數(shù)呢?經(jīng)過我?guī)追垓v,發(fā)現(xiàn)如下情況:
1、編譯.o文件的時(shí)候,沒有加參數(shù)-fPIC,這問題個(gè)在gcc version 3.4.6版本沒有發(fā)生,可能那個(gè)編譯器默認(rèn)都給加上吧。
2、當(dāng)前程序中有用到某個(gè)靜態(tài)庫,那個(gè)靜態(tài)庫編譯.o文件的時(shí)候沒有加上-fPIC(靜態(tài)庫其實(shí)就是.o文件打包)。補(bǔ)充一點(diǎn):我發(fā)現(xiàn)手寫Makefile時(shí)即使不加-fPIC也沒有這個(gè)問題,這一點(diǎn)很郁悶,這個(gè)只在用automake工具編譯出.a文件時(shí)才出現(xiàn)過。
知道原因了,解決辦法自然有了,保證你編譯.o文件的時(shí)候,都加上-fPIC,這樣你才能編譯出動(dòng)態(tài)庫來。
引用
http://hi.baidu.com/duizhe_memory/item/c4ccbb0831a5998d3d42e212
sqlplus "core/core@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=192.168.75.1)(Port=1521))(CONNECT_DATA=(SID=itmp)))"
sqlplus core/core@192.168.75.1:1521/itmp
參考一個(gè) :
/***
* ORACLE客戶端liunx安裝部署說明
*
*/
配置步驟:
1,將本文件夾拷貝到相應(yīng)的服務(wù)器上。
2,配置環(huán)境變量如下: 文件夾所在路徑(/kfts/tools/oracle)
(永久修改方式)
vi /etc/profile
在文件最后添加:
export LD_LIBRARY_PATH=/kfts/tools/oracle:$LD_LIBRARY_PATH
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export ORACLE_HOME=/kfts/tools/oracle/
export PATH=/kfts/tools/oracle/:$PATH
export TNS_ADMIN=/kfts/tools/oracle/network/admin
之后運(yùn)行命令生效:
source /etc/profile
relocation error: multiget: symbol _Z23wxHandleFatalExceptionsb, version WXU_2.8 not defined in file libwx_baseu-2.8.so.0
下載地址:
http://www.codeblocks.org/downloads/26
http://sourceforge.net/projects/codeblocks/files/Binaries/13.12-RC1/Linux%20(64bit)/
codeblocks-13.12-1.el5.x86_64.tar.bz2
安裝的關(guān)鍵
Note: On RedHat/CentOS 5 and older revisions of 6 (up to 6.2 as far as I know) you need to add repoforge (former rpmforge) to your repolist, to be able to install the needed wxGTK-package. Seehttp://repoforge.org/use for an instruction.
更新yum的源 很重要
http://repoforge.org/use/ 下載對(duì)應(yīng)的rpm
cat /etc/redhat-release
uname –a
rpm -ivh package-filename
# yum install gcc # yum install gcc-c++
如果之前失敗過 yum erase wxGTK
# yum install wxGTK
然后
]# ls codeblocks-12.11-1.el6.i686.rpm codeblocks-contrib-12.11-1.el6.i686.rpm codeblocks-contrib-devel-12.11-1.el6.i686.rpm codeblocks-devel-12.11-1.el6.i686.rpm
# rpm -ivh codeblocks*
yum install gcc gcc-g++ autoconfig automake
參考:
http://blog.csdn.net/dupei/article/details/6428346
http://www.cnblogs.com/magialmoon/archive/2013/05/05/3061108.html
目標(biāo)緩沖區(qū) 小于 實(shí)際緩沖區(qū)
char *name = "1234567890";
char name2[6]={0};
memcpy_s( name2 , sizeof(name2) , name, strlen(name));
動(dòng)態(tài)執(zhí)行失敗 (DEBUG ASSERTION FAILED !) 運(yùn)行庫和調(diào)試庫都會(huì)提示出錯(cuò).
注意: 指針sizeof( 指針 ) = 4
strncpy(name2,name ,sizeof(name) ); 打印name2 1234
strncpy(name2,name ,strlen(name) ); 打印name2 123456IOIPNUUY
優(yōu)化這個(gè)語句,盡量拷貝內(nèi)容
strncpy(name2,name , strlen(name)>sizeof(name2)? sizeof(name2): strlen(name) );
目標(biāo)緩沖區(qū) 小于 實(shí)際緩沖區(qū)
strncpy(name2,name ,sizeof(name2)-1 );
sizeof(name2)-1 ------------>讓最后一個(gè)name2字符留給\0 否則這個(gè)字符也被拷貝了.
看一下LINUX下的兩個(gè)函數(shù)的源代碼,印象會(huì)更加深刻一些
void * memcpy(void * dest,const void *src,size_t count)
{
char *tmp = (char *) dest, *s = (char *) src;
while (count--)
*tmp++ = *s++;
return dest;
}
char * strcpy(char * dest,const char *src)
{
char *tmp = dest;
while ((*dest++ = *src++) != '\0')
/* nothing */;
return tmp;
}
老實(shí)講,這兩個(gè)函數(shù)長(zhǎng)得是很帥
參考
http://stackoverflow.com/questions/4593907/difference-between-strncpy-and-memcpy
Visual Studio 2008 命令提示
cl /EHsc simple.cpp
參考:
http://msdn.microsoft.com/zh-cn/library/ms235639(v=vs.90).aspx
http://msdn.microsoft.com/zh-cn/library/1370z17c.aspx
Visual C++ 示例應(yīng)用程序
Visual Studio 2008
- 通用示例
-
包含一些示例,這些示例可以在 Visual C++ 的所有版本(包括 Visual C++ 速成版)中使用。
- Visual C++ 2008 中的演練
-
包含一些演練鏈接,這些演練重點(diǎn)演示了 Visual C++ 的功能。
- STL 示例
-
包含演示標(biāo)準(zhǔn)模板庫功能的一些示例。
- ATL 示例
-
包含演示活動(dòng)模板庫 (ATL) 功能的一些示例。
- 編譯器 COM 支持示例
-
包含一些示例,這些示例演示 Visual C++ 編譯器對(duì) COM 的內(nèi)置支持。
- 自定義向?qū)纠?/a>
-
包含一些示例,這些示例說明如何創(chuàng)建您自己的向?qū)韮?yōu)化與創(chuàng)建自定義應(yīng)用程序或添加代碼相關(guān)的任務(wù)。
- 事件處理示例
-
包含一些示例,這些示例演示 Visual C++ 中的事件處理。
- 擴(kuò)展性
-
包含一些示例,這些示例演示如何擴(kuò)展 Visual Studio 和 Visual C++。
- 國(guó)際示例
-
包含一些示例,這些示例演示如何針對(duì)國(guó)際市場(chǎng)編寫代碼。
- 互操作性示例
-
包含一些示例,這些示例演示 COM 和 .NET Framework 之間的互操作性。
- MASM 示例
-
包含一些示例,這些示例演示 Visual C++ 中的 Microsoft Macro Assembler (MASM) 源文件支持。
- MFC 示例
-
包含一些示例,這些示例演示 Microsoft 基礎(chǔ)類 (MFC) 功能。
- Windows SDK 示例
-
包含一個(gè)示例,此示例演示 Windows 圖像獲取 (WIA) 應(yīng)用程序編程接口 (API)。
互操作性示例
http://msdn.microsoft.com/zh-cn/library/wd6032c3.aspx
標(biāo)準(zhǔn)模板庫示例
warning MSB8012: TargetPath(C:\dev\APPFF_SQ2\APP\.\Release\APP_SQ1.exe) 與 Linker 的 OutputFile 屬性值(C:\dev\APPFF_SQ2\APP\Release\MDU2FF_SQ.exe)不匹配。這可能導(dǎo)致項(xiàng)目生成不正確。若要更正此問題,請(qǐng)確保 $(OutDir)、$(TargetName) 和 $(TargetExt) 屬性值與 %(Link.OutputFile) 中指定的值匹配。
warning MSB8012: TargetName(MDU2FF_SQ1) 與 Linker 的 OutputFile 屬性值(MDU2FF_SQ)不匹配。這可能導(dǎo)致項(xiàng)目生成不正確。若要更正此問題,請(qǐng)確保 $(OutDir)、$(TargetName) 和 $(TargetExt) 屬性值與 %(Link.OutputFile) 中指定的值匹配。
1> MD .vcxproj -> C:\dev\APPFF_SQ2\APP\.\Release\ .exe
project name 修改名字.
另外工程配置,鏈接生成--->輸出文件統(tǒng)一.
1、工作空間默認(rèn)
Windows -> Preferrences -> C/C++ -> Editor -> Documentation tool comments
默認(rèn)為none,修改為Doxygen即可
2、工程特別屬性
如果不想設(shè)置為整個(gè)工作空間的默認(rèn)屬性,可以在工作屬性對(duì)話框的這里找到:
Project -> Properties -> C/C++ General -> Enable project specific settings
選擇Doxygen即可
備忘
發(fā)生在析夠函數(shù)中, vs2010 debug 模式 .
CriticalSection::~CriticalSection(void){
DeleteCriticalSection(&m_CritSect);
}
我開始推測(cè),必須退出section才能delete ?
InitializeCriticalSection(&m_CritSect);
EnterCriticalSection(&m_CritSect);
DeleteCriticalSection(&m_CritSect);
實(shí)際上這樣退出是可以的.
問題在哪里?
一個(gè)回調(diào)處理函數(shù)類注冊(cè)到另外一個(gè)線程里面.另外一個(gè)線程一直有消息推送或者調(diào)用其內(nèi)部函數(shù).
~主類(){
aa->release(); //之前沒有這句話 ,內(nèi)部aa 線程一直在運(yùn)行 ,可能是排在析構(gòu) (DeleteCriticalSection)之后或者之前,損壞了這個(gè)變量 m_CritSect
}
這里開始調(diào)用 DeleteCriticalSection(&m_CritSect); 并且報(bào)錯(cuò)了.
別的項(xiàng)目里面拿來的 .h .cpp
因?yàn)楸卷?xiàng)目未使用預(yù)編譯頭.
但是預(yù)編譯頭這個(gè)頭文件存在,里面東西很多.
導(dǎo)致很多宏 或者 常量重復(fù)定義.
定義成標(biāo)準(zhǔn)頭
int main(int argc, char *argv[])
argv[i]
非標(biāo)準(zhǔn)
int main() {
PWSTR cmdLine = GetCommandLineW();
int argc;
PWSTR *argv = CommandLineToArgvW(cmdLine, &argc);
}
//參數(shù)使用
if (argc==3)
{
if (strcmp(argv[0], "-e")==0)
{
iMode = 1;
}
else if (strcmp(argv[0], "-d")==0)
{
iMode =2;
}
sInput=argv[1];
sOutput=argv[2];
}
_tmain
Unicode下就是wmain
否則就是main
[參考]
http://stackoverflow.com/questions/16706632/c-tchar-to-stdstring
我老是搞錯(cuò).
boy.h
class Boy
boy.cpp
Boy g_boy;
使用全局變量
Collection.h
#include “boy.h”
extern Boy g_boy;
似乎更優(yōu)雅的方式
#ifdef _BOY__HH__ extern Boy g_boy ; #endif
錯(cuò)誤方式: 定義宏根本解決不了這個(gè)問題
boy.h
#pragma once #ifndef _BOY__HH__ #define _BOY__HH__
class boy
Boy g_boy;
#endif
編譯錯(cuò)誤
1> .obj : error LNK2005: "class class 全局變量名 " (?g_CITSCache@@3VMarketCache@@A) 已經(jīng)在 XXX.obj 中定義
1> 正在生成非 SAFESEH 映像。
1>D:\XXX.exe : fatal error LNK1169: 找到一個(gè)或多個(gè)多重定義的符號(hào)
等我看了編譯原理再來解釋.
如何防止循環(huán)引用?
A->b->c->A