tinyxml2::XMLDocument redefinition with msxml - visual-studio-2010

I'm using cocos2d-x library. cocos2d-x has tinyxml2 lib.
But tinyxml2::XMLDocument is in conflict with ms's XMLDocument in msxml.
I use tinyxml2::XMLDocument as this code:
tinyxml2::XMLDocument Doc;
but in virtual studio 2010, i get the error c2371 like this:
c:\program files\microsoft sdks\windows\v7.0a\include\msxml.h(9800): error C2371: “XMLDocument”:redefinition.

I know it's not ideal, I had the same problem and was able to hack around it by renaming tinyxml2's XMLDocument to TinyXMLDocument. This assumes you have the source and are building it into your project as opposed to using a pre-compiled library.

Related

intergrating qt4 ,vtk and visual studio2010

I have an integrated visual studio (2010) and Qt(4 visual studio addin) combination and just recently decided to add VTK5.I have managed to compile VTK as per the numerous instructions everywhere .However i tried to build a simple example from the VTK website but i get the Dll errors below.I have added include paths in visual studio but just can't compile .please direct me on what i should do next .
GeneratedFiles\Debug\moc_QVTKWidget.cpp(73): warning C4273: 'staticMetaObjectExtraData' : inconsistent dll linkage
E:/libs/vtk/vtk-5.10.1/VTK5.10.1/GUISupport/Qt/QVTKWidget.h(76) : see previous definition of 'private: static QMetaObjectExtraData const QVTKWidget::staticMetaObjectExtraData'
GeneratedFiles\Debug\moc_QVTKWidget.cpp(77): error C2491: 'QVTKWidget::staticMetaObject' : definition of dllimport static data member not allowed
I have been able to build a working environment following this guide, it is really helpful and well explained (and, as the more important thing, it uses VS2010, QT 4 and VTK 5): http://guitarcplusplus.blogspot.it/2013/02/itk-vtk-qt-on-window-7-64bit-and-visual.html.

C4272 Error when using QT3D library in visual Studio

i am using microsoft visual studio 2010 for developing an application. Additionally I am using the QT3D library as an external library.
The QT 3D library is sucessfuly installed and integrated with visual studio. I know this because I can compile and run the examples.
but when I try to write my own code, the visual studio compiler gives me the following error
c4272 : 'function' : is marked __declspec(dllimport); must specify native calling convention when importing a function.
The error message is received a few hundred times, for each of the member functions which are present in the classes in the library header files.
I suspect, that problem has something to do with the linking of the libraries. In the Additional include files the Path is given as follows
"$(QTDIR)\include";"$(QTDIR)\include\Qt3D";"$(QTDIR)\include\QtGui";"$(QTDIR)\include\QtCore";".moc\debug_shared";$(QTDIR)\mkspecs\win32-msvc2010;%(AdditionalIncludeDirectories)
When I iclude the header files, the auto complete option can detect these libraries.
the additional library file paths are given as follows.
$(QTDIR)\lib;C:/qt/5.0.1-x64/qtbase/lib;%(AdditionalLibraryDirectories)
any ideas?
Best Regards
tdk.

Web Reference namespace not seen by Visual Studio 2010 compiler after 2.0 to 3.5 project conversion

I'm getting a build error in Visual Studio that's not making any sense:
The type or namespace name 'MyService' does not exist in the namespace 'My.Project' (are you missing an assembly reference?)
The namespace MyService is defined in a Web Reference. In the Object Browser, I can clearly see that namespace and all of the classes defined in it. There are no compile errors for any of the code in the Web Reference.
The code stopped compiling after I changed the framework target from 2.0 to 3.5. Why could the compiler be choking, and how can I go about fixing this? I already tried updating the web reference, but the problem remains. I even tried commenting out the code in the generated "Reference.cs" and copying the code to another code file in the project, and the namespace was still not seen.
My project is referencing the following:
System 2.0.0.0
System.Data 2.0.0.0
System.EnterpriseServices 2.0.0.0
System.Net 3.5.0.0
System.Web.Services 2.0.0.0
System.Xml 2.0.0.0
Update
It isn't just my web service generated code that is having compile problems; for all of the projects converted to .NET 3.5, I cannot reference their namespaces.
I'm still not sure why this is all happening, but I found a workaround; by adding a using Ns = My.Project.MyService to my code, I was able to reference types in the namespace with Ns.MyType.
This is apparently documented as a bug in Visual Studio:
https://connect.microsoft.com/VisualStudio/feedback/details/570557/targeting-net-framework-3-5-actually-targets-3-0-gac
I utilized the workaround documented in the post by copying System.Web.Extensions.dll from C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5 to C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0. Then I restarted Visual Studio.
That alone didn't fix the problem. I had to redo the project conversion from 2.0 to 3.5 after the assembly was copied. After the new conversion, the code compiled as expected. Doing a diff between the project file pre- and post-workaround didn't reveal any substantial differences, so the build errors must have been due to some internal state of Visual Studio.

Which Namespace For EnvDTE?

I was playing with writing a Visual Studio Add-In in F# and I was following along with some stuff that Gabriel Culliver and Brian McNamara had posted in response to this question.
When I put the following code into a .fs file in VS 2010
namespace TestFSharpAddIn
open System
open Extensibility
//open EnvDTE
//open EnvDTE80
do()
It gives me the following error when I attempt to build:
The namespace or module 'Extensibility' is not defined
I have added a reference to Extensibility.dll so I'm assuming that the namespace within the Extensibility dll is not "Extensibility". But it doesn't seem to be possible to open the Extensibility dll in the Object Browser. Am I missing something obvious here? How can I find out which namespaces are present in Extensibility.dll?
I also tried this with EnvDTE with pretty much the same issue.
The project is a modified C# template (per Brian's answer) and I can comment out everything in this .fs file and it builds so I think the project/solution itself is ok. There's a second .fs file in the project which builds fine but, of course, it doesn't need to reference any of the EnvDTE or Extensibility assemblies.
EDIT:
Additional Information:
Extensibility.dll
Version 7.0.3300.0
Path: C:\Program Files\Common Files\Microsoft Shared\MSEnv\PublicAssemblies\Extensibility.dll
I'm not sure what's going on in with your situation but I've verified this works in F#. Here are my steps
New F# application
Add a Reference to the Extensibility DLL
I then added the following code to verify the reference. It compiles cleanly.
open Extensibility
let x : IDTExtensibility2 = null
printfn "foo"
The path I used for the extensibility DLL is
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Common\Extensibility.dll

Build the OpenCV 2.0 libraries from source using Visual Studio 2010 Beta and CMake

OpenCV 2.0a does not include pre-compiled OpenCV libraries for Visual Studio users. I am trying to build the libraries from source using Visual Studio 2010 Beta and CMake, but I am getting lot of errors.
I even tried generating the libs from dlls using dumpbin but the linker errors are still persisting. Please guide me to generate the static libs for VS2010.
If the build error you're seeing is related to:
'back_inserter': identifier not found
as is likely the case for the source files cvmodelest.cpp and cvhog.cpp, add the following include statement to each of those source files:
#include <iterator>
For more info about the 'back_inserter': identifier not found error, see this blog post.
It's kind of late, but I created a video tutorial for compiling and configuring OpenCV 2.1 with Visual Studio 2010.
Try this tutorial(dead) and this one out as well.
I tried this with VS 2010 and Windows 7.
See another StackOverflow thread. It's for VC++ 2008, but it may help.

Resources