go_away

Author Topic: Compiler problems  (Read 3329 times)

0 Members and 1 Guest are viewing this topic.

Offline wiley89Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Compiler problems
« on: January 06, 2008, 10:48:26 PM »
As some of you might know, I'm a complete noob. I've just started Sam's C tutorial, and I've come to the point where I'm supposed to write the tradition Hello, World! application. My problem is simple. I'm using the most recent version of Microsoft Visual C++ Express and I can't stand how much GUI and fluff garbage there is. It's so hard to navigate when you don't know what you're doing. Even when I was able to compile the source code, I couldn't find my application. Does anyone know very basic compiler/linker where I can just input the code and get my app? I'm going insane here!

Offline Dr_Worm

  • Jr. Member
  • **
  • Posts: 19
  • Helpful? 0
Re: Compiler problems
« Reply #1 on: January 06, 2008, 11:07:06 PM »
I would try GCC if you don't like microsoft visual C++ express, if you use GCC and if it works the same in the command prompt in windows as it does in the linux terminal then all you need to do to set a location to where you wanted your exe file to go by doing this command 'gcc (filename) -L (location wanted)', but for microsoft visual C++ express I have no idea, sorry. :\
« Last Edit: January 06, 2008, 11:10:53 PM by Dr_Worm »

Offline ed1380

  • Supreme Robot
  • *****
  • Posts: 1,478
  • Helpful? 3
Re: Compiler problems
« Reply #2 on: January 07, 2008, 06:41:46 AM »
As some of you might know, I'm a complete noob. I've just started Sam's C tutorial, and I've come to the point where I'm supposed to write the tradition Hello, World! application. My problem is simple. I'm using the most recent version of Microsoft Visual C++ Express and I can't stand how much GUI and fluff garbage there is. It's so hard to navigate when you don't know what you're doing. Even when I was able to compile the source code, I couldn't find my application. Does anyone know very basic compiler/linker where I can just input the code and get my app? I'm going insane here!
welcome to teh typical m$ app.  :D

I've used dev-c++ to do teh same thing and it works
Problems making the $50 robot circuit board?
click here. http://www.societyofrobots.com/robotforum/index.php?topic=3292.msg25198#msg25198

Offline wiley89Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: Compiler problems
« Reply #3 on: January 07, 2008, 03:17:13 PM »
I tried getting Dev-C++ but I keep getting a build error. This is my whole log, maybe someone could shed some light.


Compiler: Default compiler
Building Makefile: "C:\Users\Kevin\Desktop\Makefile.win"
Executing  make...
make.exe -f "C:\Users\Kevin\Desktop\Makefile.win" all
gcc.exe -c hello.c -o hello.o -I"C:/Dev-Cpp/include"   

gcc.exe: installation problem, cannot exec `cc1': No such file or directory

make.exe: *** [hello.o] Error 1

Execution terminated


 :( :( :( :( :(

Offline wiley89Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: Compiler problems
« Reply #4 on: January 07, 2008, 04:12:11 PM »
I'm just going to give up until someone can help me find a solution. I'm seriously at wits end. I didn't have any problem when I was dabbling with Python, but I don't think Python will help me with microcontrollers.

Offline ed1380

  • Supreme Robot
  • *****
  • Posts: 1,478
  • Helpful? 3
Re: Compiler problems
« Reply #5 on: January 07, 2008, 05:39:06 PM »
try eclipse. try pretyt much any compiler you can find.

reinstal teh ones you have, and clean up teh registry and files left behind by them. ("your uninstaller 2006" does that)
Problems making the $50 robot circuit board?
click here. http://www.societyofrobots.com/robotforum/index.php?topic=3292.msg25198#msg25198

Offline wiley89Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: Compiler problems
« Reply #6 on: January 07, 2008, 08:55:02 PM »
Okay I got microsoft visual C++ to compile my C file, but the only way I can run it is with ctr-f5. The only reason I know about that command is because I checked out a tutorial for an earlier version of the compiler, one that seemed to make more sense (everything gets harder for no reason!!!).

Now my problem is that I can't locate my .exe files. I build it, I compile it, I run it with the run command, but for the life of me I cannot find the .exe

 :o HELP  ???

Offline ed1380

  • Supreme Robot
  • *****
  • Posts: 1,478
  • Helpful? 3
Re: Compiler problems
« Reply #7 on: January 07, 2008, 09:11:42 PM »
go to my computer and right click>search all your drives
Problems making the $50 robot circuit board?
click here. http://www.societyofrobots.com/robotforum/index.php?topic=3292.msg25198#msg25198

Offline wiley89Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: Compiler problems
« Reply #8 on: January 07, 2008, 10:52:41 PM »
I'm able to locate and app but the app is named for the project, not the object. why cant the compiler just do its job and give me my .exe? ahhhh

i dont want projects or a million options. input source, output binaries. why isnt it that simple?

Offline hazzer123

  • Supreme Robot
  • *****
  • Posts: 460
  • Helpful? 3
Re: Compiler problems
« Reply #9 on: January 08, 2008, 01:39:11 AM »
I can vc++ and it stores my project executables in My Documents --> Visual Studio 2008 -->Projects --> 'name of project' --> Debug
Imperial College Robotics Society
www.icrobotics.co.uk

Offline wiley89Topic starter

  • Jr. Member
  • **
  • Posts: 22
  • Helpful? 0
Re: Compiler problems
« Reply #10 on: January 08, 2008, 08:34:07 PM »
Okay, now the app is working. New problem.

The executable is the most basic of programs, the Hello World program. When I execute it the console flashes on, I barely have time to read the message, and then the console turns itself off again. Urg.

Offline sdk32285

  • Supreme Robot
  • *****
  • Posts: 424
  • Helpful? 0
Re: Compiler problems
« Reply #11 on: January 08, 2008, 08:48:22 PM »
add the command 'sleep(3);' to create a 3 second pause, this will give you time to read the output.
(or run the program from the command line start ->run->cmd)

Under normal operations when a program exits it also kills the window.
« Last Edit: January 08, 2008, 08:49:14 PM by sdk32285 »
Robots for Roboticists Blog - http://robotsforroboticists.com/

Offline ed1380

  • Supreme Robot
  • *****
  • Posts: 1,478
  • Helpful? 3
Re: Compiler problems
« Reply #12 on: January 08, 2008, 08:59:33 PM »
so just sleep(3) in before teh closing bracket and it's all?
Problems making the $50 robot circuit board?
click here. http://www.societyofrobots.com/robotforum/index.php?topic=3292.msg25198#msg25198

Offline hazzer123

  • Supreme Robot
  • *****
  • Posts: 460
  • Helpful? 3
Re: Compiler problems
« Reply #13 on: January 09, 2008, 01:47:38 AM »
If you include stdio.h in your headers, then you can use 'getchar()' to stop the program.
Then it will start again when you press enter.
Imperial College Robotics Society
www.icrobotics.co.uk

Offline Rebelgium

  • Supreme Robot
  • *****
  • Posts: 638
  • Helpful? 0
  • It's called the future ... We like it here
Re: Compiler problems
« Reply #14 on: January 09, 2008, 03:28:34 AM »
so just sleep(3) in before teh closing bracket and it's all?

isn't it " Sleep(3000); "? you mean? without the capital letter it doesn't work. and the amount is in millisec, so with only 3 you still won't see anything.
To relax after some hard work on robotics: A very fun free online text based MMORPG
orgcrime.net

 


Get Your Ad Here