473,794 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

error C3861: 'xxxx': identifier not found

9 New Member
OK, I'm getting just this one error.

error C3861: 'upload_data': identifier not found

I have that function in the header file, why is it not seeing it? I can post code if needed.
Dec 1 '07 #1
3 21425
weaknessforcats
9,208 Recognized Expert Moderator Expert
Yes, the identifier not found means the compiler does not know about upload_data.

Check that everything is spelled correctly and that you are including the header file.

If that fails, then post your header file and the line of code where the error occurs.
Dec 1 '07 #2
jumpman17
9 New Member
I have called other functions from the header file, so I'm not sure why it doesn't like this one.

HourlyEmployee. h
Expand|Select|Wrap|Line Numbers
  1. #include "Employee.h"
  2. #include <iostream>
  3. #include <fstream>
  4.  
  5. using namespace std;
  6.  
  7. #ifndef HOURLYEMPLOYEE_H
  8. #define HOURLYEMPLOYEE_H
  9.  
  10. class HourlyEmployee:public Employee
  11. {
  12.     private:
  13.         double hourly_wage;
  14.         double hours_worked;
  15.         string department_name;
  16.     public:
  17.         HourlyEmployee()
  18.         {
  19.             hourly_wage = 0;
  20.             hours_worked = 0;
  21.             department_name = "unknown";
  22.         }
  23.  
  24.         HourlyEmployee(double hwage, double hworked, string dname, string first, string last, string ID) : Employee(first, last, ID)
  25.         {
  26.             set_hourly_wage(hwage);
  27.             set_hours_worked(hworked);
  28.             set_department_name(dname);
  29.         }
  30.  
  31.         void set_hourly_wage(double hwage)
  32.         {
  33.             hourly_wage = hwage;
  34.         }
  35.  
  36.         void set_hours_worked(double hworked)
  37.         {
  38.             hours_worked = hworked;
  39.         }
  40.  
  41.         void set_department_name(string dname)
  42.         {
  43.             department_name = dname;
  44.         }
  45.  
  46.         double set_hourly_wage()
  47.         {
  48.             return hourly_wage;
  49.         }
  50.  
  51.         double set_hours_worked()
  52.         {
  53.             return hours_worked;
  54.         }
  55.  
  56.         string set_department_name()
  57.         {
  58.             return department_name;
  59.         }
  60.  
  61.         double compute_salary()
  62.         {
  63.             double pay;
  64.             pay = hourly_wage * hours_worked;
  65.             return pay;
  66.         }
  67.  
  68.         void display()
  69.         {
  70.             Employee::display();
  71.             cout << "Department name: " << department_name << endl;
  72.             cout << "2 weeks salary: $" << compute_salary() << endl;
  73.         }
  74.  
  75.         int upload_data(HourlyEmployee g[], int n)
  76.         {
  77.             int count = 0;
  78.             string first, last, id, dname;
  79.             double hworked, hwage;
  80.  
  81.             ifstream infile;
  82.             while(!infile.eof() && count<n)
  83.             {
  84.                 infile >> first >> last >> id >> hworked >> hwage >> dname;
  85.                 g[count].set_firstName(first);
  86.                 g[count].set_lastName(last);
  87.                 g[count].set_employeeID(id);
  88.                 g[count].set_hours_worked(hworked);
  89.                 g[count].set_hourly_wage(hwage);
  90.                 g[count].set_department_name(dname);
  91.                 count++;
  92.             }
  93.             return count;
  94.         }
  95. }
  96.  
  97. #endif
main.cpp
Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2. #include "StaffEmployee.h"
  3. #include "HourlyEmployee.h"
  4. #include <iomanip>
  5.  
  6. using namespace std;
  7.  
  8. #define SIZE 20
  9.  
  10. int main()
  11. {
  12.     int count;
  13.  
  14.     HourlyEmployee fellow;
  15.     fellow.display();
  16.  
  17.     cout << "" << endl;
  18.  
  19.     HourlyEmployee person(10, 55, "electronics", "Alan", "Good", "E1234");
  20.     person.display();
  21.  
  22.     HourlyEmployee group[SIZE];
  23.  
  24.     count = upload_data(group, SIZE);
  25.  
  26.     return 0;
  27. }
Dec 1 '07 #3
weaknessforcats
9,208 Recognized Expert Moderator Expert
count = upload_data(gro up, SIZE);
upload_data is a member function. You can't just call it like this.
Dec 2 '07 #4

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

Similar topics

1
4156
by: IceColdFire | last post by:
I have a VC++.net Win32 console application, however when I compile , I get this error error C2146: syntax error : missing ';' before identifier 'Length' Explain... Location pointed is typedef struct _LIST
2
1840
by: VicVic | last post by:
Hello, I have an old project, built with VC++. Now need to be compiled in Visual Studio .Net 2003. The project is going to build a DLL. When i try to compile the project, i got the following errors: c:\thepath\aaa.cpp(890): error C2065: 'm_nBackStyle' : undeclared identifier c:\thepath\aaa.cpp(890): error C3861: 'm_nBackStyle': identifier not found, even with argument-dependent lookup
3
2138
by: Ben | last post by:
Hi there, We have a asp.net application working fine till a patch is applied to the machine. Now it encounter error 404 page not found, although the page is there. Has anyone come across this before? Thanks.
7
12891
by: Tony Tone | last post by:
I am having trouble resolving this issue: Server Error in '/test' Application. -------------------------------------------------------------------------------- Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
2
9173
by: Hooyoo | last post by:
I have included windows.h, but it still says 'InitializeCriticalSectionAndSpinCount': identifier not found. Why? any ideas? Thanks.
2
5411
by: P2P | last post by:
Hi all, I build my project on VS 2005 and get this error: c:\dx90sdk\include\strmif.h(27392) : error C2146: syntax error : missing ';' before identifier 'lpSurf' can you help me how to fix this? Thanks for any help.
5
2083
by: zhang | last post by:
error C3861: 'Navigate2': identifier not found why???
2
2102
by: FARAECHILIBRU | last post by:
struct Node { int value; int phoneNo; string name; string surname; string adress; string Email; Node* pLeft;
1
5017
by: Harshini Raj | last post by:
Hi, I am unable to fix this error. Canyou tell me what compiler options i have to use to fix this issue? Issue Error 40:Undeclared identifier 'Name' -- Within an expression, an identifier was encountered that had not previously been declared and was not followed by a left parenthesis. Name is the name of the identifier.
0
10212
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10161
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6777
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4112
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2919
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.