![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| compile a c program | djehresmann | High Level Programming | 8 | 02-22-2008 10:18 AM |
| Compile and Run C Program on Solaris | selva_ss | High Level Programming | 0 | 02-21-2008 10:52 AM |
| How to compile a c program in freeBSD | jisha | BSD | 3 | 02-13-2008 12:14 AM |
| how to compile a program statically | bhakti | High Level Programming | 1 | 07-31-2006 07:01 AM |
| how to compile a program | CmpKillr | High Level Programming | 2 | 04-07-2003 02:57 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hi all,
Yeasterday I try to compile c program by using cygwin. I just find an errors the fist one is concerinig about the end of the line. To summit my Assignment which is the day after tommorow I have to compile my c program by using just gcc. If any one know what do I have to exclude or include in a code over the program that workes on visual c++? I need Help? Titie, |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
1. this forum is really not for homework
2. if gcc reports syntax errors, that means the code needs to be changed. 3. gcc myfile.c compiles C code not C++ code. 4. g++ myfile.cpp compiles C++ code C++ and C are very different languages, compilers that expect C (gcc) will not compile C++ code. |
|
#3
|
|||
|
|||
|
Just use
gcc -o file file.c it will create an file.exe and then run it as ./file.exe |
|
#4
|
||||
|
||||
|
Quote:
U may even skip '-o ' option in gcc and that will produce an output file named a.out that can be run as ./a.out (Though the native format of Linux is ELF in this case it produces output file of aout format) And as for Bell plz. follow jim's advise. |
|
#5
|
|||
|
|||
|
Quote:
tr -d '\r' <dosfile_crlf.c >unixfile_nl.c Hope this proves helpful in the future since I was not in time for your assignment. ~Marcus |
|
#6
|
||||
|
||||
|
Quote:
we'll call the source EXAMPLE.cpp, and the output will be EXOUT."file". gcc -lg++ -Wall -pedantic -ansi -g -o EXOUT EXAMPLE.cpp this is a good choice for debugging and compiling, it calls upon the normal system area for #include header files, uses the Wall function for the debugging side of things, ansi for ..... ansi compatibility i think and the -o gets rid of the a.out leaving you with the desired file, with the blank extension for linux/Unix.... hope that helped..Pe@cE |
||||
| Google The UNIX and Linux Forums |