[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Linker Problem while linking List<Path_store>Path

Posted on 2004-11-29
18
Medium Priority
?
536 Views
Last Modified: 2013-11-17
I m getting linking errors

like
Dijkstra's error LNK2019: unresolved external symbol "public: __thiscall List<struct Path_store>::List<struct Path_store>(void)" (??0?$List@UPath_store@@@@QAE@XZ) referenced in function "public: __thiscall Interface::Interface(void)" (??0Interface@@QAE@XZ)

I m giving my 3 files Interface.h , linklst.cpp and .h file as I think these are related.

Interface.h

#ifndef INTERFACE_H
#define INTERFACE_H

// Header Files
#include "iostream"     // Input & Output
#include "stdlib.h"       // Use of std lib functions such as exit()
#include "stdio.h"        // Use of Input and Output Streams
#include "apvector.h"       // Used apvectors in the program
#include "Listlnk.h"     // Use of member functions of the list class

using namespace std;
// -----------------------------------------------------------------------------

// Structure for the input provided by the user

struct UserInput
{

  int vertex_1;         // Stores the first vertex
  int vertex_2;         // Stores the second vertex
  int Edge_Len;         // stores the length of the edge formed by the
                        // 2 vertices

};

// -----------------------------------------------------------------------------

// Structure for the priority queue of the Dijkstra's Algorithm

struct Prior_Q

{

  int vertex ;           // Stores the Vertices of the Graph
  int Source_Dist;      /* Stores the distance of that vertex from the source
                            vertex initially all but the source = -1.
                            -1 implies that the cost of path to that vertex
                            from the source is infinit */

};

// -----------------------------------------------------------------------------

// Structure for the Shortest/Min cost Path Storage at a given instance.

struct Path_store

{

  int vertex;           // Stores the vertex in the sloution set 'S'
  int Ver_Dist;         // Stores the shortest distance from the source.
  apvector<int> path;   // Stores the shortest path to this vertex from the
                        //  source

};


//------------------------------------------------------------------------------

// Class Interface

class Interface

{

  // ---------------------------------------------------------------------------

  public:

  // Constructor of the class

  Interface();

//------------------------------------------------------------------------------

// Input Functions

// Store the source and the end destination to the private data members.

void store_source_sink ( int source, int sink);

// Input the graph values

void input_graph(int vert_1, int vert_2, int pathLen);

// Error if same set of vertices is found in the Input List

bool same_vert_error (int vert1, int vert2);

//------------------------------------------------------------------------------

// Priority Queue Functions

// Add vertex to priority queue if it does not already exist in the priority
// queue.

void add_to_pqueue(int vert);

// Sort the priority queue according to distance of the vertex from the source
// vertex. A value of -1 implies infinity.

void sort_pqueue_dist();

// Sort the priority the queue according to vertex number
// Adds the vertex at the appropriate place.

void sort_pqueue_vert(Prior_Q &queue);

// Search the priority Q (already sorted) for a certain vertex.
// Leave the cursor at the element if found.

bool search_pqueue_vert(int key_Vert);

// Returns true if the priority queue head position implies
// there is only one element in the p-Queue

bool is_q_at_end();

//Pops the top element of the priority queue

void remove_top( Prior_Q &temp);

// Replaces the distance from the source for the vertex marked by the cursor

void replace_dist_inQ(int dist);

//------------------------------------------------------------------------------

// Path Store operations

// Adds a vertex along with its distance from the source and the corresponding
// path to the path storage.

void add_to_path(int vert, int dist, apvector<int> path);

// Searches the passed vertex and return true if it is found in the Path Store
// List

bool searchvert_in_path(int active_vert);

// Add the shortest path for a vertex to the PathStore structure.

void add_shortest_path( int vertex, int Path_Size, apvector<int> path);

// Relax the neighbouring edges and evaluate the distances of the correspoding
// vertex/Ces to the Source.

void relax_edge(int Active_vertex);
//------------------------------------------------------------------------------

// Searches for the passsed vertex in the sloution set of the Dijkstra's
// Algorithm

bool searchVertin_solnset(int vert);

//------------------------------------------------------------------------------

// Display the output. The path and shortest length

void show_result();

//------------------------------------------------------------------------------

private:

// private data members.

int source;             // Stores the source vertex while finding the shortest
                        // path

int sink;               // Stores the vertex to which the shortest path from the
                        // source is intended to.

List<UserInput> input;  // Stores the graph vertices along with the
                        // corresponding edge lengths.

List<Prior_Q>  P_Queue; // Stores the priority queue of the Dijkstra's Algorithm

List<Path_store>Path;   // Stores the shortest path & the value to  a vertex
                        // from a given source at a given time.

apvector<int> SolnSet;  // Stores the vertices already dealt with permanently.
                        // Stores the solution set of Dijkstra Algorithm.

};

#endif

Linklst.h

#ifndef LISTLNK_H
#define LISTLNK_H


template <class LE>
class List;

template < class LE >
class ListNode        // Facilitator class for the List class
{

  public:
    // Constructor
    ListNode ( const LE &elem, ListNode *nextPtr );

    // Data members

    LE element;
    ListNode *next;
    friend class List<LE>;
};

//------------------------------------------------------------------------------

template <class LE>
class List
{
  public:

      // Constructor

        List ( );

      void insert (const LE &newElement );      // Insert after cursor
      void remove ();                           // Remove Element
      void replace ( const LE &newElement );    // Replace Element
      void clear ();                             // Clear List

      // List status operations

      int empty () const;                       // List is empty
      int full () const;                        // List is full

      // List iteration operations

      int gotoBeginning ();                     // Go To Beginning
      int gotoEnd ();                           // Go to End
      int gotoNext ();                          // Go to next element
      int gotoPrior ();                        // Go to prior element
      LE  getCursor () const;                   // Return element
      int getLength();                          // Returns the length of the list
      bool isAtEnd () const;                    // Returns true if the cursor is at
                                                // end of the list


      // Output the list structure -- used in testing/debugging

      void showStructure () const;

      // In-lab oprations

      void moveToBeginning () ;                 // Move to beginning
      void insertBefore ( const LE &newElement ); // Insert before cursor

      private:

      // Data members
      ListNode<LE> *head, *cursor;         // Pointer to the beginning of the list
                                          // Cursor pointer

      friend class Interface;
      friend class ListNode<LE>;
};

#endif

linklst.cpp

// Header Files

#include "iostream.h"       // Input and Ouput
#include "listlnk.h"        // Implementation of the list functions

//------------------------------------------------------------------------------

// ListNode Class Constructor

template <class LE>
ListNode<LE>::ListNode ( const LE &elem, ListNode *nextPtr )
{
    element = elem;
    next    = nextPtr;
}

//------------------------------------------------------------------------------

// List Class Constructor

template <class LE>
List<LE>:: List ()
{
  head    = NULL;
  cursor  = NULL;

}

//------------------------------------------------------------------------------

//List class insert function. Inserts after cursor position

template <class LE>
void List<LE> :: insert ( const LE &newElement )
{
  if(!full())
  {
    if(!empty())
    {
      ListNode<LE> *temp1;
      temp1 = cursor;

      cursor = new ListNode<LE>( newElement, cursor->next);
      temp1->next = cursor;
    }

    else

    {

      cursor = new ListNode<LE> ( newElement, NULL);

      head = cursor;
    }
  }
}//end of void

//------------------------------------------------------------------------------

// List class remove function. remove element marked by cursor

template <class LE>
void List<LE> :: remove ()
{
  if(!empty())
  {
    ListNode<LE>  *temp1;

    temp1 = head;
    if( head != cursor )
    {
      while(temp1->next != cursor)
            temp1 = temp1->next;

      temp1->next = cursor->next;
      temp1 = cursor;

      if( cursor ->next !=NULL)
          cursor = cursor -> next;
      else
          cursor = head;

      delete [ ] temp1;
    }

    else
      if( cursor->next == NULL )
      {

        temp1 = cursor;
        cursor = NULL;
        head  = NULL;

        delete [  ] temp1;
      }

      else
        if( cursor->next != NULL)
        {
          temp1 = head;
          head = head->next;
          cursor = head;

          delete temp1;

        }
  }
};

//------------------------------------------------------------------------------

// List class replace function . replaces the element marked by the cursor

template <class LE>
void List<LE>::replace( const LE &newElement )
{
  if ( ! empty ( ) )
  {
    cursor->element = newElement;
  }
}

//------------------------------------------------------------------------------

// List class clear function. Clears the list

template<class LE>
void List<LE>::clear( )
{
    cursor = head;

    while ( cursor !=NULL )
    {
      head = cursor->next;
      delete [ ] cursor;
      cursor = head;
    }
}//end of void

//------------------------------------------------------------------------------

// List class empty status function

template <class LE>
int List<LE> :: empty ( ) const
{
  if ( cursor == NULL ) // returns if 1 empty
        return 1;

  else
        return 0;
}

//------------------------------------------------------------------------------

// List class  full status function

template <class LE>
int List<LE>::full ( ) const
{
  ListNode<LE>  *temp;

  if( temp == NULL )
      return 1;           // returns 1 is full

  else
      return 0;             // returns 0 otherwise

}

//------------------------------------------------------------------------------

// List class go to Begin function. Cursor moves to the beginning

template <class LE>
int List<LE>::gotoBeginning ()
{
  if(! empty ())
  {
      cursor = head;
      return 1;

  }

  else
  {
    return 0;
  }
}

//------------------------------------------------------------------------------

// List class go to end function. Cursor moves to the end of the list

template <class LE>
int List<LE>::gotoEnd ()
{
    if(! empty () )
    {
      while (cursor->next != NULL)
        cursor = cursor->next;

          return 1;
    }

    else
    {
        return 0;
    }
}

//------------------------------------------------------------------------------

// List class to go Next function Cursor moves to the next element in the list

template <class LE>
int List<LE>::gotoNext ()
{
  if(!empty ())
  {
    if(cursor->next !=NULL)
    {
      cursor = cursor->next;
          return 1;
    }

    else
    {
      return 0;
    }
  }

  else
  {
    return 0;
  }
}

//------------------------------------------------------------------------------

// List class getcursor for Returns the element marked by the cursor

template <class LE>
LE List<LE>::getCursor () const
{
  if(!empty ())
  {
    return cursor->element;
  }
}

//------------------------------------------------------------------------------

// List class goto Prior function Cursor moves to the prior element

template <class LE>
int List<LE>::gotoPrior ()
{
  if(!empty() && head!=cursor )
  {
    ListNode<LE> * temp;

    temp = head;

    while(temp->next != cursor)
        temp = temp->next;

        cursor = temp;
        return 1;
  }

  else
  {
    return 0;
  }
}

//------------------------------------------------------------------------------

template <class LE>
void List<LE>::showStructure () const

// Outputs the elements in a list. If the list is empty , outputs
// "Empty List". This operation is intended for testing and debugging purpose only

{

  ListNode<LE> *p;      // Interface through the list

  if ( head  == 0 )
      cout << "Empty list" << endl;

  else
  {
    for( p = head; p!= 0; p = p->next )

    if ( p == cursor )
        cout << "[" << p->element << "] ";
    else
      cout << p->element << " ";
        cout << endl;
  }
}


//------------------------------------------------------------------------------

// Returns the number of nodes in the linked list.

template <class LE>
int List<LE>::getLength()
{
  if(empty())
    return 0;
  else
  {
    ListNode<LE> *temp;
    temp = cursor;

    int i = gotoBeginning();
    int count = 1;

    while( cursor->next !=NULL)
    {
      cursor = cursor->next;
      count++;
    }

    cursor = temp;
    return count;
  }
}

//------------------------------------------------------------------------------

// List class insertbefore function. Inserts a new node before the position
// marked by the cursor.

template <class LE>
void List<LE>::insertBefore ( const LE &newElement )
{
  if(!full())
  {
    if(!empty() && head != cursor)
    {
      ListNode<LE> *temp;

      temp = head;
      while( temp->next != cursor)
           temp = temp->next;

        cursor = new ListNode<LE> ( newElement, cursor)

        temp->next = cursor;
    }

    else

    {

      cursor = new ListNode<LE> ( newElement, cursor);
      head = cursor;
    }
  }
}

//------------------------------------------------------------------------------

// Returns true if the cursor is at the end of the list else returns false

template <class LE>
bool List<LE>::isAtEnd() const
{
  if(!empty())
  {
    if( cursor->next == NULL)
        return true;
    else
        return false;
  }

  return false;
}


What can be the reason calling this linking problem....
I need help on this problem immediately...I m doing a mesh project in the uni which is due soon and I m stuck on this linker error

Regards

Harsimrat
0
Comment
Question by:hthukral
  • 9
  • 5
  • 2
16 Comments
 

Author Comment

by:hthukral
ID: 12703381
Dijkstra's error LNK2019: unresolved external symbol "public: __thiscall List<struct Prior_Q>::List<struct Prior_Q>(void)" (??0?$List@UPrior_Q@@@@QAE@XZ) referenced in function "public: __thiscall Interface::Interface(void)" (??0Interface@@QAE@XZ)

Dijkstra's error LNK2019: unresolved external symbol "public: __thiscall List<struct UserInput>::List<struct UserInput>(void)" (??0?$List@UUserInput@@@@QAE@XZ) referenced in function "public: __thiscall Interface::Interface(void)" (??0Interface@@QAE@XZ)

Dijkstra's error LNK2019: unresolved external symbol "public: int __thiscall List<struct UserInput>::gotoNext(void)" (?gotoNext@?$List@UUserInput@@@@QAEHXZ) referenced in function "public: bool __thiscall Interface::same_vert_error(int,int)" (?same_vert_error@Interface@@QAE_NHH@Z)


I'm using Visual.Net 2003 Compiler .

And these are 20 link errors such like these...

Thanx

Harsimrat
0
 
LVL 13

Expert Comment

by:SteH
ID: 12704161
This TA is mainly for BCB (the Borland compiler). You can ask in community support to move this Q to TA "C++".

STL headers should always be included in the form
#include <iostream>
otherwise the compiler might not find the headers.

Can it be that you have nowhere the line
#include <list>
?
0
 
LVL 12

Expert Comment

by:andrewjb
ID: 12704175
Don't know about Visual.Net 2003, but many compilers require the implementation of template classes to be in the .h file, not a separate .cpp

e.g.

template <class LE>
class List
{
  public:

      // Constructor

       List ( )
       {
           .. implementation code goes here    <<------------------------
        };

etc.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 13

Expert Comment

by:SteH
ID: 12704177
Sorry I now saw that you have your own implementation of the list class. But for templates to work they need to be fully inside the header. There is no real implementation for a template; the compiler will generate the code according to the specified type. So it can't compile the templated cpp files and you get the linker errors.

Put linklst.cpp at the end of linklst.h
0
 
LVL 13

Expert Comment

by:SteH
ID: 12704182
Too late;-(
0
 
LVL 12

Expert Comment

by:andrewjb
ID: 12704202
:-)
0
 

Author Comment

by:hthukral
ID: 12707214
andrewjb and steh

I did that it starts compiling now it has some warnings

listlnk.h(326): warning C4715: 'List<UserInput>::getCursor' : not all control paths return a value

listlnk.h(326): warning C4715: 'List<Prior_Q>::getCursor' : not all control paths return a value

lislnk.h(326): warning C4715: 'List<Path_store>::getCursor' : not all control paths return a value

listlnk.h(239): warning C4700: local variable 'temp' used without having been initialized

These are all warnings I thought it to run....but when it runs it goes to unhadled exception immediately

This is the header file which it finds Exception handling:-

Converts a character string into an int or long.


#else  /* defined (_MT) && !defined (_UNICODE) */
        while ( _istspace((int)(_TUCHAR)*nptr) )
#endif  /* defined (_MT) && !defined (_UNICODE) */
            ++nptr;

I have main file these are the lines where it is getting to this error

 // Converts the input ( source, sink) to integer value

  source = atoi(&(*argv[1]));
  sink = atoi(&(*argv[2]));

Fast help will be really appreciated... Andrewjb is leading the points race.......

Thanx Guys

Harsimrat



0
 
LVL 13

Expert Comment

by:SteH
ID: 12707291
template <class LE>
LE List<LE>::getCursor () const
{
  if(!empty ())
  {
    return cursor->element; // here you return.
  }
 // but it not empty () nothing gets returned. Could this return value be NULL?
}
0
 

Author Comment

by:hthukral
ID: 12707300
I will increase 100 pts for this question guys when I get the answer...Rite now 250 is going to andrewjb....I even compiled my code in Borland C++ Builder X it is throwing me tons of different errors.

I m using AP classes this guy is finding errors in APvector.h and Apvector.cpp implementations thats out of my knowledge area.

Thanx

Harsimrat
0
 
LVL 13

Expert Comment

by:SteH
ID: 12707314
template <class LE>
int List<LE>::full ( ) const
{
  ListNode<LE>  *temp; // variable is create but no value is assigned.

  if( temp == NULL ) // how should temp found its value to compare?
      return 1;           // returns 1 is full

  else
      return 0;             // returns 0 otherwise

}
0
 
LVL 13

Expert Comment

by:SteH
ID: 12707319
2:1? ;-)
0
 
LVL 13

Expert Comment

by:SteH
ID: 12707353
>I m using AP classes this guy is finding errors in APvector.h and Apvector.cpp implementations thats out of my knowledge area.
Are you using STL headers (#include <iostream>) or old borland style (#include "iostream.h")? The latter is potentially harmful if other files are using STL headers.
0
 

Author Comment

by:hthukral
ID: 12707406
Steh

I had <iostream.h> but I changed to <iostream> and using namespace std; but it is still finding errors in AP classes which Visual Studio.Net is compiling properly. I'm using the same files at both places....I m compiling Borland Code under Linux...

Thanx

Harsimrat
0
 
LVL 13

Expert Comment

by:SteH
ID: 12707449
It perhaps could be a new question since it is somehow unrelated to the title.

Or is the same error as above? Are apvector.cpp or .h added to the project? They only should be included.

If not post the lines with errors together with their messages.
0
 

Author Comment

by:hthukral
ID: 12707778
Steh-

I will give more points for all my solutions as I need everything in a hurry.....it is slightly of the original ...bcoz all you guys are of C++ builder so I had that compiler i moved my code there.....apvector.h and .cpp are in the project no other file

These are the list of errors

"apvector.cpp": apvector.cpp error: ISO C++ forbids declaration of `ist' with no type at line 1
"apvector.cpp": apvector.cpp error: ISO C++ forbids declaration of `mySize' with no type at line 2
"apvector.cpp": apvector.cpp error: `rhs' was not declared in this scope at line 2
"apvector.cpp": apvector.cpp error: ISO C++ forbids declaration of `myList' with no type at line 3
"apvector.cpp": apvector.cpp error: syntax error before `[' token at line 3
"apvector.cpp": apvector.cpp error: syntax error before `for' at line 7
"apvector.cpp": apvector.cpp error: syntax error before `;' token at line 7
"apvector.cpp": apvector.cpp error: syntax error before `++' token at line 7
"apvector.cpp": apvector.cpp error: syntax error before `::' token at line 16
"apvector.cpp": apvector.cpp error: ISO C++ forbids declaration of `length' with no type at line 19
"apvector.cpp": apvector.cpp error: non-member function `int length()' cannot have `const' at line 19
method qualifier
"apvector.cpp": apvector.cpp error: syntax error before `::' token at line 24
"apvector.cpp": apvector.cpp error: ISO C++ forbids declaration of `operator[]' with no at line 28
type
"apvector.cpp": apvector.cpp error: `int operator[](int)' must be a nonstatic member at line 28
function
"apvector.cpp": apvector.cpp error: `int operator[](int)' must take exactly two arguments at line 28
apvector.cpp: In function `int operator[](int)':
"apvector.cpp": apvector.cpp error: `cerr' undeclared (first use this function) at line 32
"apvector.cpp": apvector.cpp error: (Each undeclared identifier is reported only once for at line 32
each function it appears in.)
"apvector.cpp": apvector.cpp error: `endl' undeclared (first use this function) at line 33
"apvector.cpp": apvector.cpp error: `exit' undeclared (first use this function) at line 34
"apvector.cpp": apvector.cpp error: invalid types `int[int]' for array subscript at line 36
apvector.cpp: At global scope:
"apvector.cpp": apvector.cpp error: syntax error before `::' token at line 40
"apvector.cpp": apvector.cpp error: ISO C++ forbids declaration of `operator[]' with no at line 45
type
"apvector.cpp": apvector.cpp error: non-member function `int operator[](int)' cannot have ` at line 45
const' method qualifier
"apvector.cpp": apvector.cpp error: `int operator[](int)' must be a nonstatic member at line 45
function
"apvector.cpp": apvector.cpp error: `int operator[](int)' must take exactly two arguments at line 45
apvector.cpp: In function `int operator[](int)':
"apvector.cpp": apvector.cpp error: redefinition of `int operator[](int)' at line 45
"apvector.cpp": apvector.cpp error: `int operator[](int)' previously defined here at line 28
"apvector.cpp": apvector.cpp error: redefinition of `int operator[](int)' at line 45
"apvector.cpp": apvector.cpp error: `int operator[](int)' previously defined here at line 28
"apvector.cpp": apvector.cpp error: `exit' undeclared (first use this function) at line 50
"apvector.cpp": apvector.cpp error: invalid types `int[int]' for array subscript at line 52
apvector.cpp: At global scope:
"apvector.cpp": apvector.cpp error: syntax error before `::' token at line 56
"apvector.cpp": apvector.cpp error: ISO C++ forbids declaration of `resize' with no type at line 64
apvector.cpp: In function `int resize(int)':
"apvector.cpp": apvector.cpp error: `itemType' undeclared (first use this function) at line 70
"apvector.cpp": apvector.cpp error: `newList' undeclared (first use this function) at line 70
"apvector.cpp": apvector.cpp error: syntax error before `[' token at line 70
"apvector.cpp": apvector.cpp error: invalid types `int[int]' for array subscript at line 73
"apvector.cpp": apvector.cpp error: type `int' argument given to `delete', expected pointer at line 75
apvector.cpp: At global scope:
"apvector.cpp": apvector.cpp error: syntax error before `/' token at line 79
In file included from apvector.cpp:126:
"stdlib.h": /usr/include/stdlib.h error: syntax error before `(' token at line 137
In file included from /usr/include/sys/types.h:266,
from /usr/include/stdlib.h:416,
from apvector.cpp:126:
"pthreadtypes.h": /usr/include/bits/pthreadtypes.h error: 'size_t' is used as a type, but is at line 48
not defined as a type.
"pthreadtypes.h": /usr/include/bits/pthreadtypes.h error: 'size_t' is used as a type, but is at line 51
not defined as a type.
In file included from apvector.cpp:126:
"stdlib.h": /usr/include/stdlib.h error: type specifier omitted for parameter `size_t' at line 433
"stdlib.h": /usr/include/stdlib.h error: syntax error before `)' token at line 433
"stdlib.h": /usr/include/stdlib.h error: type specifier omitted for parameter `size_t' at line 462
"stdlib.h": /usr/include/stdlib.h error: syntax error before `,' token at line 462
"stdlib.h": /usr/include/stdlib.h error: `size_t' was not declared in this scope at line 556
"stdlib.h": /usr/include/stdlib.h error: syntax error before `)' token at line 556
"stdlib.h": /usr/include/stdlib.h error: `size_t' was not declared in this scope at line 558
"stdlib.h": /usr/include/stdlib.h error: syntax error before `,' token at line 558
"stdlib.h": /usr/include/stdlib.h error: type specifier omitted for parameter `size_t' at line 567
"stdlib.h": /usr/include/stdlib.h error: syntax error before `)' token at line 567
In file included from /usr/include/stdlib.h:578,
from apvector.cpp:126:
Build cancelled due to errors
"alloca.h": /usr/include/alloca.h error: `size_t' was not declared in this scope at line 33
"alloca.h": /usr/include/alloca.h error: syntax error before `)' token at line 33
In file included from apvector.cpp:126:
"stdlib.h": /usr/include/stdlib.h error: `size_t' was not declared in this scope at line 583
"stdlib.h": /usr/include/stdlib.h error: syntax error before `)' token at line 583
"stdlib.h": /usr/include/stdlib.h error: type specifier omitted for parameter `size_t' at line 588
"stdlib.h": /usr/include/stdlib.h error: syntax error before `,' token at line 588
"stdlib.h": /usr/include/stdlib.h error: `void exit(int)' used prior to declaration at line 612
"stdlib.h": /usr/include/stdlib.h error: type specifier omitted for parameter `size_t' at line 739
"stdlib.h": /usr/include/stdlib.h error: syntax error before `,' token at line 739
"stdlib.h": /usr/include/stdlib.h error: type specifier omitted for parameter `size_t' at line 743
"stdlib.h": /usr/include/stdlib.h error: syntax error before `,' token at line 743
"stdlib.h": /usr/include/stdlib.h error: type specifier omitted for parameter `size_t' at line 812
"stdlib.h": /usr/include/stdlib.h error: syntax error before `)' token at line 812
"stdlib.h": /usr/include/stdlib.h error: type specifier omitted for parameter `size_t' at line 815
"stdlib.h": /usr/include/stdlib.h error: syntax error before `)' token at line 815
0
 
LVL 13

Accepted Solution

by:
SteH earned 1000 total points
ID: 12707845
Either of them are template files as STL headers or your list. You can't compile them. You need to create a class which uses that template and the compiler will create the code for it.

List<int> iList; // the compiler will replace all occurences of the template class with int and compile that code.
List<string> sList; // now the compiler does the same except that string is the substitute.

have a look at
http://www.skylit.com/faqs/#qhcpp
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question