Solved

STL valarray problem

Posted on 2002-04-15
7
317 Views
Last Modified: 2013-12-14
Hi,
I'm programming in VS 6.0.
When I'm adding #include <valarray>
to one of my files and compile I receive 24 errors and 2 warnings in c:\program files\microsoft visual studio\vc98\include\valarray
mostly:"(167) : see reference to class template instantiation 'std::valarray<_Ty>' being compiled"

How can I fix this?
0
Comment
Question by:borlip
7 Comments
 
LVL 4

Expert Comment

by:IainHere
ID: 6942045
Could you post the code being complained about?
0
 

Author Comment

by:borlip
ID: 6942217
There is no code!!!!
just single line:
#include <valarray>
0
 
LVL 30

Expert Comment

by:Axter
ID: 6942249
Post the code that you're trying to use the valarray include.
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 30

Expert Comment

by:Axter
ID: 6942253
The problem is most-likely in your code, and not in the valarray file.
The compiler will point to the valarray file as the source of the error, but only because something in that file doesn't agree with your code.
0
 

Author Comment

by:borlip
ID: 6942428
I agree , apparently something is wrong with my code.
But how can I figure out what is it. Without that single line everything is perfect....
There are tens of classes and files.
0
 
LVL 30

Expert Comment

by:Axter
ID: 6942452
Post the first 4 compile errors that you get.
0
 
LVL 31

Accepted Solution

by:
Zoppo earned 50 total points
ID: 6942515
Hi borlip,

I think problem is that some STL functions conflict with WinAPI macros (i.e. min, max) ...
so, you can simply include <valarray> before you include <windows.h>.

hope that helps,

ZOPPO
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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 pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

776 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