|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help Unknown Syntax Error
Please excuse me if this is an easy fix, for I am new to Unix and C Code:
'/problem1.c: line2: syntax error near unexpected token ` '/problem1.c: line2: `main() and for one program it has Code:
: command not found2: (above the syntax error) As mentioned this is in C not C++, I have complied all four programs and nothing is brought up however when I try to execute it Unix displays what the picture above shows. I am unaware as to what this warning/error is, please help. Thank you Last edited by Scott; 10-10-2012 at 12:24 AM.. Reason: Code tags |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
It sounds like you've jammed C dode into a script file and tried to run it. C is not a script. Compiling .c files generates a new file, that is the file you run.
|
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
You cannot run the file named: problem1.c Here is how you do it. gcc or cc is your compiler command - you should know which one to use. Code:
cc problem1.c -o problem1 ./problem1 ./problem1 runs the compiled code, and is the compiled code. It will run only when you see no errors from the compiler. This is probably homework, but I did nothing your teacher should and probably has already done for you. Please post homework in the homework forum. |
| The Following User Says Thank You to jim mcnamara For This Useful Post: | ||
apolo93 (10-09-2012) | ||
|
#4
|
|||
|
|||
|
Thank you Jim, I mean that. Ive been trying to figure this out all day.
This is homework, my teacher did go over this and I do apologize for posting it here, I'm new to the site and did not see the homework forum. |
| Sponsored Links | ||
|
![]() |
| Tags |
| syntax, syntax error, unexpected token |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unknown error - ``' unmatched | ajincoep | Shell Programming and Scripting | 7 | 09-01-2010 01:00 AM |
| FIFO possible blocking or unknown error | Ebodee | Homework & Coursework Questions | 1 | 08-12-2010 07:04 PM |
| syntax error in shell test: unknown operator | shellscripter | Shell Programming and Scripting | 4 | 03-31-2009 03:28 AM |
| Unknown File Type error | rohitsz | Solaris | 3 | 07-15-2007 05:57 PM |
| Error: unknown pseudo-op: `.weakref' | napapanbkk | Programming | 6 | 06-16-2006 09:32 AM |
|
|