我们需要使用Makefile将所有内容整合到我们的项目中,但我们的教授从未向我们展示过如何操作.
我只有一个档案a3driver.cpp.驱动程序从某个位置导入类"/user/cse232/Examples/example32.sequence.cpp".
就是这样,其他一切都包含在内.cpp.
我如何制作一个简单的Makefile来创建一个名为a3a.exe?的可执行文件?
我正在将一个C++项目从Windows迁移到Linux,现在我需要创建一个build/make文件.我以前从未创建过build/make文件.我还需要包含Boost库以使其更复杂.它也必须是一个makefile,我还需要学习如何创建makefile,所以CMake和SCON都出来了.由于使用了Boost,IDE也出局了,我的所有IDE(Eclipse,VS等)都只在Windows上运行.我必须从头开始生成一个makefile.
那么创建Linux c ++ make文件的基础知识是什么?如何将Boost库合并到其中以使其正确链接?
到目前为止,我的makefile看起来像这样.我认为CFLAGS并且LDFLAGS是编译器和优化选项,但不完全确定.
CC = g++
CFLAGS = -wall -o3 - c
LDFLAGS = -03 -mfp-rounding-mode=n
Run Code Online (Sandbox Code Playgroud)
我提供赏金,因为我仍然非常迷失.如果有人喜欢冒险,我需要在linux中编译以下内容
simple_ls.h中的标题:
#include "boost/filesystem/operations.hpp"
#include "boost/filesystem/path.hpp"
#include "boost/lexical_cast.hpp"
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
Run Code Online (Sandbox Code Playgroud)
2dquicksort.h中的标题:
#include <stdio.h>
#include <ctype.h>
#include <iostream>
Run Code Online (Sandbox Code Playgroud)
rawr.h中的标头:
#include <iostream> // not required by most systems
#include <fstream>
#include <iomanip>
#include <cstdlib> // or (stdlib.h) for exit()
#include <cmath>
#include <vector>
#include <limits>
#include …Run Code Online (Sandbox Code Playgroud)