Setting up C compiler

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jun 2009
Posts: 29
Reputation: suncica2222 is an unknown quantity at this point 
Solved Threads: 0
suncica2222 suncica2222 is offline Offline
Light Poster

Setting up C compiler

 
0
  #1
Oct 20th, 2009
hi to everybody on this most helpful programing board

I have trouble setting up Dev C++ compiler,I have a lot of errors in 100% right code so I guess that compiler isnt set right.

I want to work in C.

here's example:

Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 1,968
Reputation: tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute 
Solved Threads: 214
tux4life's Avatar
tux4life tux4life is offline Offline
Posting Virtuoso
 
0
  #2
Oct 20th, 2009
I have a lot of errors in 100% right code so I guess that compiler isnt set right.
Before throwing insults to the compiler, could you maybe first post your 100% right code?
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 409
Reputation: gerard4143 is on a distinguished road 
Solved Threads: 48
gerard4143's Avatar
gerard4143 gerard4143 is online now Online
Posting Pro in Training
 
0
  #3
Oct 20th, 2009
I noticed by your imagine that your including Linux header files...So you have this installed on Linux machine?

I also noticed that your file is located in C:\ which is Windows...
Last edited by gerard4143; Oct 20th, 2009 at 7:06 pm.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 1,968
Reputation: tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute 
Solved Threads: 214
tux4life's Avatar
tux4life tux4life is offline Offline
Posting Virtuoso
 
0
  #4
Oct 21st, 2009
So you have this installed on Linux machine?
Dev-C++ is Windows software, so I think it is safe to assume that he's using Windows.
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 29
Reputation: suncica2222 is an unknown quantity at this point 
Solved Threads: 0
suncica2222 suncica2222 is offline Offline
Light Poster
 
0
  #5
Oct 21st, 2009
Im using win xpsp2

hmm...so signal.h is linux library,and I will not be able to work these examples on win compiler???

heres example code:

  1. #include <stdio.h>
  2. #include <unistd.h>
  3. #include <signal.h>
  4. char user[40]; /* Bafer koji sadrzi string koji je uneo korisnik */
  5. /* Handler za alarm */
  6. void catch_alarm(int sig_num)
  7. {
  8. printf("Operacija je istekla. Izlazim...\n\n");
  9. exit(0);
  10. }
  11. int main(int argc, char* argv[])
  12. {
  13. /* Signal handler za ALRM signal */
  14. signal(SIGALRM, catch_alarm);
  15. /* Prompt korisniku da unese string */
  16. printf("Username: ");
  17. fflush(stdout);
  18. /* Startuje alarm od 30 sekundi */
  19. alarm(30);
  20. /* Ceka da korisnik unese ime */
  21. gets(user);
  22. /* Ukoliko korisnik unese ime uklanja alarm */
  23. alarm(0);
  24. printf("Username: '%s'\n", user);
  25. return 0;
  26. }
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 409
Reputation: gerard4143 is on a distinguished road 
Solved Threads: 48
gerard4143's Avatar
gerard4143 gerard4143 is online now Online
Posting Pro in Training
 
0
  #6
Oct 21st, 2009
No the library I was referring to was unistd.h which means unix std library....
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 29
Reputation: suncica2222 is an unknown quantity at this point 
Solved Threads: 0
suncica2222 suncica2222 is offline Offline
Light Poster
 
0
  #7
Oct 21st, 2009
is there a way to compile this in windows?
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 409
Reputation: gerard4143 is on a distinguished road 
Solved Threads: 48
gerard4143's Avatar
gerard4143 gerard4143 is online now Online
Posting Pro in Training
 
0
  #8
Oct 21st, 2009
Originally Posted by suncica2222 View Post
is there a way to compile this in windows?
The short and probably the only answers is no, you'll have to port it...If your using a Windows compiler why don't you check out the internet its packed with example code or try Googling this "the c programming language pdf"

Its a great intro to C and all the Unix/Linux parts are crammed into the last chapter so you don't have to worry about porting code..
Last edited by gerard4143; Oct 21st, 2009 at 7:23 pm.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 29
Reputation: suncica2222 is an unknown quantity at this point 
Solved Threads: 0
suncica2222 suncica2222 is offline Offline
Light Poster
 
0
  #9
Oct 22nd, 2009
thank you gerrard

still playing for Liverpool ha?

Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 409
Reputation: gerard4143 is on a distinguished road 
Solved Threads: 48
gerard4143's Avatar
gerard4143 gerard4143 is online now Online
Posting Pro in Training
 
0
  #10
Oct 22nd, 2009
Originally Posted by suncica2222 View Post
thank you gerrard

still playing for Liverpool ha?

This reference is lost on me..."still playing for Liverpool ha?"
Last edited by gerard4143; Oct 22nd, 2009 at 2:30 pm.
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC