Improve company productivity with a Business Account.Sign Up


STL valarray problem

Posted on 2002-04-15
Medium Priority
Last Modified: 2013-12-14
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?
Question by:borlip

Expert Comment

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

Author Comment

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

Expert Comment

ID: 6942249
Post the code that you're trying to use the valarray include.
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

LVL 30

Expert Comment

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.

Author Comment

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.
LVL 30

Expert Comment

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

Accepted Solution

Zoppo earned 150 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,


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
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 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 learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

584 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