using namespace seqan

当我们想把seqan作为第三方库,比如说想用using namespace seqan;
官方文档为:
Integration with your own Build System
其中makefile.rules内容在我的机器上是:

SRC=/home/wangjing/Downloads/wj_Pro/seqan_test/src

CXXFLAGS+=-I/home/wangjing/Downloads/SeqAn/seqan-library-2.0.0/include -std=c++14

default: all

all: main

main: main.o

$(CXX) $(LDFLAGS) -o main main.o

main.o: $(SRC)/main.cpp

$(CXX) $(CXXFLAGS) -c -o main.o $(SRC)/main.cpp

clean:

rm -f main.o main

.PHONY: default all clean

其中,很重要的一句话是:add include and include to your include path,也就是要实现这个命令:

g++ -I$HOME/seqan-libarary/include

在这里它说的两个include,哪儿来的两个?我就写了一个!seqan的library文件里的include,里面全是.h文件。不用考虑下载seqan的source file. 因为seqan只是一个头文件lib!

SeqAn is a header library only. Simply add include and include to your include path and you can use SeqAn

原文档有句话写着:

On Linux, you have to link against librt. For GCC, add the flag -lrt to the g++ compiler call.

我曾经错误地将这个-lrt的flag加到 $LDFLAGS里,有问题。
-lrt一般用在其他命令后面,比如

ls -lrt

意思是从旧到新列出目录里的内容(从新到旧事 ls -lt),具体地看:

-l use a long listing format 以长列表方式显示(详细信息方式)
-t sort by modification time 按修改时间排序(最新的在最前面)
-r reverse order while sorting (反序)

官方文档里的其他三个makefile文件就照抄,没有问题。不要给g++多加参数比如它嘟囔的

-W -Wall -Wno-long-long -pedantic -Wno-variadic-macros

它只是防止出现一些warnings ,在开始学习阶段没有太大必要。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容