?
Solved

a question in C++ Bulider 6 compile

Posted on 2003-02-20
3
Medium Priority
?
286 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

770 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