2012-07-08 40 views
0

正如問題所述,我需要應用這些編譯器/鏈接器設置。我正在使用Code :: Blocks 10.05。我瀏覽了所有的構建設置屏幕。我無法找到應用這些設置的位置。我得到的輸出如下:在Code :: Blocks中應用--enable-shared或-fPIC

-------------- Build: Release in 39dll-4-Linux --------------- 

Linking dynamic library: ./39DLL.so 
/usr/bin/ld: obj/Release/buffer.o: relocation R_X86_64_32 against `CBuffer::retval' can not be used when making a shared object; recompile with -fPIC 
obj/Release/buffer.o: could not read symbols: Bad value 
collect2: ld returned 1 exit status 
Process terminated with status 1 (0 minutes, 0 seconds) 
0 errors, 0 warnings 

回答

2

轉到: 項目 - >構建選項 - >編譯器設置 - >其他選項。

在左邊你會看到一棵樹與構建目標。它看起來像這樣: 項目名 調試 發佈

點擊樹的每個節點上的每個節點在文本框中輸入-fPIC,然後按確定保存。 這種方式將爲所有目標添加標誌。

+0

太棒了!希望我有這個答案,然後我決定廢除codeblocks ....但謝謝 – nterry 2012-10-18 00:19:21