Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

C compilers?


  • Please log in to reply
9 replies to this topic

#1 somenoob

somenoob

  • Members
  • 57 posts
  • OFFLINE
  •  
  • Local time:06:10 PM

Posted 01 December 2008 - 03:39 AM

Hey everyone
OK I decided to take a step and learn some programming languages, starting with C as it seems to be the most versatile. I checked out a few sites that can show me the basics. Problem is, they say to use a compiler and I don't even know what they are, letalone how to use or find one. If anyone answers this please assume I know nothing about programming (since i don't). thanks in advance.

BC AdBot (Login to Remove)

 


#2 jpshortstuff

jpshortstuff

    WhatTheTech Teacher


  • Members
  • 660 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:UK
  • Local time:09:10 AM

Posted 01 December 2008 - 05:15 AM

A compiler is something that takes your source code and creates the executable instructions that a computer can understand.

First of all, we need to know what Operating System. I notice you have a thread about Ubuntu. If you are using Ubuntu then without a doubt you would want to use GCC. GCC is a fantastic C compiler (IMO) and comes with Ubuntu. To compile a basic c program, simply open a terminal and type gcc mysource.c and an executable called a.out will be created (assuming no errors of course). There are plenty of additional options so type man gcc to explore everything it can do.

If you want to use Windows however, then it may be worth trying a few and seeing which you like. If you want an Intergrated Development Environment (IDE) then perhaps you should try Bloodshed Dev, and for a command line compiler I personally use Borland C++. Again, it is completely down to personal preference.

Hope that helps.
Trained at the What The Tech Classroom where you too could learn to help others.

My help is free, however, if you wish to make a small donation to show appreciation and to help me continue the fight against Malware, then click here Posted Image

Posted Image

#3 somenoob

somenoob
  • Topic Starter

  • Members
  • 57 posts
  • OFFLINE
  •  
  • Local time:06:10 PM

Posted 01 December 2008 - 08:55 AM

I'm on XP home at the moment. I was attempting to install Ubuntu but got stuck at the bit where I had to make partitions. I would very much like to get Ubuntu running, I haven't really worked with Linux at all yet.
OK sounds good...what's the difference between the IDE and the command line compiler? Do I need both?
I was thinking I would learn C first but which is more useful, C or C++?
Cheers

#4 jpshortstuff

jpshortstuff

    WhatTheTech Teacher


  • Members
  • 660 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:UK
  • Local time:09:10 AM

Posted 01 December 2008 - 09:43 AM

An IDE is a combination of a source editor and compiler, often with added features to help you program. A command-line compiler would simply be a DOS window whereby you type the commands needed to compile the source, which you write separately in something like notepad (or notepad++).

You choose one method or the other, not both.

I would personally recommend you learn C first, then once you understand all the concepts move onto C++ if you want to.

I have replied to your Ubuntu thread, I may or may not be able to help.
Trained at the What The Tech Classroom where you too could learn to help others.

My help is free, however, if you wish to make a small donation to show appreciation and to help me continue the fight against Malware, then click here Posted Image

Posted Image

#5 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:01:10 AM

Posted 01 December 2008 - 10:14 AM

Visual C++ 2008 Express is free here:
http://www.microsoft.com/express/vc/

Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#6 somenoob

somenoob
  • Topic Starter

  • Members
  • 57 posts
  • OFFLINE
  •  
  • Local time:06:10 PM

Posted 01 December 2008 - 05:42 PM

OK so IDE is more useful but command-line would be easier to use? Might as well try both methinks.
Righto I'll have a look. Cheers

#7 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:01:10 AM

Posted 01 December 2008 - 06:51 PM

IDE is MUCH easier to use IMHO...

For example.. here's the command line the IDE uses and does for me for the last project I built:
/O1 /Ob1 /Os /Oy /GL /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /GF /FD /EHsc /MT /Yu"stdafx.h" /Fp"Release\DNSCheck.pch" /Fo"Release\\" /Fd"Release\vc90.pdb" /W3 /WX /nologo /c /Zi /Gd /TP /errorReport:prompt

The linker is even worse:
/OUT:"C:\Users\Billy\Desktop\DNSCheck\Debug\DNSCheck.exe" /INCREMENTAL /NOLOGO /MANIFEST /MANIFESTFILE:"Debug\DNSCheck.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"c:\Users\Billy\Desktop\DNSCheck\Debug\DNSCheck.pdb" /SUBSYSTEM:CONSOLE /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT shlwapi.lib Ws2_32.lib Dnsapi.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#8 somenoob

somenoob
  • Topic Starter

  • Members
  • 57 posts
  • OFFLINE
  •  
  • Local time:06:10 PM

Posted 01 December 2008 - 06:59 PM

Okey then IDE it is!
Cheers guys

#9 Steve_Irwin

Steve_Irwin

  • Members
  • 28 posts
  • OFFLINE
  •  
  • Local time:12:10 AM

Posted 18 December 2008 - 07:20 PM

A compiler is something that takes your source code and creates the executable instructions that a computer can understand.

First of all, we need to know what Operating System. I notice you have a thread about Ubuntu. If you are using Ubuntu then without a doubt you would want to use GCC. GCC is a fantastic C compiler (IMO) and comes with Ubuntu. To compile a basic c program, simply open a terminal and type gcc mysource.c and an executable called a.out will be created (assuming no errors of course). There are plenty of additional options so type man gcc to explore everything it can do.

If you want to use Windows however, then it may be worth trying a few and seeing which you like. If you want an Intergrated Development Environment (IDE) then perhaps you should try Bloodshed Dev, and for a command line compiler I personally use Borland C++. Again, it is completely down to personal preference.

Hope that helps.


I'm running ubuntu and when I type in gcc mysource.c it displays
"gcc: mysource.c: No such file or directory
gcc: no input files."
sudo gcc mysource.c also doesn't work. Help please? I'm not a big Linux person. Thanks

#10 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:02:10 AM

Posted 18 December 2008 - 07:32 PM

Do you have a file called mysource.c? Perhaps you should use whatever it is that your file is really named?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users