473,320 Members | 1,845 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.

declaration syntax error

14
i have this code:

//implementarea clasei Proces
#ifndef RTProces.CPP
#define RTProces.CPP

#include<dos.h>
#include"RTproces.h"

extern int p[21][4];
//Constructorul clasei Proces
RTproces::RTproces(info_init_proces info_init)
{
p_env->j_ip=FP_OFF(info_init.adr_initiala);
p_env->j_cs=FP_SEG(info_init.adr_initiala);
p_env->j_flag=0x200;
p_env->j_ds=_DS;
p_env->j_es=_ES;
p_env->j_bp=_BP;
p_env->j_si=_SI;
p_env->j_di=_DI;
strcpy(p_nume,info_init.numeProces);
p_dim_stiva=info_init.dimStiva;
p_stare=info_init.stare;
p_adr_proces=info_init.adr_initiala;
}

#endif

the program display me this error "declaration syntax error"
and i don't now from what cause.
May 29 '12 #1

✓ answered by weaknessforcats

So has the compiler seen the class declation for RTproces yet?

I still ave the feeling you are doing #includes on .cpp files, which is a big no-no. I get that feeling becuase .cpp files usually don't have #ifndef syntax in them.

The corrrect thing is to compile each .cpp separately and let the linker resolve any addesses.

7 2330
johny10151981
1,059 1GB
this two line
Expand|Select|Wrap|Line Numbers
  1. #ifndef RTProces.CPP
  2. #define RTProces.CPP
  3.  
May 30 '12 #2
weaknessforcats
9,208 Expert Mod 8TB
It's here: RTProces.CPP

Your tokens must be alphanumeric. Take out the dot.

Does this code mean that you are using #include on .cpp files?
May 30 '12 #3
ucu13
14
johny10151981:this two lines..but what is the problem with this to lines.i used this two lines in more than this project file and i don't have any error,only in this case i have a error.
weaknessforcats:do you refer on include RTProces.cpp or define
May 30 '12 #4
ucu13
14
now if i use the declaration like this i have the same error
Expand|Select|Wrap|Line Numbers
  1. //implementarea clasei Proces
  2. #ifndef __RTProces_CPP
  3. #define __RTProces_CPP
  4.  
  5. #include<dos.h>
  6. #include"RTproces.h"
  7.  
  8. extern int p[21][4];
  9. //Constructorul clasei Proces
  10. RTproces::RTproces(info_init_proces info_init)
  11. {
  12.     p_env->j_ip=FP_OFF(info_init.adr_initiala);
  13.     p_env->j_cs=FP_SEG(info_init.adr_initiala);
  14.     p_env->j_flag=0x200;
  15.     p_env->j_ds=_DS;
  16.     p_env->j_es=_ES;
  17.     p_env->j_bp=_BP;
  18.     p_env->j_si=_SI;
  19.     p_env->j_di=_DI;
  20.     strcpy(p_nume,info_init.numeProces);
  21.     p_dim_stiva=info_init.dimStiva;
  22.     p_stare=info_init.stare;
  23.     p_adr_proces=info_init.adr_initiala;
  24. }
  25.  
  26. #endif
or

Expand|Select|Wrap|Line Numbers
  1. //implementarea clasei Proces
  2. #ifndef __RTProces_CPP
  3. #define __RTProces_CPP
  4.  
  5. #include<dos.h>
  6. #include"RTproces.h"
  7.  
  8. extern int p[21][4];
  9. //Constructorul clasei Proces
  10. RTproces::RTproces(info_init_proces info_init)
  11. {
  12.     p_env->j_ip=FP_OFF(info_init.adr_initiala);
  13.     p_env->j_cs=FP_SEG(info_init.adr_initiala);
  14.     p_env->j_flag=0x200;
  15.     p_env->j_ds=_DS;
  16.     p_env->j_es=_ES;
  17.     p_env->j_bp=_BP;
  18.     p_env->j_si=_SI;
  19.     p_env->j_di=_DI;
  20.     strcpy(p_nume,info_init.numeProces);
  21.     p_dim_stiva=info_init.dimStiva;
  22.     p_stare=info_init.stare;
  23.     p_adr_proces=info_init.adr_initiala;
  24. }
  25.  
  26. #endif
in all my project i have 6 error all like this and i can't figure out what is the reason!!!
May 30 '12 #5
weaknessforcats
9,208 Expert Mod 8TB
Fix the first error only. Other errors may be caused by the first one.

What is te first error exactly?

Remember, the error location is where the compiler found itself in trouble. The actual error may be from there to anyplace earlier in the file that was being compiled.
May 30 '12 #6
ucu13
14
the first error is delaration syntax error on this line:
Expand|Select|Wrap|Line Numbers
  1. RTproces::RTproces(info_init_proces info_init)
but at the first part of the code if i let the original code like this
Expand|Select|Wrap|Line Numbers
  1. #ifndef __RTProces_CPP
  2. #define __RTProces_CPP
i have more than one error but
if i modify this line with this
Expand|Select|Wrap|Line Numbers
  1. #ifndef RTProces.CPP
  2. #define RTProces.CPP
i have only the error that I mentioned at first
May 30 '12 #7
weaknessforcats
9,208 Expert Mod 8TB
So has the compiler seen the class declation for RTproces yet?

I still ave the feeling you are doing #includes on .cpp files, which is a big no-no. I get that feeling becuase .cpp files usually don't have #ifndef syntax in them.

The corrrect thing is to compile each .cpp separately and let the linker resolve any addesses.
May 31 '12 #8

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

Similar topics

3
by: mandogon | last post by:
Hello peoples i am having trouble compiling this program getting a the error is "Declaration Syntax error" using borland c++ bulider v.6 if any one can help thanks void __fastcall...
2
by: kellymart87 | last post by:
//remain.cpp #include <iostream.h> #include <conio.h> int main() getline ()
5
DanielTNBaker
by: DanielTNBaker | last post by:
Basically gettting a "Declaration Syntax Error" do not understand what i have done wrong would appreciate it if someone could help. void Search_Client(void); void PriceList(void); void...
2
by: Lothsfeld | last post by:
Can someone help me w/ this I can't run it and I keep getting errors unable to open include file 'stdio.h' and declaration syntax error #include<stdio.h> main(); { int a,b,c; ...
7
by: Bowzer1999 | last post by:
I am a beginner at C++ and would be very grateful if someone could simply tell me why my program will not compile. My program is as follows, #include <stdio.h> #define int 1ST VALUE = 23.0 ...
4
by: networkmancer | last post by:
Written in Turbo C++ so dont tell me its very messy because I know it is and this is an assignment that we must stick in to. The source of the problem is in Case 5 int main { . I just dont know how...
11
by: Blondie1966 | last post by:
Im trying to write a program about a truck inventory with trucks coming and going and the amount in each one, but keep coming up with declaration syntax error.. Any help would be greatly appreciated....
3
by: dianaroslan | last post by:
There are three errors in coding during compile. one of them is the declaration syntax error. can help me to finish coding this? really need help from anyone who knows. i have some problem with my...
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...
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.