Jump to content


C compiler for use on Acer Aspire one


  • Please log in to reply
4 replies to this topic

#1 hog

hog

    official linguist

  • Sponsor
  • PipPipPipPipPip
  • 1,302 posts
  • Location:Montreal area, QC
  • Country:Canada

Posted 23 January 2009 - 06:27 PM

Alright, so I'm slowly discovering the magical realm of Linux computing with my wonderful Acer Aspire one. I have a class this semester (Introduction to programmation) in which we are coding in C and later in Java.

They recommend Dev-C++ but since it doesn't exist for Linux I tried to use it thourgh Wine but I don't really like it that way. Instead I'm using Code::Blocks, which has native support for Linux.

I have no problem coding with it but I can't compile any of my work. I've discovered with a little research that there are issues specifically on the AA1. I tried installing some packages (GNU GCC Compiler) but it still doesn't work. In fact, it now starts compiling but runs into an error. The build log says:

Compiling: (directory)/file.c
g++ -0	  -c "(directory)/file.c"  -o "(directory)/file.o": No such file or directory.
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

Of course it can't find any ".o" file, it's not there: my file is a ".c". But why is it searching for that and what am I supposed to do in order for the program to create/find that file or stop it from looking for it??

In Dev-C++/Wine, the file does compile properly but I can't run the created program since it's a .exe and Linux obviously does not have the required Windows console. Code::Blocks for Linux simply doesn't compile at all...

I'm hoping somebody knows a thing or two about old-school programming... :roadrunner:

#2 brewin

brewin

    Victory is mine!

  • Administrator
  • PipPipPipPipPip
  • 1,262 posts
  • Location:Missouri
  • Interests:Anything interesting.
  • Country:USA

Posted 24 January 2009 - 12:30 AM

From a terminal, cd into your working directory (the one with file.c, or whatever you called the source code file). Then do this...

g++ file.c -o file.o

Then run it with ./file.o

file.o is the binary output file. You can call it anything you want.

I have heard of Code::Blocks, but never used it. For simple programs it's much easier to just use a text editor and compile it from the command line.

#3 m.oreilly

m.oreilly

    rog'er wilco

  • Admin
  • PipPipPipPipPipPip
  • 8,847 posts
  • Country:lower uncton

Posted 24 January 2009 - 06:30 AM

brew, you never cease to amaze me :roadrunner:

#4 Nvyseal

Nvyseal

    Chairman of the Board

  • Administrator
  • PipPipPipPipPipPip
  • 9,821 posts
  • Location:From the whatever it is, Pluto
  • Country:USA

Posted 24 January 2009 - 05:52 PM

View Postm.oreilly, on Jan 23 2009, 10:30 PM, said:

brew, you never cease to amaze me :roadrunner:
I believe he even amazes himself sometimes!

#5 Tweak

Tweak

    Established Member

  • Members
  • PipPipPipPipPip
  • 674 posts
  • Country:US

Posted 25 January 2009 - 03:24 AM

I knew that.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users