找了一下如何用 CSS 寫出多欄等高的版面, 看到這篇Equal Height Columns with Cross-Browser CSS, 是找到幾個方法裡最完備且乾淨易懂的作法。不過實際應用上會有些小地方要注意, 也難怪有人 Give Up and Use Tables的主張了 ...
以使用 LevelDB 為例。
抓好並編好相關檔案,編譯方式見第三方函式庫附的說明:$ ls include/ # header files
leveldb/
$ ls out-shared/libleveldb.so* # shared library
out-shared/libleveldb.so@ out-shared/libleveldb.so.1@ out-shared/libleveldb.so.1.20*
下面的例子用 clang++ 編譯,這裡用到的參數和 g++ 一樣。
問題一:找不到 header$ clang++ sample.cpp
sample.cpp:5:10: fatal error: 'leveldb/db.h' file not found
#include "leveldb/db.h"
^
1 error generated.
解法:用 -I 指定 header 位置
問題二:找不到 shared library$ clang++ sample.cpp -I include/
/tmp/sample-2e7dd8.o: In function `main':
sample.cpp:(.text+0x1e): undefined reference to `leveldb::Options::Options()'
sample.cpp:(.text+0x6f): undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
sample.cpp:(.text+0x10c): undefined reference to `leveldb::Status::ToString() const'
sample.cpp:(.text+0x7d0): undefined reference to `leveldb::Status::ToString() const'
clang: error: linker command failed with exit code 1 (u…
留言
張貼留言