Results 1 to 6 of 6
Hi,
I have not error in visual C++ but when i want to compile using g++ in linux using:
g++ -c pressure-correction.cpp BICG.cpp advance_Continuity.h solver_Setup.h initialize_MPI.h initialize_Variables.h BICG.h boundary_Conditions.h momentum_Predictor.h ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-03-2012 #1Just Joined!
- Join Date
- Dec 2012
- Posts
- 2
g++ tons of errors while no error in visualC++
Hi,
I have not error in visual C++ but when i want to compile using g++ in linux using:
g++ -c pressure-correction.cpp BICG.cpp advance_Continuity.h solver_Setup.h initialize_MPI.h initialize_Variables.h BICG.h boundary_Conditions.h momentum_Predictor.h obtain_Velocities.h read_Grid_Setup.h getdeltap_Using_Energyequation.h update_Pressure_Momentum_Centervelocity_Facenormal velocity.h S1.h check_Convergence.h
I get tons of errors like:
S1.h:22:2: error: expected unqualified-id before ‘for’
S1.h:22:15: error: ‘m’ does not name a type
S1.h:22:49: error: ‘m’ does not name a type
S1.h:26:7: error: expected unqualified-id before ‘for’
S1.h:26:20: error: ‘i’ does not name a type
S1.h:26:54: error: ‘i’ does not name a type
S1.h:35:4: error: expected unqualified-id before ‘for’
S1.h:35:17: error: ‘i’ does not name a type
S1.h:35:51: error: ‘i’ does not name a type
S1.h:474:2: error: ‘BICG_Solver’ does not name a type
S1.h:475:2: error: ‘BICG_Solver’ does not name a type
S1.h:476:2: error: ‘BICG_Solver’ does not name a type
S1.h:477:2: error: ‘first’ does not name a type
please help me
Kind Regards,
Farshad
- 12-04-2012 #2Linux User
- Join Date
- Jan 2005
- Location
- Saint Paul, MN
- Posts
- 416
You will need to show some pf the code around the erroring lines if you really would like to get any aid here otherwise the only help would be like:
Look at the line 22 in file S1 at column 2 to see what is before the token 'for'.
- 12-04-2012 #3Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,233
Really. Without the relevant code, there isn't much we can do to help. Even posting the functions where the errors are occurring can be very illuminating. FWIW, Visual C++ is not particularly standards compliant. I know this because I have been writing cross-platform (Windows<->Unix<->Linux<->QNX) C code for 30 years, and C++ code for 20 years.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 12-05-2012 #4Linux User
- Join Date
- Jan 2005
- Location
- Saint Paul, MN
- Posts
- 416
- 12-05-2012 #5Just Joined!
- Join Date
- Dec 2012
- Posts
- 2
makefile problem
Hi,
I changed my makefile to as simple as this:
#Makefile
g++ -o sequential pressure-correction.cpp BICG.cpp advance_Continuity.h solver_Setup.h initialize_MPI.h initialize_Variables.h BICG.h boundary_Conditions.h momentum_Predictor.h obtain_Velocities.h read_Grid_Setup.h getdeltap_Using_Energyequation.h update_Pressure_Momentum_Centervelocity_Facenormal velocity.h S1.h check_Convergence.h
Now the problem is:
farshad@farshad:~/Documents/DNS-code$ make
makefile:2: *** commands commence before first target. Stop.
I know that it is about tab but i think i used tab in the first line.
I have attached the makefile. please help me.
sequential is the name of my output file to be used as a command.
Thanks for your kind helps. I appreciate all of you kindly.
- 12-06-2012 #6Linux User
- Join Date
- Jan 2005
- Location
- Saint Paul, MN
- Posts
- 416
You started with errors in the code (file S1.h at lines 22, 26, 35, 474, 475, 476, and 47S1.h:22:2: error: expected unqualified-id before ‘for’
S1.h:22:15: error: ‘m’ does not name a type
S1.h:22:49: error: ‘m’ does not name a type
S1.h:26:7: error: expected unqualified-id before ‘for’
S1.h:26:20: error: ‘i’ does not name a type
S1.h:26:54: error: ‘i’ does not name a type
S1.h:35:4: error: expected unqualified-id before ‘for’
S1.h:35:17: error: ‘i’ does not name a type
S1.h:35:51: error: ‘i’ does not name a type
S1.h:474:2: error: ‘BICG_Solver’ does not name a type
S1.h:475:2: error: ‘BICG_Solver’ does not name a type
S1.h:476:2: error: ‘BICG_Solver’ does not name a type
S1.h:477:2: error: ‘first’ does not name a type
and not the make file, now you have a bad makefile.
The format of a make file is:makefile:2: *** commands commence before first target. Stop.
The command line must use leading "tab" rather than spaces.Code:targetname: dependency list command_to_run
When you run make, the first target (normally named "all") is run if you do not specify the target(s) to be run. Dependencies are files or targets.
In your simplified makefile, you do not have a target.
Also you should find the set of standard make targets (all, clean, distclean, etc) and use them when that action is written into your makefiles.


Reply With Quote

