STL valarray problem

Posted on 2002-04-15
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
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

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.
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 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,


Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

705 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