先提供linux版本為:Linux Mint 17 Qiana
小弟目前在做專題中需要用到字串轉成點陣圖印出,故參考以下網頁
https://github.com/descent/progs/tree/master/cpp11_utf8
為了能編譯,照著以下網頁步驟安裝了clang與libc++
http://www.cnblogs.com/codemood/p/3142848.html
有先編譯hello world,順利的成功了也能執行
clang++ -g -stdlib=libc++ -std=c++11 -I/usr/include/c++/v1/
-I/usr/include/c++/v1/include/ `freetype-config --cflags` -Wall -W -I. -c
hello.cpp
clang++ -o hello hello.o -stdlib=libc++ -std=c++11 -I/usr/include/c++/v1/
-I/usr/include/c++/v1/include/ `freetype-config --libs`
在把字串轉點陣圖的main.cpp轉.o檔時跳出兩個警告,說有兩個變數沒在程式碼裡調用到
(我認為是沒有影響)
main1.cpp:76:6: warning: unused variable 'starty' [-Wunused-variable]
int starty = pen_y;
^
main1.cpp:75:6: warning: unused variable 'startx' [-Wunused-variable]
int startx = pen_x; //startx與 starty需定義 ...
^
2 warnings generated.
在把.o檔轉成執行檔時跳出錯誤:
xxs4129-Aspire-5750G xxs4129 # clang++ -o main1 main1.o -stdlib=libc++
-std=c++11 -I/usr/include/c++/v1/ -I/usr/include/c++/v1/include/
`freetype-config --libs`
/usr/bin/ld: main1.o: undefined reference to symbol
'__cxa_free_exception@@CXXABI_1.3'
//usr/lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing
from command line
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
有去google過但還是看不懂如何解決
這是我用的 main1.cpp 跟原本的一樣只是自己為了讀懂多了蠻多註解
https://mega.co.nz/#!x4lR3Y6K!L8_Z5PmLnd_yYhewgQy1FZPsaDmU0MwqfUbffJs1wxQ
還請各位大大有空能幫忙看一下
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 124.6.19.51
※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1427708166.A.FBA.html
※ x049:轉錄至看板 C_and_CPP 03/30 20:01
→
03/30 22:37, , 1F
03/30 22:37, 1F
→
03/30 22:58, , 2F
03/30 22:58, 2F
→
03/30 23:02, , 3F
03/30 23:02, 3F
→
03/30 23:03, , 4F
03/30 23:03, 4F
→
03/30 23:08, , 5F
03/30 23:08, 5F
→
03/30 23:22, , 6F
03/30 23:22, 6F
→
03/30 23:23, , 7F
03/30 23:23, 7F
→
03/30 23:51, , 8F
03/30 23:51, 8F
→
03/30 23:53, , 9F
03/30 23:53, 9F
→
03/31 00:00, , 10F
03/31 00:00, 10F
→
03/31 00:01, , 11F
03/31 00:01, 11F
→
03/31 00:08, , 12F
03/31 00:08, 12F
→
03/31 00:11, , 13F
03/31 00:11, 13F
→
03/31 00:14, , 14F
03/31 00:14, 14F
→
03/31 00:18, , 15F
03/31 00:18, 15F
→
03/31 00:23, , 16F
03/31 00:23, 16F
→
03/31 00:24, , 17F
03/31 00:24, 17F
→
03/31 00:26, , 18F
03/31 00:26, 18F
→
03/31 00:27, , 19F
03/31 00:27, 19F
→
03/31 00:27, , 20F
03/31 00:27, 20F
→
03/31 00:35, , 21F
03/31 00:35, 21F
→
03/31 00:36, , 22F
03/31 00:36, 22F
→
03/31 00:39, , 23F
03/31 00:39, 23F
→
03/31 00:47, , 24F
03/31 00:47, 24F
→
03/31 00:51, , 25F
03/31 00:51, 25F
→
03/31 00:51, , 26F
03/31 00:51, 26F
→
03/31 00:52, , 27F
03/31 00:52, 27F
→
03/31 00:58, , 28F
03/31 00:58, 28F
→
03/31 01:25, , 29F
03/31 01:25, 29F
→
03/31 01:31, , 30F
03/31 01:31, 30F
→
03/31 01:44, , 31F
03/31 01:44, 31F
→
03/31 02:35, , 32F
03/31 02:35, 32F
→
03/31 02:36, , 33F
03/31 02:36, 33F
→
03/31 02:38, , 34F
03/31 02:38, 34F
→
03/31 02:54, , 35F
03/31 02:54, 35F
→
03/31 02:56, , 36F
03/31 02:56, 36F
→
03/31 02:59, , 37F
03/31 02:59, 37F
→
03/31 02:59, , 38F
03/31 02:59, 38F
→
03/31 03:08, , 39F
03/31 03:08, 39F
→
03/31 03:08, , 40F
03/31 03:08, 40F
→
03/31 03:08, , 41F
03/31 03:08, 41F
→
03/31 03:08, , 42F
03/31 03:08, 42F
→
03/31 03:09, , 43F
03/31 03:09, 43F
→
03/31 03:10, , 44F
03/31 03:10, 44F
→
03/31 03:10, , 45F
03/31 03:10, 45F
→
03/31 03:10, , 46F
03/31 03:10, 46F
→
03/31 03:11, , 47F
03/31 03:11, 47F
推
03/31 03:20, , 48F
03/31 03:20, 48F
→
03/31 03:21, , 49F
03/31 03:21, 49F
→
03/31 03:21, , 50F
03/31 03:21, 50F
→
03/31 03:22, , 51F
03/31 03:22, 51F
→
03/31 03:23, , 52F
03/31 03:23, 52F
→
03/31 03:27, , 53F
03/31 03:27, 53F
→
03/31 03:31, , 54F
03/31 03:31, 54F
→
03/31 03:32, , 55F
03/31 03:32, 55F
→
03/31 03:33, , 56F
03/31 03:33, 56F
→
03/31 05:13, , 57F
03/31 05:13, 57F