小编Tim*_*vic的帖子

C++错误:体系结构x86_64的未定义符号

我正在尝试学习C++,并尝试解决一个问题,在这个步骤中给出了许多步骤以及可以采用的步骤的数量,给出了爬上台阶的可能方法的所有排列.因此,例如,如果有5个步骤可以攀爬,我可以一次向上移动1步,一次向上移动2步,或者一次向上移动3步,我需要打印出1,2和3的所有排列,加起来5: [1, 1, 1, 1, 1],[1, 1, 1, 2]....

我开始使用这段代码(它还没有完成),但是我收到了这个错误:

Undefined symbols for architecture x86_64:
  "_num_steps(int, std::__1::vector<int, std::__1::allocator<int> >, std::__1::vector<std::__1::vector<int, std::__1::allocator<int> >, std::__1::allocator<std::__1::vector<int, std::__1::allocator<int> > > >, std::__1::vector<std::__1::vector<int, std::__1::allocator<int> >, std::__1::allocator<std::__1::vector<int, std::__1::allocator<int> > > >)", referenced from:
      num_steps(int, std::__1::vector<int, std::__1::allocator<int> >) in num_steps-FTVSiK.o
ld: symbol(s) not found for architecture x86_64
Run Code Online (Sandbox Code Playgroud)

我真的不明白我做错了什么.如果我能得到一些帮助,我会很感激.谢谢!

#include <iostream>
#include <vector>
#include <string>
#include <cmath>

using namespace std;

//prototypes
void _num_steps(int amount, vector<int> possible_steps, vector<vector<int>> steps_list,             vector<vector<int>> result);
int sum(vector<int> steps_list);
void num_steps(int …
Run Code Online (Sandbox Code Playgroud)

c++ vector permutation c++11

12
推荐指数
2
解决办法
5万
查看次数

标签 统计

c++ ×1

c++11 ×1

permutation ×1

vector ×1