• Best of luck to the class of 2024 for their HSC exams. You got this!
    Let us know your thoughts on the HSC exams here
  • YOU can help the next generation of students in the community!
    Share your trial papers and notes on our Notes & Resources page
MedVision ad

C compiler (1 Viewer)

untouchablecuz

Active Member
Joined
Mar 25, 2008
Messages
1,693
Gender
Male
HSC
2009
i tried to download and install a C compiler (namely gcc) but it seems hard and laborious
is there an automated way of installing gcc?

OR

are there any compilers that you guys recommend?

never programmed before :eek:
 
Last edited:

henry08

Active Member
Joined
Mar 13, 2008
Messages
1,174
Gender
Male
HSC
N/A
I have had endless trouble trying to install C/C++/other language compilers.

One that I got working for C (a while back and it still took a lot of steps to get it to work) was Borland compiler.
 

joshuaali

Member
Joined
Oct 17, 2006
Messages
66
Gender
Male
HSC
2007
i tried to download and install a C compiler (namely gcc) but it seems hard and laborious
is there an automated way of installing gcc?

OR

are there any compilers that you guys recommend?

never programmed before :eek:
Where exactly are you downloading it to? Your computer or CSE's?

At any rate, perhaps the easiest solution when trying to work from home (or anywhere else, for that matter) is to SSH into your CSE account and do what you'd normally do if you were on one of the CSE lab computers.

CSE Taggi: FAQ - Accessing CSE login servers
 
Joined
Jun 11, 2008
Messages
86
Location
Sydney
Gender
Male
HSC
2009
The replies by the others are great, but I'll add a little colour to them for the unaccustomed. Assuming you're running linux in some form (if you're not, at least just download the CSE Linux off the CSE department's website and run it in vmware) all you would have to type in a terminal window is:

Code:
sudo apt-get gcc
This command runs apt-get as the administrator (requiring a password which you would have set). Apt-get will install gcc along with all of the things you require without bugging you at all aside from entering your password and typing "y" initially.

Even more simple is going to the Administration section of the menu and running Synaptic - it essentially does the same thing as apt-get but it's not from the terminal. Just type gcc in the search box, tick the box next to it and click Apply. I actually recommend this method since it's harder to make mistakes.
 

LordPc

Active Member
Joined
May 17, 2007
Messages
1,370
Location
Western Sydney
Gender
Male
HSC
2008
Im just guessing but I think what he really wants is an IDE

untouchablecuz, the easiest thing to do is to download a program like codeblocks which has a compiler in it. you can also write your programs in it, press one button and it automatically compiles and runs the program for you. there is no need to go to all the trouble of installing linux or this other stuff if all you want to do is write some code

Code::Blocks
 

joshuaali

Member
Joined
Oct 17, 2006
Messages
66
Gender
Male
HSC
2007
Im just guessing but I think what he really wants is an IDE

untouchablecuz, the easiest thing to do is to download a program like codeblocks which has a compiler in it. you can also write your programs in it, press one button and it automatically compiles and runs the program for you. there is no need to go to all the trouble of installing linux or this other stuff if all you want to do is write some code

Code::Blocks
If that is the case, I still think it's easier to forward X11 and just use gedit or kedit/kwrite/kate. Compiling will be easy since it's already all set up and it's guaranteed to work when they (the auto marker) test it assuming it works when you test it.
 

LordPc

Active Member
Joined
May 17, 2007
Messages
1,370
Location
Western Sydney
Gender
Male
HSC
2008
If that is the case, I still think it's easier to forward X11 and just use gedit or kedit/kwrite/kate. Compiling will be easy since it's already all set up and it's guaranteed to work when they (the auto marker) test it assuming it works when you test it.
you will have to explain to me how all that work makes it easier

i only agree when it comes to tasks which use the automarker. but for labs and stuff, i dont see why there is any need to login to your cse account just to compile code. to me it seems like you are just making three left turns rather than a single right
 

untouchablecuz

Active Member
Joined
Mar 25, 2008
Messages
1,693
Gender
Male
HSC
2009
thanks guys

ive decided to go for the PuTTY + XMing installation since its the easiest

i'm having an issue tho, after i type my username, it doesn't let me enter a password. anyone else having this problem
 

LordPc

Active Member
Joined
May 17, 2007
Messages
1,370
Location
Western Sydney
Gender
Male
HSC
2008
working fine for me

i assume you are using the CSE guide: USING PuTTY and XMING TO CONNECT

you can try cse.unsw.edu.au but that shouldnt change anything

you should also get WinSCP while your at it. makes transferring files from your CSE account to your home computer and vice versa simple

seriously though, unless you have some overpowering reason for needing to log into the cse server to use their compiler it would be much easier to just get an IDE and compile your code on your home computer
 

untouchablecuz

Active Member
Joined
Mar 25, 2008
Messages
1,693
Gender
Male
HSC
2009
working fine for me

i assume you are using the CSE guide: USING PuTTY and XMING TO CONNECT

you can try cse.unsw.edu.au but that shouldnt change anything

you should also get WinSCP while your at it. makes transferring files from your CSE account to your home computer and vice versa simple

seriously though, unless you have some overpowering reason for needing to log into the cse server to use their compiler it would be much easier to just get an IDE and compile your code on your home computer
i just downloaded Code::Blocks 8.02, seems to be working, thanks alot LordPc

i made the following program:

Code:
#include <stdio.h>

int main()
{
    printf("This is output from my first program!\n");
    return 0;
}
when i open the executable, the sentence comes up for like <1 second (a brief flash)

how do i fix this?
 

joshuaali

Member
Joined
Oct 17, 2006
Messages
66
Gender
Male
HSC
2007
you will have to explain to me how all that work makes it easier

i only agree when it comes to tasks which use the automarker. but for labs and stuff, i dont see why there is any need to login to your cse account just to compile code. to me it seems like you are just making three left turns rather than a single right
Because all your work will be in the one place, rather than having to put it all on a USB flash drive, emailing it to yourself, or using some other cloud storage. Not to mention that it gives you practice using the command line, which all CSE students will be using over the next 3-4 years.

i'm having an issue tho, after i type my username, it doesn't let me enter a password. anyone else having this problem
Works fine for me as well. login.cse.unsw.edu.au?

Also, for CSE specific questions, perhaps you are better off asking in your course forum. That way, other new students who share the same problem as you can use your solution as a precedent. If you're studying COMP1911, I can answer your questions there.
 

Omie Jay

gone
Joined
Nov 8, 2006
Messages
6,673
Location
in my own pants
Gender
Female
HSC
2007
definitely get WinSCP to submit labs/assignments from home to uni.

as for a c compiler, i think i used DevC++ when i did comp1911
 

LordPc

Active Member
Joined
May 17, 2007
Messages
1,370
Location
Western Sydney
Gender
Male
HSC
2008
i made the following program:

Code:
#include <stdio.h>
 
int main()
{
    printf("This is output from my first program!\n");
    return 0;
}
when i open the executable, the sentence comes up for like <1 second (a brief flash)

how do i fix this?
i assume you are compiling, minimising the code blocks window and then running the .exe manually

what you need to do is run the program through code blocks. there should be three small blue icons toward the top right. one is a cog (compile), one is a play button (run program) and the third is a play button and a cog (compile then run). if you use the compile and run button then the program will stay open after it finishes

and by the way, it is customary to print "Hello World" first
 

withoutaface

Premium Member
Joined
Jul 14, 2004
Messages
15,098
Gender
Male
HSC
2004
If you're using windows you can also put System("PAUSE"); before your return statement and the "Press any key to continue..." dialog should be displayed.
 

untouchablecuz

Active Member
Joined
Mar 25, 2008
Messages
1,693
Gender
Male
HSC
2009
everythings done, thanks a lot everyone

downloaded putty and XMing. turns out that the putty terminal doesn't actually show the password as its typed so i assumed nothing was happening

downloaded Code::Blocks and its working fine

downloaded andLinux (dunno what to use it for tho)

one last question, can i use putty instead of WinSCP?
 

LordPc

Active Member
Joined
May 17, 2007
Messages
1,370
Location
Western Sydney
Gender
Male
HSC
2008
one last question, can i use putty instead of WinSCP?
yea, im pretty sure you can use the command line in putty to transfer files from your home computer to your cse account

its just that WinSCP provides you with a graphical interface (which resembles windows explorer) and so it makes the whole process a lot easier. if you have already used putty then using WinSCP is exactly the same. you enter the cse.unsw.edu.au, your username and password and you have access to all of your cse files
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top