開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
gcc on mac
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
在嘗試用the c++ stl 2nd上面的範例
餵入的資料(Input):
預期的正確結果(Expected Output):
沒有warning
已經會出現結果
錯誤結果(Wrong Output):
編譯時會出現
g++ -std=c++11 -c tuple2.cpp
g++ -std=c++11 tuple2.o printtuple.hpp.gch -o tuple
ld: warning: ignoring file printtuple.hpp.gch, file was built for
unsupported file format ( 0x67 0x70 0x63 0x68 0x2B 0x30 0x31 0x34
0xB8 0x62 0x17 0x5B 0x21 0x3A 0xBC 0x15 ) which is not the
architecture being linked (x86_64): printtuple.hpp.gch
程式碼(Code):(請善用置底文網頁, 記得排版)
http://pastie.org/pastes/9933717 printtuple.hpp
http://pastie.org/9933732 tuple2.cpp
http://pastie.org/9933730#4 makefile
還在研究makefile..
補充說明(Supplement):
不知道這個warning是什麼意思
想請教各位大大
感謝~
作者:
LPH66 (-6.2598534e+18f)
2015-02-10 14:55:00這個檔案是所謂的 precompiled header file不需要在指令裡指定, 只要有下相關參數就會自動拉進來它的用途是在當程式的許多部件都引入這個標頭檔時可以省去重新將標頭檔內容進行語法分析的步驟(大概像是「先前看這標頭檔時記下的筆記」這樣的東西)唔嗯, 看了一下網路文章似乎 g++ 有看到 .gch 會自動使用
作者:
LPH66 (-6.2598534e+18f)
2015-02-10 19:33:00不使用 precompiled header 的話, 把第 6,7 行拿掉第 2,3 行的 printtuple.hpp.gch 也拿掉就好