Ошибка main cpp 312

list<SimpleList<int> *> listSLi;
list<SimpleList<double> *> listSLd;
list<SimpleList<string> *> listSLs;

This is main:

`int main() {
      cout << "Enter name of input file: ";
      string input_f;
      cin >> input_f;

  /*  cout << "Enter name of output file: ";
  string output_f;
  cin >> output_f;
  */
  ifstream input(input_f);
  //  ofstream output(output_f); // Make this a separate function

  string to_parse;
  vector<string> sep_words;
  while (getline(input, to_parse)) {
    //    cout << "PROCESSING COMMAND: " << to_parse << 'n';
    to_parse += 'n'; // getline removes the n on each line
    sep_words = parse_line(to_parse);
    cpp(sep_words);
  }
  return 0;
}

this is the SimpleList class. Derived classes are Stack and Queue.

template<typename T>
class SimpleList {
public:
  SimpleList();
  SimpleList(const string& n);
  virtual void push(T value) =0;
  virtual void pop() =0;
  void set_name(const string&);
  string get_name();
protected:
  void insert_front(T);
  void insert_back(T);
  void remove_front();
  // Should be protected:
  Node<T> first, last, temp;
  string name;
  int size;
};

sep_words will contain 2 or 3 strings.

void cpp(const vector<string>& single_words) {/////////////////////////
   if (single_words.size() == 2) { // pop
     switch(single_words[1][0]) {
     case 'i':
       if(is_name_in(single_words[1], 0) != true) {
         cout << "ERROR: This name does not exist!n";
         return;
       }
       else if (is_list_empty(single_words[1], 0)) { // add == true for readability
         cout << "ERROR: This list is empty!n";
           return;
       }
       else {
 312        find_name(single_words[1], 0)->pop();
       }
       break;

find_name(single_words[1], 0)->pop(); is the problem line

template<typename T>
SimpleList<T>* find_name(const string& nm, int which_type) { // Can do char which_type instead
  // 0 stands for integer 1 stands for double 2 stands for string
  switch(which_type) {
  case 0:
    for (list<SimpleList<int> *>::iterator it = listSLi.begin(); it != listSLi.end(); ++it) {
      if ((*it)->name == nm) { // Use get_name instead
        return *it;
      }
    }
    break;
  case 1:
    for (list<SimpleList<double> *>::iterator it = listSLd.begin(); it != listSLd.end(); ++it) {
      if ((*it)->name == nm) {
        return *it;
      }
    }
    break;
  case 2:
    for (list<SimpleList<string> *>::iterator it = listSLs.begin(); it != listSLs.end(); ++it) {
      if ((*it)->name == nm) {
        return *it;
      }
    }
    break;
  }
}

Here’s the compiler error:

main.cpp: In function ‘void cpp(const std::vector<std::basic_string<char> >&)’:
main.cpp:312:31: error: no matching function for call to ‘find_name(const value_type&, int)’
   find_name(single_words[1], 0)->pop();
                               ^
main.cpp:312:31: note: candidate is:
main.cpp:272:16: note: template<class T> SimpleList<T>* find_name(const string&, int)
 SimpleList<T>* find_name(const string& nm, int which_type) { // Can do char which_type instead
                ^
main.cpp:272:16: note:   template argument deduction/substitution failed:
main.cpp:312:31: note:   couldn't deduce template parameter ‘T’
   find_name(single_words[1], 0)->pop();
                               ^

list<SimpleList<int> *> listSLi;
list<SimpleList<double> *> listSLd;
list<SimpleList<string> *> listSLs;

This is main:

`int main() {
      cout << "Enter name of input file: ";
      string input_f;
      cin >> input_f;

  /*  cout << "Enter name of output file: ";
  string output_f;
  cin >> output_f;
  */
  ifstream input(input_f);
  //  ofstream output(output_f); // Make this a separate function

  string to_parse;
  vector<string> sep_words;
  while (getline(input, to_parse)) {
    //    cout << "PROCESSING COMMAND: " << to_parse << 'n';
    to_parse += 'n'; // getline removes the n on each line
    sep_words = parse_line(to_parse);
    cpp(sep_words);
  }
  return 0;
}

this is the SimpleList class. Derived classes are Stack and Queue.

template<typename T>
class SimpleList {
public:
  SimpleList();
  SimpleList(const string& n);
  virtual void push(T value) =0;
  virtual void pop() =0;
  void set_name(const string&);
  string get_name();
protected:
  void insert_front(T);
  void insert_back(T);
  void remove_front();
  // Should be protected:
  Node<T> first, last, temp;
  string name;
  int size;
};

sep_words will contain 2 or 3 strings.

void cpp(const vector<string>& single_words) {/////////////////////////
   if (single_words.size() == 2) { // pop
     switch(single_words[1][0]) {
     case 'i':
       if(is_name_in(single_words[1], 0) != true) {
         cout << "ERROR: This name does not exist!n";
         return;
       }
       else if (is_list_empty(single_words[1], 0)) { // add == true for readability
         cout << "ERROR: This list is empty!n";
           return;
       }
       else {
 312        find_name(single_words[1], 0)->pop();
       }
       break;

find_name(single_words[1], 0)->pop(); is the problem line

template<typename T>
SimpleList<T>* find_name(const string& nm, int which_type) { // Can do char which_type instead
  // 0 stands for integer 1 stands for double 2 stands for string
  switch(which_type) {
  case 0:
    for (list<SimpleList<int> *>::iterator it = listSLi.begin(); it != listSLi.end(); ++it) {
      if ((*it)->name == nm) { // Use get_name instead
        return *it;
      }
    }
    break;
  case 1:
    for (list<SimpleList<double> *>::iterator it = listSLd.begin(); it != listSLd.end(); ++it) {
      if ((*it)->name == nm) {
        return *it;
      }
    }
    break;
  case 2:
    for (list<SimpleList<string> *>::iterator it = listSLs.begin(); it != listSLs.end(); ++it) {
      if ((*it)->name == nm) {
        return *it;
      }
    }
    break;
  }
}

Here’s the compiler error:

main.cpp: In function ‘void cpp(const std::vector<std::basic_string<char> >&)’:
main.cpp:312:31: error: no matching function for call to ‘find_name(const value_type&, int)’
   find_name(single_words[1], 0)->pop();
                               ^
main.cpp:312:31: note: candidate is:
main.cpp:272:16: note: template<class T> SimpleList<T>* find_name(const string&, int)
 SimpleList<T>* find_name(const string& nm, int which_type) { // Can do char which_type instead
                ^
main.cpp:272:16: note:   template argument deduction/substitution failed:
main.cpp:312:31: note:   couldn't deduce template parameter ‘T’
   find_name(single_words[1], 0)->pop();
                               ^

I am trying to compile a simple application using GLUT on Windows. On Linux, it compiled with no errors. On Windows, I tried Visual C++ Express 2010 and CodeBlocks and got same errors on both. I added libraries, header files and dll files to appropriate directories. I added the libraries to the linker’s settings. Do you know what the problem is?

Errors:

D:PBLcode blocks projectshikakumain.cpp||In function 'void DrawGLScene()':|
D:PBLcode blocks projectshikakumain.cpp|259|error: 'glUseProgramObjectARB' was not     declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|262|error: 'glUniform1ui' was not declared   in this scope|
D:PBLcode blocks projectshikakumain.cpp|263|error: 'glVertexAttribPointerARB' was not declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|270|error: expected initializer before '*' token|
D:PBLcode blocks projectshikakumain.cpp|284|error: expected initializer before '*' token|
D:PBLcode blocks projectshikakumain.cpp||In function 'void log(int)':|
D:PBLcode blocks projectshikakumain.cpp|299|error: 'GL_OBJECT_INFO_LOG_LENGTH_ARB' was not declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|300|error: 'glGetObjectParameterivARB' was not  declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|303|error: 'glGetInfoLogARB' was not declared in this scope|
D:PBLcode blocks projectshikakumain.cpp||In function 'unsigned int load_shader()':|
D:PBLcode blocks projectshikakumain.cpp|310|error: 'glCreateProgramObjectARB' was not declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|311|error: 'GL_VERTEX_SHADER_ARB' was not declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|311|error: 'glCreateShaderObjectARB' was not declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|312|error: 'GL_FRAGMENT_SHADER_ARB' was not declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|313|error: 'V_SHADER' was not declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|313|error: 'glShaderSourceARB' was not   declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|314|error: 'F_SHADER' was not declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|315|error: 'glCompileShaderARB' was not declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|319|error: 'glAttachObjectARB' was not declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|321|error: 'glLinkProgramARB' was not declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|322|error: 'glUseProgramObjectARB' was not declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|323|error: 'glGetUniformLocationARB' was not declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|325|error: 'glGetAttribLocation' was not declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|330|error: 'glUniformMatrix4fv' was not declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|332|error: 'glUseProgram' was not declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|333|error: 'glEnableVertexAttribArray' was not declared in this scope|
D:PBLcode blocks projectshikakumain.cpp|335|error: 'glDeleteObjectARB' was not declared in this scope|
D:PBLcode blocks projectshikakumain.cpp||In function 'int main(int, char**)':|
D:PBLcode blocks projectshikakumain.cpp|355|error: 'glDeleteObjectARB' was not declared     in this scope|
||=== Build finished: 26 errors, 0 warnings ===|

The code if needed:

#define GL_GLEXT_PROTOTYPES 1
#define GL3_PROTOTYPES 1
#include <windows.h>
#include <GL/gl.h>
#include <GL/glext.h>
#include <GL/glut.h>
#include <cstdlib>
#include <iostream>
using std::cout;
using std::endl;
int window;
int shader;

unsigned char texture[]= {0xFF,0xFF,0xFF,0xFF,
                      0xFF,0xFF,0xFF,0xFF,
                      0xFF,0xFF,0xFF,0xFF,
                      0xFF,0xFF,0xFF,0xFF,
                      0xFF,0xFF,0xFF,0xFF,
                      0xFF,0x00,0x00,0xFF,
                      0xFF,0x00,0x00,0xFF,
                      0xFF,0xFF,0xFF,0xFF,
                      0xFF,0xFF,0xFF,0xFF,
                      0xFF,0x00,0x00,0xFF,
                      0xFF,0x00,0x00,0xFF,
                      0xFF,0xFF,0xFF,0xFF,
                      0xFF,0xFF,0xFF,0xFF,
                      0xFF,0xFF,0xFF,0xFF,
                      0xFF,0xFF,0xFF,0xFF,
                      0xFF,0xFF,0xFF,0xFF};
static const float Z=-1.0;

static const float vertices[]={ -0.5, -0.5, Z,
               0.5, -0.5, Z,
               0.5,  0.5, Z,
              -0.5,  0.5, Z };

static const float texcoord[]={ 0.0, 0.0,
               1.0, 0.0,
               1.0, 1.0,
               0.0, 1.0 };

static const char indices[]={ 0,1,2,3 };

unsigned int texcnt;
unsigned int projection_matrix_loc;
unsigned int modelview_matrix_loc;
unsigned int vertex_loc;
unsigned int tex_coordinates_loc;
unsigned int tex_loc;

void InitGL(int Width, int Height) // Funkcja wolana po utworzeniu okna
{
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // kolor tla czarny
glPolygonMode(GL_FRONT_AND_BACK,GL_POLYGON);
glClearDepth(1.0);                    // Enables Clearing Of The Depth Buffer
glEnable(GL_DEPTH_TEST);              // Enables Depth Testing
glEnable(GL_TEXTURE_2D);
glGenTextures(1,&texcnt);
glBindTexture(GL_TEXTURE_2D,texcnt);
glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,4,4,0,GL_RGBA,GL_UNSIGNED_BYTE,texture);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glDisable(GL_TEXTURE_2D);
}

void ReSizeGLScene(int Width, int Height)
{
if (Height==0) Height=1;
glViewport(0, 0, Width, Height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1.0,1.0,-1.0,1.0,1.0,-1.0);
glMatrixMode(GL_MODELVIEW);
}

void DrawGLScene()
{
glutSetWindow(window); // Aktywne okno
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
glUseProgramObjectARB(shader);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D,texcnt);
glUniform1ui(tex_loc,0); // Jednostka teksturuj¹ca 0
glVertexAttribPointerARB(vertex_loc,3,GL_FLOAT,0,0,vertices);
glVertexAttribPointerARB(tex_coordinates_loc,2,GL_FLOAT,0,0,texcoord);
glDrawElements(GL_QUADS, 4, GL_UNSIGNED_BYTE,indices);
glUseProgramObjectARB(0);
glutSwapBuffers();
}

const GLcharARB* V_SHADER[] = { //call per vertex
"uniform mat4 projection_matrix;"
"uniform mat4 modelview_matrix;"
"attribute vec3 vertex;"
"attribute vec2 tex_coordinates;"
"varying vec2 tex_coord;"
"void main()"
"{"
"tex_coord = tex_coordinates;"
"gl_Position = projection_matrix*modelview_matrix*vec4(vertex,1.0);"
"}"
};


const GLcharARB* F_SHADER[] = { //call per pixel
"varying vec2 tex_coord;"
"uniform sampler2D tex;"
"void main()"
"{"
"vec4 color = texture2D(tex,tex_coord);"
"gl_FragColor = color;"
"}"
};


void log(int shader) {
char* info_log;
int info_log_len=0;
int chars_written=0;
glGetObjectParameterivARB(shader,GL_OBJECT_INFO_LOG_LENGTH_ARB,
        &info_log_len);
if (info_log_len>0) {
    info_log= new char[info_log_len];
    glGetInfoLogARB(shader,info_log_len,&chars_written,info_log);
    std::cout << info_log;
    delete [] info_log;
  }
}

unsigned int load_shader() {
unsigned int p = glCreateProgramObjectARB();
unsigned int v = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
unsigned int f = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
glShaderSourceARB(v, 1, V_SHADER,0);
glShaderSourceARB(f, 1, F_SHADER,0);
glCompileShaderARB(v);
log(v);
glCompileShaderARB(f);
log(f);
glAttachObjectARB(p,v);
glAttachObjectARB(p,f);
glLinkProgramARB(p);
glUseProgramObjectARB(p);
modelview_matrix_loc = glGetUniformLocationARB(p,"modelview_matrix");
projection_matrix_loc = glGetUniformLocationARB(p,"projection_matrix");
tex_coordinates_loc = glGetAttribLocation(p,"tex_coordinates");
vertex_loc = glGetAttribLocation(p,"vertex");
tex_loc = glGetUniformLocationARB(p,"tex");
   const float identity[16] =
    {1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1}; // mat jednostkowa nic nie robi
glUniformMatrix4fv(projection_matrix_loc,1,GL_FALSE,identity);
glUniformMatrix4fv(modelview_matrix_loc,1,GL_FALSE,identity);
glUseProgram(0);
glEnableVertexAttribArray(vertex_loc);
glEnableVertexAttribArray(tex_coordinates_loc);
glDeleteObjectARB(v);
glDeleteObjectARB(f);
return p;
}


int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH);
glutInitWindowSize(640, 480);
glutInitWindowPosition(100, 100);
window = glutCreateWindow("Bitmapka");
glutDisplayFunc(&DrawGLScene);
//glutFullScreen();
glutIdleFunc(&DrawGLScene);
glutReshapeFunc(&ReSizeGLScene);
shader = load_shader();
InitGL(640, 480);
glutMainLoop();
glDeleteObjectARB(shader);
glutDestroyWindow(window);
return 0;
}

From the knowledge base
http://support.autodesk.com/getDoc.asp?id=TS48545

Question:
AutoCAD shuts down unexpectedly when you open a drawing, and the
following error message is displayed:

!offset.cpp@312:eInvalidInput.

Answer:

This error occurs as a result of polylines that are corrupt because of
an incorrect bulge or other factors.

This is related to a limit known as the «stable modeling space» of 1
million units from the origin. As the polyline approaches 2 million
units from the point of origin, the following functionality can occur:

When you use the PLJOIN command, the result of the floating point
calculation to incorrectly list values of bulge as 0.000.

When you use a command such as OFFSET the application shuts down and the
following error message is displayed:
!offset.cpp@312:einvalidinput

To resolve this problem, use the RECOVER command to open the drawing, or
in AutoCAD 2000i use the AUDIT command.


Teresa Rosendahl
Autodesk Product Support, Platform Technology Group

Frank van Logten wrote:

> We do simetimes have this error!
> What can cause this error and how can we fix / prevent this?
>
> Thanks,
>
> Frank van Logten


Go to aoe2


r/aoe2

r/aoe2 is going private until June 15 in protest of the upcoming API changes that will kill off 3rd party apps and negatively impact all users.

Check the following links for more info:

https://old.reddit.com/r/Save3rdPartyApps/comments/1476ioa/reddit_blackout_2023_save_3rd_party_apps/

https://theverge.com/2023/6/5/23749188/reddit-subreddit-private-protest-api-changes-apollo-charges

Modmails requesting access during this period will not be answered.




Members





Online



Failed to initialize draw system: main.cpp(312)

I’m getting this error message when i try to launch the game. To be honest i have no idea how to fix it. If someone has suggestions i would be really happy to hear them.

Information:

It worked yesterday, doesn’t work today. The only thing that changed in between was a automatic windows update.

Windows 10 if that’s important

list<SimpleList<int> *> listSLi;
list<SimpleList<double> *> listSLd;
list<SimpleList<string> *> listSLs;

This is main:

`int main() {
      cout << "Enter name of input file: ";
      string input_f;
      cin >> input_f;

  /*  cout << "Enter name of output file: ";
  string output_f;
  cin >> output_f;
  */
  ifstream input(input_f);
  //  ofstream output(output_f); // Make this a separate function

  string to_parse;
  vector<string> sep_words;
  while (getline(input, to_parse)) {
    //    cout << "PROCESSING COMMAND: " << to_parse << 'n';
    to_parse += 'n'; // getline removes the n on each line
    sep_words = parse_line(to_parse);
    cpp(sep_words);
  }
  return 0;
}

this is the SimpleList class. Derived classes are Stack and Queue.

template<typename T>
class SimpleList {
public:
  SimpleList();
  SimpleList(const string& n);
  virtual void push(T value) =0;
  virtual void pop() =0;
  void set_name(const string&);
  string get_name();
protected:
  void insert_front(T);
  void insert_back(T);
  void remove_front();
  // Should be protected:
  Node<T> first, last, temp;
  string name;
  int size;
};

sep_words will contain 2 or 3 strings.

void cpp(const vector<string>& single_words) {/////////////////////////
   if (single_words.size() == 2) { // pop
     switch(single_words[1][0]) {
     case 'i':
       if(is_name_in(single_words[1], 0) != true) {
         cout << "ERROR: This name does not exist!n";
         return;
       }
       else if (is_list_empty(single_words[1], 0)) { // add == true for readability
         cout << "ERROR: This list is empty!n";
           return;
       }
       else {
 312        find_name(single_words[1], 0)->pop();
       }
       break;

find_name(single_words[1], 0)->pop(); is the problem line

template<typename T>
SimpleList<T>* find_name(const string& nm, int which_type) { // Can do char which_type instead
  // 0 stands for integer 1 stands for double 2 stands for string
  switch(which_type) {
  case 0:
    for (list<SimpleList<int> *>::iterator it = listSLi.begin(); it != listSLi.end(); ++it) {
      if ((*it)->name == nm) { // Use get_name instead
        return *it;
      }
    }
    break;
  case 1:
    for (list<SimpleList<double> *>::iterator it = listSLd.begin(); it != listSLd.end(); ++it) {
      if ((*it)->name == nm) {
        return *it;
      }
    }
    break;
  case 2:
    for (list<SimpleList<string> *>::iterator it = listSLs.begin(); it != listSLs.end(); ++it) {
      if ((*it)->name == nm) {
        return *it;
      }
    }
    break;
  }
}

Here’s the compiler error:

main.cpp: In function ‘void cpp(const std::vector<std::basic_string<char> >&)’:
main.cpp:312:31: error: no matching function for call to ‘find_name(const value_type&, int)’
   find_name(single_words[1], 0)->pop();
                               ^
main.cpp:312:31: note: candidate is:
main.cpp:272:16: note: template<class T> SimpleList<T>* find_name(const string&, int)
 SimpleList<T>* find_name(const string& nm, int which_type) { // Can do char which_type instead
                ^
main.cpp:272:16: note:   template argument deduction/substitution failed:
main.cpp:312:31: note:   couldn't deduce template parameter ‘T’
   find_name(single_words[1], 0)->pop();
                               ^

list<SimpleList<int> *> listSLi;
list<SimpleList<double> *> listSLd;
list<SimpleList<string> *> listSLs;

Это главное:

`int main() {
cout << "Enter name of input file: ";
string input_f;
cin >> input_f;

/*  cout << "Enter name of output file: ";
string output_f;
cin >> output_f;
*/
ifstream input(input_f);
//  ofstream output(output_f); // Make this a separate function

string to_parse;
vector<string> sep_words;
while (getline(input, to_parse)) {
//    cout << "PROCESSING COMMAND: " << to_parse << 'n';
to_parse += 'n'; // getline removes the n on each line
sep_words = parse_line(to_parse);
cpp(sep_words);
}
return 0;
}

это класс SimpleList. Производные классы — это стек и очередь.

template<typename T>
class SimpleList {
public:
SimpleList();
SimpleList(const string& n);
virtual void push(T value) =0;
virtual void pop() =0;
void set_name(const string&);
string get_name();
protected:
void insert_front(T);
void insert_back(T);
void remove_front();
// Should be protected:
Node<T> first, last, temp;
string name;
int size;
};

sep_words будет содержать 2 или 3 строки.

void cpp(const vector<string>& single_words) {/////////////////////////
if (single_words.size() == 2) { // pop
switch(single_words[1][0]) {
case 'i':
if(is_name_in(single_words[1], 0) != true) {
cout << "ERROR: This name does not exist!n";
return;
}
else if (is_list_empty(single_words[1], 0)) { // add == true for readability
cout << "ERROR: This list is empty!n";
return;
}
else {
312        find_name(single_words[1], 0)->pop();
}
break;

find_name (single_words [1], 0) -> pop (); это проблема линии

template<typename T>
SimpleList<T>* find_name(const string& nm, int which_type) { // Can do char which_type instead
// 0 stands for integer 1 stands for double 2 stands for string
switch(which_type) {
case 0:
for (list<SimpleList<int> *>::iterator it = listSLi.begin(); it != listSLi.end(); ++it) {
if ((*it)->name == nm) { // Use get_name instead
return *it;
}
}
break;
case 1:
for (list<SimpleList<double> *>::iterator it = listSLd.begin(); it != listSLd.end(); ++it) {
if ((*it)->name == nm) {
return *it;
}
}
break;
case 2:
for (list<SimpleList<string> *>::iterator it = listSLs.begin(); it != listSLs.end(); ++it) {
if ((*it)->name == nm) {
return *it;
}
}
break;
}
}

Вот ошибка компилятора:

main.cpp: In function ‘void cpp(const std::vector<std::basic_string<char> >&)’:
main.cpp:312:31: error: no matching function for call to ‘find_name(const value_type&, int)’
find_name(single_words[1], 0)->pop();
^
main.cpp:312:31: note: candidate is:
main.cpp:272:16: note: template<class T> SimpleList<T>* find_name(const string&, int)
SimpleList<T>* find_name(const string& nm, int which_type) { // Can do char which_type instead
^
main.cpp:272:16: note:   template argument deduction/substitution failed:
main.cpp:312:31: note:   couldn't deduce template parameter ‘T’
find_name(single_words[1], 0)->pop();
^

0

Решение

как говорится в сообщении об ошибке, компилятор не может определить тип T в вашем шаблоне.

template<typename T>
SimpleList<T>* find_name(const string& nm, int which_type); ....

Здесь тип T является параметром функции. Но компилятор не может знать, какой тип вы имеете в виду, так как он не появляется в аргументах.

 const string& nm, int which_type // what shall be T?

Так что, возможно, вместо string Вы хотите T здесь, или поставьте тип прямо как find_name<string>(...)

Я не понял всей цели, но это устраняет ошибку 🙂

Улучшение:

флаг which_type вероятно, в этом нет необходимости, поскольку диспетчеризация может выполняться на уровне перегрузки. См. Тегирование (например, iterator_tags в stl) и перегрузку в целом.

3

Другие решения

Других решений пока нет …

  • #1

I am playing HD edition since yesterday that I got my comp back, and I discovered terrible thing. I cannot see my boars playing at 1360×768…

So I changed resolution to 1024×578. And it was so nice for me, everything on my desktop was bigger.

But Hd Edition gives me this error

Code:

Error

Monitor is too small, must be at least 900x600

: main.cpp(312)

How do I hack this to work?

SouFire

Mar 11, 2011

3,704

2,604

128

33

Mexico


  • #2

That error shows the answer, the game was modified to run using as minimal 900×600, that resolution you are using doesn’t support the same size(relation aspect), however try steam commands, look for the resolution commands, you just have to set in launch parameters something like w-578 and see if it adjust at the size that you want.

Other than that you must be the first human being that prefers playing in lower resolutions.

Spaden

Nov 30, 2011

2,369

547

128


  • #4

Why on earth would you want to play on low res? 11

  • #5

So I can see! My vision is bad 11

  • #6

Maybe see an optometrist and use glasses instead of playing on low resolution? 11

  • #7

I am! but didn’t get my contact yet

  • Ошибка main beam bulb faulty
  • Ошибка mail delivery system
  • Ошибка magic bullet looks sony vegas
  • Ошибка mafia 3 application
  • Ошибка macro names must be identifiers