![]() |
| | #1 |
| Registered User Join Date: Sep 2009
Posts: 10
| Any help would be appreciated. Thanks! Emily This is a part of an e-mail I sent to my professor..."~" is the main directory for my user account. I have written the code for a class lab, but have run into many problems compiling. In short: -this may have all started because i tried to look at my lab2 file using VI. in trying to exit with what i thought were the correct commands, i may have made changes to the code, but i couldn't see because there was a big mess of numbers and symbols. -tried to run the file from lab2 again, got "segmentation fault". okay, i say to myself, i'll deal with that later. oh yeah and when i opened w/ pico again it showed more symbols, numbers, etc. -create new directory while trying to familiarize myself with unix, called "thebox" (no longer in the system). started programming lab1 "temple" project from that directory. figured out that i can only compile from "~". mv file to "~" and try to compile again. no errors, but when i run "temple" i see it has become the lab2 program but what i compiled was the file that i edited for lab1"temple". rewrite the code again from scratch under "Temple" compiles with no error but it too has become the lab2 program. "temple.c"..same thing. |
| el9335 is offline | |
| | #2 |
| Registered User Join Date: Oct 2008 Location: TX
Posts: 1,262
| What Unix variant are you using and on which platform? Provide a listing of your working directory and the path to your C compiler. Code: ls -latr whereis cc which cc |
| itCbitC is offline | |
| | #3 |
| and the Hat of Guessing Join Date: Nov 2007
Posts: 8,740
| Did you try to look at your executable with vi? Eep. Short piece of advice: don't ever look at an executable file with a text editor. Longer piece of advice: don't ever ever ever ever look at an executable file with a text editor. You should be able to compile from any directory; having said that, your source code has to be where you are to compile. If your "temple.c" is your lab2 program, most likely was that was you moved the lab2 file instead of the lab1 file, but it's not clear. |
| tabstop is offline | |
| | #4 |
| Registered User Join Date: Sep 2009
Posts: 10
| Thank you for offering help. I figured out what the problem was, i was using an incorrect compiling command, I was creating an exe file with the lab1 name using lab2.c, so I was renaming the wrong prog over and over again. Good to know you're out there to help. Thanks! Emily |
| el9335 is offline | |
![]() |
| Tags |
| compile, gcc |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with compiling code with option -O2 | koushikyou | C Programming | 16 | 01-07-2009 06:03 AM |
| Datagram Unix socket problem | karas | C Programming | 9 | 07-27-2006 10:08 AM |
| Problem Compiling | Flakster | C++ Programming | 4 | 06-13-2006 01:09 AM |
| UNIX File problem | DISGUISED | A Brief History of Cprogramming.com | 2 | 08-09-2002 11:07 AM |
| Problem with Borland 5.5 Compiling Windows Programs | Unregistered | C++ Programming | 3 | 08-28-2001 09:04 AM |