Go to Post Something has gone awry this year in FIRST. I think more teams are concerned with winning and their robot that they don't even stop to think about the kids on their team, or the learning experiences of others. - Amanda Morrison [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-05-2004, 09:29
Ashley Weed Ashley Weed is offline
Registered User
no team
 
Join Date: May 2002
Rookie Year: 1995
Location: USA
Posts: 1,410
Ashley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond repute
Error in Visual C++

My software came in yesterday, and I was so excited to finally have something to do during my 3 week break from classes. I successfuly installed Visual Studio .NET 2002, and started with a program from a CMPSC class I will be taking next fall. I typed in my first program, and attempted to run it and received this error:
fatal error C1010: unexpected end of file while looking for precompiled header directive

The program I was running can be found here under programming assignments:
Lab Excercise

Could it be as simple as I need more updates in my 2002 version for the program? .... is there an idiots guide to Visual Studio?

Thanks!

[edit] additional information: when program first starts to run an error box pops up with the following - These project configuration(s) are out of date: C++ Projects - Debug Win32 Would you like to build them? [/edit]

Last edited by Ashley Weed : 05-05-2004 at 09:40. Reason: additional information
  #2   Spotlight this post!  
Unread 05-05-2004, 09:42
Jay Lundy Jay Lundy is offline
Programmer/Driver 2001-2004
FRC #0254 (The Cheesy Poofs)
Team Role: Alumni
 
Join Date: Jun 2001
Rookie Year: 2001
Location: Berkeley, CA
Posts: 320
Jay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to all
Re: Error in Visual C++

I don't know why Visual C++ uses precompiled headers by default, but you should probably just disable it.

Goto Project -> "Enter project name here" properties (should be the last option). Under the C/C++ folder goto "Precompiled Headers". Under "Create/Use Precomiled Header" select "Not Using Precompiled Headers".
  #3   Spotlight this post!  
Unread 05-05-2004, 11:47
Ashley Weed Ashley Weed is offline
Registered User
no team
 
Join Date: May 2002
Rookie Year: 1995
Location: USA
Posts: 1,410
Ashley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond repute
Re: Error in Visual C++

Quote:
Originally Posted by Jay Lundy
I don't know why Visual C++ uses precompiled headers by default, but you should probably just disable it.

Goto Project -> "Enter project name here" properties (should be the last option). Under the C/C++ folder goto "Precompiled Headers". Under "Create/Use Precomiled Header" select "Not Using Precompiled Headers".

Thanks for the suggestion, but I'm so confused at this point that I can't even locate "properties". I found a drop box on the right hand side, but there is nothing within it. I think I need to find a good beginners book that goes back and explains the simplest terms to me (GUI, ATL, OOP, etc? what's this!).

Since I am working in Visual Studio .NET, should I find a Visual C++ book, or would I be just as well of with a good C++ text? (Sorry, I don't know if there is a difference between C, C#, C++, or VC.)
  #4   Spotlight this post!  
Unread 05-05-2004, 11:50
Greg Perkins's Avatar
Greg Perkins Greg Perkins is offline
7 years, allready!!???!?!?!
AKA: Mongo
no team
Team Role: Alumni
 
Join Date: Feb 2002
Rookie Year: 2000
Location: Nashua, NH
Posts: 1,203
Greg Perkins has a reputation beyond reputeGreg Perkins has a reputation beyond reputeGreg Perkins has a reputation beyond reputeGreg Perkins has a reputation beyond reputeGreg Perkins has a reputation beyond reputeGreg Perkins has a reputation beyond reputeGreg Perkins has a reputation beyond reputeGreg Perkins has a reputation beyond reputeGreg Perkins has a reputation beyond reputeGreg Perkins has a reputation beyond reputeGreg Perkins has a reputation beyond repute
Send a message via AIM to Greg Perkins Send a message via MSN to Greg Perkins Send a message via Yahoo to Greg Perkins
Re: Error in Visual C++

Ashley, your about as knowledgeable w/ c++ as i am, wish i could help you out.
__________________
myResume -2004: PARC Referee; Beantown Staff; Battlecry Referee; Summer Frenzy Head Referee; River Rage Head Referee, 2005: Pittsburgh Regional Referee; PARC Referee


XBOX Live Gamertag = TrixAre4Kidss
  #5   Spotlight this post!  
Unread 05-05-2004, 13:08
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Error in Visual C++

Quote:
Originally Posted by Ashley Weed
Since I am working in Visual Studio .NET, should I find a Visual C++ book, or would I be just as well of with a good C++ text? (Sorry, I don't know if there is a difference between C, C#, C++, or VC.)
Teach Yourself Visual C++ in 21 days is a good book for Visual C++. (Don't remember how updated it is/what the most recent version is.)

I'de get a Visual C++ specific one, as VC++ is "special" in many ways...
__________________

  #6   Spotlight this post!  
Unread 05-05-2004, 18:59
Max Lobovsky's Avatar
Max Lobovsky Max Lobovsky is offline
Fold em oval!
FRC #1257 (Parallel Universe)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Scotch Plains, NJ
Posts: 1,026
Max Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant future
Send a message via AIM to Max Lobovsky
Re: Error in Visual C++

Quote:
Originally Posted by Texan
I'de get a Visual C++ specific one........
Was that a humurously ironic typo or a joke (I'de=IDE)?
__________________
Learn, edit, inspire: The FIRSTwiki.
Team 1257


2005 NYC Regional - 2nd seed, Xerox Creativity Award, Autodesk Visualization Award
2005 Chesapeake Regional - Engineering Inspiration Award
2004 Chesapeake Regional - Rookie Inspiration award
2004 NJ Regional - Team Spirit Award
  #7   Spotlight this post!  
Unread 05-05-2004, 20:00
phrontist's Avatar
phrontist phrontist is offline
Proto-Engineer
AKA: Bjorn Westergard
FRC #1418 (Vae Victus)
Team Role: College Student
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Falls Church, VA
Posts: 828
phrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond repute
Send a message via AIM to phrontist
Re: Error in Visual C++

Oh how I loathe VC++

I remember trying to compile a program, which was perfect ANSI C, and becoming quite frustrated. So I googled, and to my shock and horror read the following:


Quote:
VC++ doesn't comply to ANSI C
My face looked a lot like this:

It's not a real compiler, it doesn't adhere to the definition of what a real compiler is supposed to do!

Typical M$ attitude: "Oh we 0wnz0rs teh ma55es! We don't n33d not stinkin' standards!!!1!" (Yes, Microsoft engineers actually speak l33t)

*sob*
__________________

University of Kentucky - Radio Free Lexington

"I would rather have a really big success or a really spectacular crash and failure then live out the warm eventual death of mediocrity" - Dean Kamen
  #8   Spotlight this post!  
Unread 05-05-2004, 20:26
Ashley Weed Ashley Weed is offline
Registered User
no team
 
Join Date: May 2002
Rookie Year: 1995
Location: USA
Posts: 1,410
Ashley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond reputeAshley Weed has a reputation beyond repute
Re: Error in Visual C++

So I am guessing each one of these really are different in their own way? C varies from C++, and VC++, and C#? What is C#?

I believe I will have to concentrate purely on VC++ at the moment. However, with my new major (IST), I am sure I will be learning more along the way. Is there an easier way to learn VC++ by learning another first? I attached the course outline below as informative or maybe humor for some of you.

Course Outline: Computer Science 101 is primarily a course in problem solving and computer programming. Topics include the following: the Visual C++ development environment; data types; operators; Input/Output (I/O); control structures including the if, for, while, and do-while statements; arrays, pointers, and reference variables; searching and sorting of arrays; functions and parameters; local variables; introduction to classes; text file I/O. Visual C++ is the vehicle language.
  #9   Spotlight this post!  
Unread 05-05-2004, 20:34
Guest
 
Posts: n/a
Re: Error in Visual C++

Wierd how it says "Visual C++ is the vehicle language." C++ is a language, VC++ is not.
  #10   Spotlight this post!  
Unread 05-05-2004, 21:06
Max Lobovsky's Avatar
Max Lobovsky Max Lobovsky is offline
Fold em oval!
FRC #1257 (Parallel Universe)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Scotch Plains, NJ
Posts: 1,026
Max Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant future
Send a message via AIM to Max Lobovsky
Re: Error in Visual C++

C++ is the name of the language you are learning (not to be confused with C, which is mostly C++ minus the OOP (Object Oriented Programming)). VC++ is Microsoft's IDE (integrated development environment) which, for the most part, complies with ANSI C++. The V (visual) just comes from the fact that the IDE has a bunch of features for making GUI (graphical user interfaces) pretty easily. C# is Microsoft's main competition towards Java. It is C++ with even more OOP stuff and made into a semi-compiled, semi-interpreted language, like Java.
__________________
Learn, edit, inspire: The FIRSTwiki.
Team 1257


2005 NYC Regional - 2nd seed, Xerox Creativity Award, Autodesk Visualization Award
2005 Chesapeake Regional - Engineering Inspiration Award
2004 Chesapeake Regional - Rookie Inspiration award
2004 NJ Regional - Team Spirit Award
  #11   Spotlight this post!  
Unread 05-05-2004, 21:38
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Re: Error in Visual C++

Quote:
Originally Posted by Ashley Weed
I typed in my first program, and attempted to run it and received this error:
fatal error C1010: unexpected end of file while looking for precompiled header directive

The program I was running can be found here under programming assignments:
Lab Excercise

...

[edit] additional information: when program first starts to run an error box pops up with the following - These project configuration(s) are out of date: C++ Projects - Debug Win32 Would you like to build them? [/edit]
I ran the Lab Excercise without any problem. I poked around in VS.NET's help, and finally figured out that your precompiled header option is probably set in the "CL" environment variable. Look for /Yu or /Yufilename. Delete any of those you find, if you don't want to use precompiled headers.

As to the message "These project configuration(s) are out of date: C++ Projects - Debug Win32 Would you like to build them?", that's normal whenever you try to "Run" a project without compiling it first.
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
  #12   Spotlight this post!  
Unread 06-05-2004, 07:27
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Error in Visual C++

I would also recomend "Sam's Teach yourself Visual C++ in 21 days". The version we have is for 6.0, but there probably is a .NET version, too.

I think 'Visual' comes from the OOP, but I'm not positive. (C++ is mostly code, anyway)

[And C# is a scripting version of C++. I'm sceptical about it.]

Last edited by Astronouth7303 : 06-05-2004 at 14:47.
  #13   Spotlight this post!  
Unread 06-05-2004, 12:46
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Re: Error in Visual C++

Alright, here's a quick run-down of PCH (pre-compiled headers):

In REALLY big projects, there are sometimes files that need to be included in every other file (like externs for global variables, a few function prototypes, maybe even a few classes).

Normally, #include works like copy-paste in C++ files (ie, the #included file is literally inserted in place of the #include). This is done by the preprocessor, so the compiler doesn't even know that there used to be a #include.

In large projects, this means that the #included file will have to be re-compiled as part of each file in which it was included. This can be a HUGE time-waster since it will compile to the same thing every single time.

With PCHs, the development environment essentially keeps track of these files specially, compiles them once, and then essentially copy-pastes the compiled code into each file instead of the raw source. Thus, the compiler only needs to compile it once, and much time could be saved.



Now, on to your problem:
1. PCHs are almost useless in small projects. Avoid them unless you actually need them.

2. VC++ disagrees with me. Whenever it creates a new project, it automatically assumes you want PCHs.

3. VC++ doesn't like being told it's wrong. If it can't find the #include of the PCH, it will complain.

There are two solutions to the problem:

1. Turn off precompiled headers in your project. I don't have a copy of .NET, but in VC++ 6.0, you do this by going to Project -> Settings -> C/C++ tab, choose "Precompiled Headers" from the category drop-down box, and select "Not using precompiled headers".

2. Give in to VC++ and simply add a #include "stdafx.h" to the top of every file. (stdafx.h is the name VC++ gives to the PCH).


While we're on the topic, if you're just learning C++, you should always tell VC++ to create a "Win32 console application" and make it of the "Hello, World!" type. Then, just delete the main function they give you and replace it with your own.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #14   Spotlight this post!  
Unread 06-05-2004, 13:17
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Re: Error in Visual C++

Quote:
Originally Posted by rbayer
1. Turn off precompiled headers in your project.... do this by going to Project -> Settings -> C/C++ tab, choose "Precompiled Headers" from the category drop-down box, and select "Not using precompiled headers".
In my version of Visual Studio .NET, there is no "Project -> Settings". That's why I had to come up with the environment variable solution.

BTW, I just tried adding CL=/Yu to my environment variables, and got the same error that Ashley did. I also tried adding #include "stdafx.h" like Rob suggested, and that didn't get rid of the error. So I still stand by my fix... at least until Ashley tells me there is no CL=/Yu in her environment.
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
  #15   Spotlight this post!  
Unread 06-05-2004, 14:51
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Error in Visual C++

Quote:
Originally Posted by maxlobovsky
VC++ is Microsoft's IDE (integrated development environment) which, for the most part, complies with ANSI C++.
Actually, it doesn't comply on a lot of things, only things like "Yeah, we use brackets to indicate the end of a class."

Quote:
Originally Posted by maxlobovsky
The V (visual) just comes from the fact that the IDE has a bunch of features for making GUI (graphical user interfaces) pretty easily.
Plus it has a lot of completely non-standard like functions for graphics. (which saying something, since there is no standard...)
__________________

Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
White Paper Discuss: 2004 Visual Basic 6 Dashboard Control CD47-Bot Extra Discussion 2 01-02-2005 01:56
Visual Basic dddriveman Programming 12 20-03-2004 13:03
Any pratical use for Microsoft Visual Studio .NET Pro Kyle Fenton General Forum 11 28-01-2003 16:59
Computer Graphics and Visual Basic Programing Gope General Forum 0 26-10-2002 13:44
Visual Game Simulator techknights General Forum 8 22-01-2002 19:43


All times are GMT -5. The time now is 07:12.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi