Re: Why does VS2005 show errors in standard include files?????

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Bo Berglund wrote:
:: I am a total newbie with Visual Studio 2005, but I have to use it
:: to create a small test application with an x64 target since no
:: other tool I have can compile 64 bit apps for Windows.
:: The test application is for accessing a Sentinel software
:: protection key.
::
:: What I have done is this:
:: - Created a console application (simplest type of app possible)
:: - Put some printf statements into the main() function
:: - Added my own test code in additional c files

The default for the compiler is to compile .c files as C, and .cpp
files as C++. Did you include cstdio into the .c files?

Either name your files .cpp, or set the "compile as" options propely
in the project settings.


Bo Persson


:: - Added the SafeNet Sentinel support files (headers and lib files)
::
:: When I build this the VS2005 happily accepts my own code without
:: errors (I had some syntax problem that were detected at first).
::
:: But it generates 100+ errors from files it has supplied
:: itself!!!!!!!
::
:: Did Microsoft not proof-read these files before releasing VS2005
:: or is there some setting I have to do to tell it not to bother?
:: These files generate errors:
::
:: C:\Program Files\Microsoft Visual Studio 8\VC\include\cstdio
:: C:\Program Files\Microsoft Visual Studio 8\VC\include\cstdlib
::
:: And the error messages are very strange, all the same two messages:
::
:: C:\Program Files\Microsoft Visual Studio 8\VC\include\cstdlib(18) :
:: error C2143: syntax error : missing '{' before ':'
:: C:\Program Files\Microsoft Visual Studio 8\VC\include\cstdlib(18) :
:: error C2059: syntax error : ':'
::
:: Why does this happen and what does it mean?
::
:: My own code in main.cpp looks like this:
::
:: #include <iostream>
:: #include <fstream>
:: #include <string>
:: #include "KeyGlobals.h"
:: #include "AgiKey.h"
:: #include "spromeps.h"
::
:: int main(int argc, char* argv[])
:: {
:: setlocale(LC_ALL,"C"); // global settings
:: unsigned char AppNo;
:: unsigned short Value;
:: //Your code below
::
:: printf("Test program start\n");
:: AppNo = 1; //look for Application #1
:: if (CheckKey(AppNo))
:: {
:: Value = KeySerial();
:: printf("Key with Application # %d active found!\n",AppNo);
:: Value = KeySerial();
:: printf("Key serial number is: %X \n", Value);
:: Value = KeyLicense(AppNo);
:: printf("License of App # %d is: %X \n", AppNo, Value);
:: Value = KeyInfo(AppNo);
:: printf("Info of App # %d is: %X \n", AppNo, Value);
:: Value = KeyExpDate(AppNo);
:: printf("ExpDate of App # %d is: %X \n", AppNo, Value);
:: }else
:: printf("CheckKey failed for application # %d\n", AppNo);
::
::
:: printf("Test program done\n");
::
:: setlocale(LC_ALL,""); // Local preferences
:: return 0;
:: }
::
:: Any ideas/fixes/tips welcome!
::
:: /Bo
::
:: Bo Berglund
:: bo.berglund(at)nospam.telia.com



.



Relevant Pages

  • Re: BUG: simulink 7.6 (r2010b) and visual c++ 2010 compiler
    ... I have 64-bit Windows 7 and MATLAB R2010b. ... I could compile yprime.c into a mexw64 file and run it. ... I tried to compile simulink code using the VC++ 2008 complier, ...
    (comp.soft-sys.matlab)
  • Re: Upgraded Web Service from VS2003 to VS2005 and all Hell breaks
    ... Visual Studio 2005 Web Application Projects ... "Because the Web Application Project model uses the same conceptual ... My web service project doesn't even have a bin folder. ... When I compile in batch from Visual Build Pro, ...
    (microsoft.public.dotnet.framework.webservices)
  • RE: compile errors
    ... Microsoft Online Support ... | Thread-Topic: compile errors ... I started it with Visual Studio 2005 and then moved to ... Do I have to install Visual Studio 2005 also as it was ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: VB 6 developers and .Net
    ... It takes forever to compile as ... Visual Studio no longer exists - the pathetic garbage they now ... force you to be any more OO then did VB6. ... hard to find bugs relating to type casting; bugs that can only be caught in ...
    (microsoft.public.dotnet.languages.vb)
  • Re:Need Standard C++ Compiler for M$ Windows (Close)
    ... install, yet it still gives full functionality (from the Win32 API ... Microsoft Visual Studio if it is installed on the class computers. ... They basically ripped the IDE off of Borland. ... Anyways, I used it just to verify that my code would compile in it, ...
    (Fedora)