【发布时间】:2010-12-25 23:37:06
【问题描述】:
所以我是 linux 的新手。我已经设置了 linux Debian,我已经安装了 gcc。我有一个使用 boost 线程库的简单 C++ 文件。让我们将该文件称为 example.cpp,我们有它的确切路径。如何编译它? (对不起,我来自 windows 世界=)
【问题讨论】:
标签: c++ linux gcc compiler-construction g++
所以我是 linux 的新手。我已经设置了 linux Debian,我已经安装了 gcc。我有一个使用 boost 线程库的简单 C++ 文件。让我们将该文件称为 example.cpp,我们有它的确切路径。如何编译它? (对不起,我来自 windows 世界=)
【问题讨论】:
标签: c++ linux gcc compiler-construction g++
假设example.cpp 在当前目录中,这将创建一个名为example 的可执行文件,链接到boost-thread。 g++ 将在系统库位置搜索库。
g++ example.cpp -lboost-thread -o example
【讨论】:
sudo apt-get install libboost-dev 的操作