?
Solved

a question in C++ Bulider 6 compile

Posted on 2003-02-20
3
Medium Priority
?
287 Views
Last Modified: 2007-12-19
the ide prompt me:
[C++ Warning]Dialogs.hpp(437):W8058 Cannot create pre-compiled header: initialized data in header

how this means? what can i do ?
0
Comment
Question by:Hahaha
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
xyzzer earned 200 total points
ID: 7992239
That's only a warning, but it makes building slower...
You should avoid initializing variables in .h files and do it in .cpp-s instead.

--Filip
0
 
LVL 2

Expert Comment

by:udil
ID: 8868892
This question has been abandoned. I will make a recommendation to the moderators on its resolution in a week or two. I appreciate any comments that would help me to make a recommendation.

In the absence of responses, I may recommend DELETE unless it is clear to me that it has value as a PAQ. Silence = you don't care.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Udil
EE Cleanup Volunteer
0
 
LVL 2

Expert Comment

by:xyzzer
ID: 8916165
It's just that warnings tell You that something's not very nicely organized in the code. They might show that something has been done wrong thus helping to detect possible bugs or just that something is not done as well as it could have been. If the warning tells us about something we've done on purpose we can use pragmas to switch it off to make the errors/warnings log more clear. I usually use something like this:

...
#pragma warn -pia  
//turns off the warning (pia means possibly incorrect assignment, but You can also use the warning number instead)
if (ret=SomeFunction()) {
#pragma warn +pia
//to turn it back on
...

--Filip
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question