clang++編譯時發生錯誤 - Linux

By Tristan Cohan
at 2015-03-30T17:36
at 2015-03-30T17:36
Table of Contents
先提供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
還請各位大大有空能幫忙看一下
--
Tags:
Linux
All Comments

By Rebecca
at 2015-04-01T05:31
at 2015-04-01T05:31

By Tracy
at 2015-04-04T10:33
at 2015-04-04T10:33

By Mason
at 2015-04-06T13:29
at 2015-04-06T13:29

By David
at 2015-04-08T00:26
at 2015-04-08T00:26

By Kyle
at 2015-04-11T07:45
at 2015-04-11T07:45

By Elizabeth
at 2015-04-13T18:26
at 2015-04-13T18:26

By Joseph
at 2015-04-17T20:27
at 2015-04-17T20:27

By Queena
at 2015-04-20T16:34
at 2015-04-20T16:34

By Suhail Hany
at 2015-04-22T17:48
at 2015-04-22T17:48

By Faithe
at 2015-04-22T19:35
at 2015-04-22T19:35

By Agnes
at 2015-04-25T02:34
at 2015-04-25T02:34

By Kristin
at 2015-04-26T18:39
at 2015-04-26T18:39

By Eden
at 2015-04-28T05:08
at 2015-04-28T05:08

By Bethany
at 2015-04-29T22:27
at 2015-04-29T22:27

By Wallis
at 2015-05-04T00:24
at 2015-05-04T00:24

By Emma
at 2015-05-06T23:58
at 2015-05-06T23:58

By Hamiltion
at 2015-05-07T23:39
at 2015-05-07T23:39

By Annie
at 2015-05-12T02:47
at 2015-05-12T02:47

By Heather
at 2015-05-14T18:30
at 2015-05-14T18:30

By Isabella
at 2015-05-15T07:31
at 2015-05-15T07:31

By Carol
at 2015-05-19T23:29
at 2015-05-19T23:29

By Audriana
at 2015-05-24T08:09
at 2015-05-24T08:09

By Dora
at 2015-05-26T14:41
at 2015-05-26T14:41

By Lydia
at 2015-05-30T18:07
at 2015-05-30T18:07

By Susan
at 2015-05-31T03:12
at 2015-05-31T03:12

By Robert
at 2015-06-02T11:49
at 2015-06-02T11:49

By Callum
at 2015-06-04T21:09
at 2015-06-04T21:09

By Irma
at 2015-06-09T10:37
at 2015-06-09T10:37

By Doris
at 2015-06-11T10:34
at 2015-06-11T10:34

By Kristin
at 2015-06-15T05:21
at 2015-06-15T05:21

By Michael
at 2015-06-20T00:57
at 2015-06-20T00:57

By Jessica
at 2015-06-21T16:08
at 2015-06-21T16:08

By Tom
at 2015-06-26T14:57
at 2015-06-26T14:57

By Dora
at 2015-07-01T07:59
at 2015-07-01T07:59

By Xanthe
at 2015-07-04T14:33
at 2015-07-04T14:33

By Daniel
at 2015-07-06T03:22
at 2015-07-06T03:22

By Heather
at 2015-07-08T23:46
at 2015-07-08T23:46

By Isabella
at 2015-07-11T12:10
at 2015-07-11T12:10

By Dora
at 2015-07-13T07:04
at 2015-07-13T07:04

By Lauren
at 2015-07-17T23:51
at 2015-07-17T23:51

By Hedda
at 2015-07-20T09:12
at 2015-07-20T09:12

By Elma
at 2015-07-20T19:09
at 2015-07-20T19:09

By Tom
at 2015-07-21T02:25
at 2015-07-21T02:25

By Ursula
at 2015-07-25T16:38
at 2015-07-25T16:38

By Yuri
at 2015-07-28T21:44
at 2015-07-28T21:44

By Kumar
at 2015-07-31T13:46
at 2015-07-31T13:46

By Connor
at 2015-08-03T14:58
at 2015-08-03T14:58

By Dorothy
at 2015-08-04T20:49
at 2015-08-04T20:49

By Agnes
at 2015-08-09T19:43
at 2015-08-09T19:43
Related Posts
Linux程式設計完全攻略

By Elizabeth
at 2015-03-30T12:32
at 2015-03-30T12:32
接USB總要插拔五六次

By Caroline
at 2015-03-29T15:53
at 2015-03-29T15:53
Captive Portal疑問

By Kristin
at 2015-03-29T14:36
at 2015-03-29T14:36
Dell E2014h 在 Linux 上的解析度問題

By Delia
at 2015-03-28T23:45
at 2015-03-28T23:45
awk與csh 搭配傳入外部變數的問題

By Lily
at 2015-03-28T03:07
at 2015-03-28T03:07