Using directX 11 in Visual Studio 6.0 - directx-11

I want use include files
#include <d3d11.h>
#include <d3dx11.h>
#include <d3dcompiler.h>
#include <xnamath.h>
in visual studio 6.0.
But when i compile .cpp i we got this error:
:\Users\8up tuotlo\Desktop\Visual C++ 6.0 Proects\11\Article1\Article1.cpp(28) : error C2146: syntax error : missing ';' before identifier 'CD3D11_DEFAULT'
:\Users\8up tuotlo\Desktop\Visual C++ 6.0 Proects\11\Article1\Article1.cpp(28) : error C2146: syntax error : missing ';' before identifier 'CD3D11_DEFAULT'
When i include:
#include <d3d9.h>
#include <d3dx9.h>
All normally compile.
What is this thing?

Check the compiler support for recent versions of the Windows SDK. I suspect that VC++6 is no longer supported (it is over 15 years since it was released, with six releases since then).

Related

fatal error C1189: #error: <future> is not supported when compiling with /clr or /clr:pure

When porting Qt to 5.10.1, I am getting following error
Reason for Error: Visual studio Build with clr(Common language runtime ) support settings, so that above error is generated.
C/C++ Advanced > showIncludes sets "Yes", so It has been identified that from Qt's QThread above error is generated.
How to resolve above error in Qt 5.10.1 with VS2015 ?
Note: I am using C# dll in my Qt VS project
Make sure QThread doesn't include when clr is enabled.
I have done conditional compilation for my project include
#ifndef CLR_ENABLED
#include <QtCore/QThread> //Error C1189: #error: <future> is not supported when compiling with /clr or /clr:pure. Qt5 porting.
#endif

Using std::function<void> on visual studio 2013

I am converting my project from mac os x (xcode) to windows (visual studio 2013).
But i am having problems when i try to use the std::function.
As an example i declared.
std::function<void()> processFunc;
But i get several errors:
Error 1 error C2039: 'function' : is not a member of 'std' ...github\oglengine\engine\game.h 39 1 Engine
Error 2 error C2143: syntax error : missing ';' before '<' ...github\oglengine\engine\game.h 39 1 Engine
Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int ...github\oglengine\engine\game.h 39 1 Engine
On XCode i needed to enable the c++11, but from what i saw on my research the VS 2013 have the C++11 enables.
My only C++ include is the iostream
Should i add another include?
I believe you need to #include <functional> in VS.

Visual Studio 2010 source annotation keywords cause name clashes

After having converted a project from Visual Studio 2005 to Visual Studio 2010, it appears the project doesn't build anymore and spits out tons of C2059 errors like:
`error C2059: syntax error : 'type'
We're using Visual Studio 2010 Professional which doesn't provide static code analysis.
Here is the full log for the compilation of 1 C file for reference:
1>------ Build started: Project: VoHR, Configuration: Debug Win32 ------
1> AKAsynch.c
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(88): error C2059: syntax error : 'type'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(107): error C2059: syntax error : '}'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(119): error C2059: syntax error : 'type'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(139): error C2059: syntax error : '}'
I tracked down the reason of those sudden compiler errors.
In the great tradition of windows.h it appears that Microsoft introduced tokens that cause name clashes with our codebase.
In our precise case, we had:
#define Null (void*)0
Somewhere in our code, we need to use the offsetof macro and to make it available we #include <stddef.h>
I tracked down stddef.h in turns includes crtdefs.h which ends up including sal.h where our Null macro seems to clash with source code annotation in MS headers...
As a workaround, we did:
#if defined(_MSC_VER) && _MSC_VER >= 1600
#pragma push_macro("Null")
#undef Null
#endif
#include <stddef.h>
#if defined(_MSC_VER) && _MSC_VER >= 1600
#pragma pop_macro("Null")
#endif
Our use of Null as a macro is arguable, still I would have expected MS to find a way to avoid clashes with existing code bases.
Hope that helps those facing the same issue.

Cannot compile 3D point viewer in Visual Studio 2008

Can someone help me ?I am trying to run the 3d point cloud viewer .However it shows me the following errors
Error 1 error C2144: syntax error : 'void' should be preceded by ';' c:\program files\microsoft sdks\windows\v6.0a\include\gl\gl.h 1152 Viewer
Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft sdks\windows\v6.0a\include\gl\gl.h 1152 Viewer
Error 3 error C2146: syntax error : missing ';' before identifier 'glAccum' c:\program files\microsoft sdks\windows\v6.0a\include\gl\gl.h 1152 Viewer
Error 4 error C2182: 'APIENTRY' : illegal use of type 'void' c:\program files\microsoft sdks\windows\v6.0a\include\gl\gl.h 1152 Viewer
Error 5 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft sdks\windows\v6.0a\include\gl\gl.h 1152 Viewer
Error 6 error C2144: syntax error : 'void' should be preceded by ';' c:\program files\microsoft sdks\windows\v6.0a\include\gl\gl.h 1153 Viewer
Error 7 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft sdks\windows\v6.0a\include\gl\gl.h 1153 Viewer
and so on ...
Beginning of my code is :
#include <cstdlib>
#include <GL/glut.h>
#include <cmath>
#include "arcball.h"
#include <vector>
#include <iostream>
#include <fstream>
using namespace std;
Can someone please tell me what is going wrong?
Well, the first reported error is on the first line that declares a function with the WINGDIAPI modifier. Apparently, this is declared in wingdi.h. However, I'm not sure if you're meant to #include that directly, or whether there's a more formal recommendation for compiling opengl code in the windows environment. I'll have a hunt around.
The page on MSDN discussing the necessary headers for OpenGL work are a bit vague, but I take:
The Windows functions that support Microsoft's implementation of OpenGL in Windows must include the header file Windows.h.
To mean that you ought to include windows.h first.
Really? If I create a blank C++ project in VS2008, create an empty cpp file, copy and paste your includes in, and hit compile, I get exactly the errors you described. If I change my includes to:
#include <cstdlib>
#include <windows.h>
#include <GL/gl.h>
#include <cmath>
#include "arcball.h"
#include <vector>
#include <iostream>
#include <fstream>
Then the first reported error I get is that it can't find "arcball.h" (hardly unexpected). Are you still getting the same errors once windows.h is included?

How to solve build errors using VS 2010 Ultimate on 32bit XP Sp3

Installed VS2010 Ultimate on my desktop workstation - Dell Precision T3500 (Windows 7 64bit OS), and on my IBM ThinkPad R51 (Windows XP Sp3 32bit).
I am having problems building solutions on the StinkPad, and cannot figure out why. As listed below, the build output for a compiler built ADO library lists the following errors:
c:\wpds\debug\msjro.tlh(196): error C2146: syntax error : missing ';' before identifier 'ConflictTables'
c:\wpds\debug\msjro.tlh(196): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\wpds\debug\msjro.tlh(196): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\wpds\debug\msjro.tlh(224): error C2146: syntax error : missing ';' before identifier 'GetConflictTables'
c:\wpds\debug\msjro.tlh(224): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
I have checked to make sure that all include, exe, and library paths are correct for all projects and solutions. Any insight will be greatly appreciated.
Thanks
Bill
I encountered this same problem when compiling for the first time with a new version of msado15.dll. There are dependencies between msado15.dll and msjro.dll, as evidenced by these lines at the top of msjro.tlb:
// Cross-referenced type libraries:
//
// #import "C:\Program Files (x86)\Common Files\System\ado\msado15.dll"
//
In my case, the problem arose because I'm building my app on Windows 7, and the SP1 update includes a breaking change in msado15.dll that will cause the application to fail on Windows XP. When I fixed this problem using this KB, my msado dll problems were fixed but my msjro.tlb stopped compiling.
There is probably a way to update msjro to reference the desired/correct msado (in my case, msado60_Backcompat.tlb as installed in the KB), but if you're using CADODatabase classes defined in ado2.cpp and ado2.h, and if you're not using jet-specific features, a simpler fix is to just comment-out the portions of ado2.h and ado2.cpp that reference jet.
I just commented out this line in ado2.h:
//#import <MSJRO.DLL> no_namespace rename("ReplicaTypeEnum", "_ReplicaTypeEnum")
and also #ifdef'd out all of the implementations of CJetEngine methods in ado2.cpp, and that worked for me.
Good luck!
I had this problem too. Then I compared the MSJRO.TLH created on WinXP to the one created on Win7. On WinXP the declaration was
ADODB::_RecordsetPtr ...
on Win7 it was
_RecordsetPtr ...
I guessed that the problem might be related to namespaces. MSADO15.TLH defines a namespace -"ADODB". So I placed:
using namespace ADODB;
before my import of the Jet.
#import "MSJRO.DLL"
This got rid of the errors for me.

Resources