Directx changes - visual-studio

i have a problem with win8 and directx library. i have directx jun 2010 i added its d3dx11.lib and .h files but it doesnt work and says library not found. i found hte link bellow that says you can work with win8 sdk instead of directx libraries and d3dx.... libraries are not supported anymore.
http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275%28v=vs.85%29.aspx
i found in vs2012 there is a project that builds directx proggram but when i made a project with it it wasnt like any directx code ive seen before its more like xna
what these really mean? how should i work with these changes? its better to return to win 7 and previous libraries or work with these new tools. thanks for helping

"Where is the DirectX SDK?" explains that well. Probably you will want to read it one more time.
D3DX
D3DX and D3D is not the same. D3DX is just a helper library. Microsoft not recommends to use D3DX anymore and stripped it from SDK. So now:
For new code: "Living without D3DX" (alternative link) explains what to use instead in your new code. And here are some D3DX replacement stuff.
For old code: if you just want to build old code that uses D3DX (tutorial samples, for example), you just need to install DirectX SDK and add include/lib paths to your project, as if it was any other library. Mixing Windows SDK and DirectX SDK is not recommended and can lead to errors, so don't use it in new code. Also read here.
Probably, you will be interested to read this and that answer also.
P.S. As always, if linker says, "Library not found", double check, that you've added library path to project options and that library file exists at that folder.
Happy coding!

Related

Linker Error: Cannot open input file 'd3dx9.lib'

This is a very simple question but I have been searching for a while now and have no luck. Im supposed to add it to the linker I beleive? Which is Project Properties > Linker > Input > Additional Dependencies. Im just confused on exactly what to do. Thank you.
The simplest solution is to add the Microsoft.DXSDK.D3DX NuGet package to your project and not use the legacy DirectX SDK at all. This puts the headers d3dx9*.h, d3dx10*.h, and d3dx11*.h into your include path. It also adds d3dx9.lib, d3dx10.lib, and d3dx11.lib to your link settings, and provides the required runtime DLLs 'side-by-side'. See this blog post.
Otherwise, to integrate the legacy DirectX SDK requires some special include/lib path ordering in VC++ Directories, and you'll have a number of other quirks to contend with. See Microsoft Docs for the details.
Of course, the real question is "Why are you using legacy Direct3D 9 in the first place instead of Direct3D 11?". For Direct3D 11 or Direct3D 12, you should avoid the legacy DirectX SDK and D3DX9/D3DX10/D3DX11 entirely. See Living without D3DX.

xcode: Avoiding link conflicts with a static library

We're developing an SDK for our technology for iOS, the sdk is delivered in a static framework. Our code uses openCV and we link OpenCV into the delivered framework binary.
This normally works well but we're having an issue with a client which is indirectly using a different version of openCV in another framework.
This is causing a conflict and the clients app crashes.
Beside switching to the same version of openCV, removing our openCV dependency or switching to a dynamic library (which allows to hide open CV inside), is there an another option to fix this?
I tried to compile our lib using "Perform Single-Object Prelink and add the openCV libs in "Prelink libraries" but this produced link error when I tried to integrate it and it looks as if it ignored "Prelink libraries", maybe I'm doing something wrong here.
Any thoughts or ideas on the matter would be much appreciated.

Recommended Cross-Platform (Windows and Android) Project Set Up using OpenTK

I am starting to develop a scientific software that I hope I will be able to run on multiple platforms. My plan is to use OpenTK for the rendering of the scientific models and plots. As of the moment I have a prototype that runs on Windows using OpenTK 1.1 libraries from http://www.opentk.com/ (a simpler version just with OpenTK and a more complicated one with OpenTK + WindwosForms). I am trying to port that prototype to Android.
It seems that the syntax using by the Xamarin.Android OpenTK library is nearly identical to the one that I am currently using for Windows (with the only difference that OpenGL -> OpenGL ES and GameWindow -> AndroidGameView) so the porting shouldn't be an issue. However, I was hoping that I could avoid a copy-paste method and get a more permanent solution having a shared OpenTK code between the Windows and the Android version.
I have read trough the Xamarin documentation about the shared vs PCL methods for cross-platform development. However, I still struggle to figure out how to set-up a Visual Studio solution with an Android and Windows project and a shared code that will include OpenTK. Is that even possible and can someone give me an example of how to do it? I did explore an example I found for rendering a rotating cube using OpenTK for a shared Android/iOS project (http://developer.xamarin.com/content/TexturedCubeES30/) but in my case I need to use a different OpenTK library for the Windows and for the Android project.
I also found this Do the Android and iOS versions of OpenTK have the same API? discussion. It is very similar to what I would like to do but in my case I am trying to setup a project for Windows and Android (for now).
Can I use only one OpenTK library (which one?) that is being called from both the Android and the Windows project and what will be the right way to set-up both projects so they share the same OpenTK code. This is the first time I am dealing with writing a cross-platform code so I am a bit lost.
Edit: I was able to get a prototype running using Shared Xamarin project and compiler flags as proposed below. Code was indeed not very pretty at places but I got over 70% code re-usability between the two platforms so it was worth the effort. This is how I used the compiler flags in case someone is looking for the same thing (credit to SKall from the Xamarin forums):
#if __ANDROID__
using OpenTK.Graphics.ES11;
#else
using OpenTK.Graphics.OpenGL;
#endif
I used the #if syntax similarly where there were small differences between the syntax of the routines.
It does not seem like OpenTK has its logic inside of a PCL in the first place, so your plans on putting it there are going to get hard to achieve.
However, if you split out your code, such that most of it is contained in classes, which are not highly dependent on the underlying platform, you will be able to create a Class Library Project for each platform and link your files between the platform specific projects. Inside of the classes it contains you will use #if definitions to choose whether to use AndroidGameView or GameWindow and the same goes for other platform specific types. It will make the code ugly, but this is the alternative to PCL.
You could try to see how much of the OpenTK code compiles inside of a PCL and inject the platform specific stuff at runtime, but it will require considerably more work from you. However, it will make the code a lot more cleaner to look at.
To ease the file linking, you could make one of those Shared Projects and chuck in all of the logic in there.
Some more info about code sharing here: http://developer.xamarin.com/guides/cross-platform/application_fundamentals/building_cross_platform_applications/sharing_code_options/
Dependency injection: https://en.wikipedia.org/wiki/Dependency_injection

How to properly install OpenGL in VS2010?

I am trying install OpenGL on VS2010.
I use this tutorial.
And I get the following error:
Unable to start program 'C:\Users\s151310\Tutorial 0.3.8\frameworkD.lib'.
The specified file is an unrecognized or unsupported binary format
How can I fix this?
Actually don't have to install anything at all to start OpenGL development with Visual Studio. As long as you limit yourself to OpenGL-1.1 and core Win32 APIs everything is already in place for you.
However to get modern OpenGL features one must use the so called extension mechanism to load pointers to functions of newer versions – a tedious and uninteresting process. Hence extension loader wrappers have been developed.
Also creating a window and setting up a matching OpenGL context is laborous as well. So you want to use some framework for that two.
Extension loader wrappers and frameworks are 3rd party libraries that need to be installed separately.
Unable to start program 'C:\Users\s151310\Tutorial 0.3.8\frameworkD.lib
Why are you trying to execute a library file? This is the framework library that's supposed to be linked into your executables. So this raises the question: How did you setup your project, specifically which build options did you configure. Without that I can't give better advice.

How can I build a targetting pack for Portable Class Libraries?

I'm building some code with these portable class libraries at present.
I'm looking to target full .Net, WinRT Metro, Windows Phone, ... and then MonoTouch and MonoDroid. My experiments today show this can work - http://slodge.blogspot.co.uk/2012/04/experiments-with-portable-class.html
However, I have hit a fairly significant problem - MonoTouch and MonoDroid currently support these libraries in that you can consume PCLs as binary assemblies, but they don't allow linking between project files
e.g. I can reference MyLib.dll from a MonoDroid project, but I can't reference MyLib.csproj.
This is a problem as it means automated (resharper) refactoring doesn't work - and I seem to rely on this for most of my work!
I've seen that Microsoft publish targetting packs that allow you to extend class libraries, but I've not worked out where these install to or what they modify.
Here's the current Microsoft list: http://msdn.microsoft.com/en-us/hh487282.aspx
Does anyone have any knowledge about what these packs contain or how someone might make their own pack? If they're not too overly complex, then I would like to have a go at producing one for MonoTouch and/or MonoDroid.
This has come up a few times recently, so I wrote a blog post that should do what you want:
http://jpobst.blogspot.com/2012/04/mono-for-android-portable-libraries-in.html
Please let me know if have any issues!

Resources