Solved

decl - identifiers

Posted on 1998-09-05
8
270 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
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 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 100 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

737 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