473,320 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

FunctionElement.cpp|13|error: 'argument' was not declared in this scope|

this is my .cpp file

#include "FunctionElement.h"
#include <vector>

using namespace std;

FunctionElement::FunctionElement()
{

}

void setElements(FormulaElement d)
{
argument.push_back(d);
}

vector <FormulaElement> getList()
{
return argument;
}

FunctionElement::~FunctionElement()
{
//dtor
}


and this is my .h file

#ifndef FUNCTIONELEMENT_H
#define FUNCTIONELEMENT_H

#include <FormulaElement.h>
#include <vector>

using namespace std;

class FunctionElement : public FormulaElement
{
public:
FunctionElement();
void setElements(FormulaElement d);
vector<FormulaElement> getList();

virtual ~FunctionElement();
protected:
private:
vector<FormulaElement> argument;
};

#endif // FUNCTIONELEMENT_H
Jun 7 '15 #1
1 1523
You forgot to use FunctionElement:: in the method signatures for setElements(...) and getList(). As a result, the compiler thinks they are global functions instead of methods from the class FunctionElement, so the instructions inside them have no knowledge of the contents inside the class.
Jun 7 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: William | last post by:
In Peer.h, I have: class Peer { // ... }; In Overseer.h, I have: #include "Peer.h" #include <vector>
3
by: Vaxius | last post by:
After trying to compile the following code, gcc gives me error: 'setwidth' was not declared in this scope I'm not sure why it would do this, since iomanip is included. Am I missing something?...
14
by: Darren L. Weber | last post by:
I am trying to compile a utility to create .avi files. See http://cpbotha.net/im2avi I'm working on Debian etch (a mix of testing/unstable). dweber@dnlweber:~/im2avi-0.4$ g++ --version g++...
4
by: Krice | last post by:
I get the following error: editarea.cpp: In member function `int Edit_Area::Mouse_Draw(int, int, unsigned char)': `g_undo' was not declared in this scope The problem is that g_undo is there....
9
by: Phrogz | last post by:
I'm trying to write an 'each' function for a JavaScript array that behaves like Ruby's Array#each. (It doesn't matter if you know Ruby to help with this question.) My problem is the scope of...
7
by: Frank | last post by:
Hi, I have the following problem with dynamic memory: int main(){ for(){ int (**w)=new int *; for(m = 0; m < N1; m++) {
2
by: Tim H | last post by:
help?!? #include <boost/shared_ptr.hpp> class pp_dirent {}; class pp_scope: public pp_dirent {}; int main() { boost::shared_ptr<pp_direntp1(new pp_scope()); boost::shared_ptr<pp_scopep2 =...
3
by: psroga | last post by:
Can anyone look at this code and let me know why pthread_mutex_unlock and pthread_mutex_lock are giving me the "phtread_mutex_unlock" was not defined in this scope error. I am compiling the code...
2
by: jr.freester | last post by:
I have a written a simple class called Matrix. It allows me to operate on a 2D array if it were a matrix. I have not really written a class in c++ since the single course I took in college. In...
2
by: ramyavictor | last post by:
#include <cstdio> #include <cstdlib> int main () { int i; printf ("Checking if processor is available..."); if (system(NULL)) puts ("Ok"); else exit (EXIT_FAILURE); printf...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.