?
Solved

decl - identifiers

Posted on 1998-09-05
8
Medium Priority
?
275 Views
Last Modified: 2010-04-02
I used standard Unix C++ compiler with the <complex.h> header file. This allows me to use the complex abstract data type in the main program.

Okay, but when I use the same program, after changing the necessary library file names for use on the MSDEV Visual C++ environment, I get the "unknown decl - identifiers" error message for the the ADT type "complex". It is accepted under the Unix compiler, but not under the MSDEV compiler.

xyu --> my code is about a thousand lines. So I can attach an email to you if you give me your e-mail address.
0
Comment
Question by:pdorai
[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
8 Comments
 
LVL 3

Expert Comment

by:xyu
ID: 1172057
Show sample of Your code please...
0
 

Author Comment

by:pdorai
ID: 1172058
Edited text of question
0
 
LVL 3

Expert Comment

by:xyu
ID: 1172059
Send it to ok@pansw.com

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 11

Expert Comment

by:alexo
ID: 1172060
Did you try to #include <complex> (without .h)?
0
 

Expert Comment

by:eric_m
ID: 1172061
Which version of VC?  VC5 puts the standard libary in the std namespace, so you'll need to qualify those names with std.  Try using std::complex.
0
 
LVL 11

Expert Comment

by:alexo
ID: 1172062
Try copying the <complex.h> from the UNIX include directory into the source directory of the WINDOWS machine and compile.
0
 

Accepted Solution

by:
euclid091498 earned 200 total points
ID: 1172063
As eric_m pointed out, if you are using VC5 complex will be inside the std namespace.
If that is the case, then you can either use std::complex or to avoid qualifying complex you can type:

using namespace std;

You will then not need to qualify complex (and all other identifiers in std) for the rest of the translation unit.

Please note that qualifying with std:: is the 'prefered' solution as it avoids identifier collisions.

0
 
LVL 11

Expert Comment

by:alexo
ID: 1172064
pdorai, did you try my suggestion?  You also didn't answer my email.  Please provide some feedback.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
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 clear a vector as well as how to detect empty vectors in C++.
Suggested Courses
Course of the Month12 days, 17 hours left to enroll

777 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