Compiler Error C3861

Discussion in 'C++' started by johankildal@gmail.com, May 9, 2005.

  1. Guest

    I am probably being very naïve, but I can't explain why I am getting
    this compiler erro. Here is an outline of the code with the problem:
    //***DECLARATION IN GeneralDoubleTable.h***//
    #pragma once
    #include <iostream>
    #include <vector>
    using namespace std;


    class GeneralDoubleTable
    {
    protected:
    vector<unsigned long> dimsVector;
    void setDimsVector (vector<unsigned long> dimsVector)
    { this->dimsVector = dimsVector; };

    public:
    int storeDataInDataSet(double,vector<unsigned long>);


    int getTotDims()
    { return dimsVector.size(); };
    vector<unsigned long> getDimsVector()
    { return dimsVector; };

    ...
    };


    //***DEFINITION in GeneralDoubleTable.cpp***

    #include "GeneralDoubleTable.h"
    using namespace std;

    GeneralDoubleTable::GeneralDoubleTable(vector<unsigned long>
    dimsVector)
    {
    ...
    setDimsVector(dimsVector);
    ...
    }



    int storeDataInDataSet(double data,vector<unsigned long>
    positionVector)
    {
    if( positionVector.size() != getTotDims()) return 1; //Here I get the
    ERROR!!!!!!!!!!!

    ...

    return 0;
    }
    }

    =====================
    c:\Project\GeneralDoubleTable.cpp(44) : error C3861: 'getTotDims':
    identifier not found, even with argument-dependent lookup


    This is the error I get, pointing to where I have indicated. Why can it
    not find that function??? Thanks
     
    , May 9, 2005
    #1
    1. Advertising

  2. Sharad Kala Guest

    <> wrote in message

    [snip]

    >int storeDataInDataSet(double data,vector<unsigned long>

    positionVector)

    This is a member function --
    int GeneralDoubleTable::storeDataInDataSet(double data,vector<unsigned long>
    positionVector)


    Sharad
     
    Sharad Kala, May 9, 2005
    #2
    1. Advertising

  3. Guest

    Embarrasingly simple, but I was being blind. Many thanks, Sharad
     
    , May 9, 2005
    #3
  4. Lionel B Guest

    <> wrote in message news:...
    > I am probably being very naïve, but I can't explain why I am getting
    > this compiler erro. Here is an outline of the code with the problem:
    >
    > [...]
    >
    > int storeDataInDataSet(double data,vector<unsigned long>
    > positionVector)


    should be:

    int GeneralDoubleTable::storeDataInDataSet(double data,vector<unsigned long>
    positionVector)

    (it's a member function).

    --
    Lionel B
     
    Lionel B, May 9, 2005
    #4
  5. ulrich Guest

    On 9 May 2005 05:18:08 -0700, <> wrote:

    > I am probably being very naïve, but I can't explain why I am getting
    > this compiler erro. Here is an outline of the code with the problem:
    > //***DECLARATION IN GeneralDoubleTable.h***//
    > #pragma once
    > #include <iostream>
    > #include <vector>
    > using namespace std;
    >
    >
    > class GeneralDoubleTable
    > {
    > protected:
    > vector<unsigned long> dimsVector;
    > void setDimsVector (vector<unsigned long> dimsVector)
    > { this->dimsVector = dimsVector; };
    >
    > public:
    > int storeDataInDataSet(double,vector<unsigned long>);
    >
    >
    > int getTotDims()
    > { return dimsVector.size(); };
    > vector<unsigned long> getDimsVector()
    > { return dimsVector; };
    >
    > ...
    > };
    >
    >
    > //***DEFINITION in GeneralDoubleTable.cpp***
    >
    > #include "GeneralDoubleTable.h"
    > using namespace std;
    >
    > GeneralDoubleTable::GeneralDoubleTable(vector<unsigned long>
    > dimsVector)
    > {
    > ...
    > setDimsVector(dimsVector);
    > ...
    > }
    >
    >
    >
    > int storeDataInDataSet(double data,vector<unsigned long>
    > positionVector)
    > {
    > if( positionVector.size() != getTotDims()) return 1; //Here I get the
    > ERROR!!!!!!!!!!!


    [...]

    you forgot "GeneralDoubleTable::" before "storeDataInDataSet(double data,
    ....", which imho should be a method of the class GeneralDoubleTable.
     
    ulrich, May 9, 2005
    #5
  6. Howard Guest

    In addition to the info you've already been given, you should know that your
    subject line tells most of us nothing. Error numbers are specific to the
    compiler you're using, and in general are meaningless to others. Next time,
    you might use a subject like "identifier not found error". At least we'll
    know better what you're talking about then.

    Thanks,
    Howard
     
    Howard, May 9, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yan
    Replies:
    0
    Views:
    1,174
  2. Jack Wright
    Replies:
    5
    Views:
    669
    Shiv Kumar
    Jan 19, 2004
  3. Ram
    Replies:
    0
    Views:
    2,940
  4. Andrey Batyuck

    Compiler compiler with C++ as output

    Andrey Batyuck, May 11, 2004, in forum: C++
    Replies:
    3
    Views:
    464
    Frederik Hertzum
    May 17, 2004
  5. Replies:
    1
    Views:
    820
Loading...

Share This Page