Re: VC2005 cannot build project, complains about missing items...
Bo Berglund wrote:
I am trying to compile a code example from a hardware protection key
supplier.
The example should compile but does not on my VS2005 installation.
[...]
The first problem was that it stopped on this include line:
#include <istream.h>
saying the file could not be found.
After looking in the VC/include dir below VS2005 I found a file called
istream (no extension), which seemed to be a header file so I renamed
it to istream.h.
It seems that the example is for VC++6.0. Nowadays "xxx.h"
stream headers are deprecated and not used anymore. Streams
are part of Standard C++ Library and should be included as
any other facility:
#include <istream>
It's bad idea to rename library's header file, since other
components may include it, too.
Next I received no less than 10 errors (lines wrapped due to
newsreader):
1>c:\engineering\projects\bosse\safenet\spquery\dsdll.h(72) : error
C4430: missing type specifier - int assumed. Note: C++ does not
support default-int
[...]
If I doubleclick the first error I get to this piece of code:
extern __declspec(dllexport) WINAPI SAFEInitGlobal(unsigned char*);
Most likely you get this error due to `WINAPI' token. Ensure
that you have Platform SDK properly installed and integrated
with Visual C++. If you use Express edition of VS, then read
here for additional info:
"Using Visual C++ 2005 Express Edition with the Microsoft
Platform SDK"
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/
Also, don't forget to include <windows.h>. However, it
should be arranged for you by IDE's wizard anyway.
I assume that you have installed protection key SDK and made
it available for the project.
(Bear in mind that I am not used to working with VS2005, I have only
worked with VB6 (a lot) and Borland products....
Speaking about compilation and linking, Borland's products
based on same basic principles. You need header files in
order to compile and lib/obj files in order to link. All you
need to do is to specify relevant directories in IDE where
compiler/linker can find required files.
Alex