Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The following code ....
C++
#include <iostream>
#include <string>
#include <algorithm>
#include <stdlib.h>
#include <stdio.h>

#define DEBUG 0

using namespace std;


extern int  nw( 
                 string, string, 
                 string&, string&,
                 bool
              );

extern int  nw_align( 
                      int **, char **,
                      string, string, 
                      string&, string&,
                      int 
                    );

extern void  dpm_init        ( int **, char **, int, int, int );
extern void  print_al        ( string&, string& );
extern void  print_matrix    ( int ** const, string, string );
extern void  print_traceback ( char ** const, string, string );
extern int   max             ( int, int, int, char * );


does not compile, reporting the following errors:
1:unable to open include file IOSTREAM
2:----------------------------STRING
3:-----------------------------ALGORITHM
9: deceleration syntax error
13:multiple decleration for 'string'
14:---------------------------------
14: , expected
20: ) expected
26:string cannot start a parameter decleration
26: ) expected
27: ) expected
28: ) expected
29: wrong no of arguments in call of macro 'max'
29: storage class 'extern' is not allowed here

Any idea about what's gone wrong ?


as i executed dis program in visual studio v10 im gettin some errors like;
'alignment.exe': Loaded 'C:\Users\Punith Chandra\Documents\Visual Studio 2010\Projects\alignment\Debug\alignment.exe', Symbols loaded.
'alignment.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'alignment.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'alignment.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'alignment.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
The program '[4432] alignment.exe: Native' has exited with code 0 (0x0).
Any idea about what's gone wrong ?
Posted
Updated 18-Dec-11 19:55pm
v3
Comments
Resmi Anna 16-Dec-11 1:45am    
This is because your visual studio settings has changed by mistake. If you are using Visual Studio 6.0. go to Tools->Options->Directories and check whether you have included all necessary include file folders
Emilio Garavaglia 16-Dec-11 2:35am    
It's 2011 (almost 2012) VS6 is not (anymore) a C++ standard compiler, and has wrong support (different from no support) for many things. It should not be used as a "leraning tool".
Chandrasekharan P 16-Dec-11 2:49am    
Lot of people still work on VC6. So i really dont think VC6 is obsolete. I do not agree with your comment.
Emilio Garavaglia 16-Dec-11 5:27am    
It seems to me you did not understood my "scope".

VC6 is NOT a STANDARD C++ compiler. It misses to match certain language specifications. This is a fact, not an opinion.

If you have to LEARN C++, VC6 cannot be a "reliable tool" since it teaches you something that's NOT (strictly speaking) C++.

If you have to WORK on an an existing product developed with VC6 using its non-standard features then you have to use VC6 (and that's why it is still used by lot of people).

But the two scopes an purposes are different. It's not a matter of obsolescence, but of what are you going to learn. VC6 is NOT C++. Once you know that, decide depending on what you need. But deciding assuming VC6 is a proper C++ implementation is dangerous, since may lead to a wrong decision because of a lack of information.

Since it looks you don't need MFC in you project, why don't you get a freely available modern compiler (such as Visual C++ 2010 Express) and then use the updated headers (and libraries, of course) this way:
C++
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cstdio>


BTW I usually don't encourage mixing C++ streams with C-like stdio.
 
Share this answer
 
v4
Stick a ".h" on the end of each file name:
XML
#include <iostream>
#include <string>
#include <algorithm>
#include <stdlib.h>
Becomes
XML
#include <iostream.h>
#include <string.h>
#include <algorithm.h>
#include <stdlib.h>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900