g++ -Wall -g -D DEBUG -std=c++14 -c foo.cxx
foo.cxx: In function ‘std::vector<std::vector<int> > permute(std::vector<int>, std::vector<std::vector<int> >, std::vector<int>)’:
foo.cxx:15:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i<nums.size();i++){
~^~~~~~~~~~~~
foo.cxx:27:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
g++ -L. -g foo.o -lm -o foo.exe
A quick check shows that permute() is supposed to return vector<vector<int>> but doesn't.
Also, vector<>::end(), by definition, doesn't refer to a valid value, so line 23 wrong. Use li.pop_back() instead.
That gets the code to run but it still doesn't do any thing. Here is a version that prints the result returned by permute() and also prints the nums and li args of each call to permute. This should help you debug the function.