Jump to content
  • Advertisement
Sign in to follow this  
Ramel Mammo

Intro to Game Programming With DirectX 11 Effects library

This topic is 888 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Not a while back, I purchased Frank Luna's Introduction to 3D Game Programming with DirectX 11. Today, I decided to start reading it to get into 3D programming, and I encountered the deprecated effects library problem (or at least, I'm guessing it's that). The first few pages are about setting up a demo project, and when I finally followed all the steps and built the program, I was met with 9 build errors, 7 of them being from the Effects11.lib file (that I got from the book's disk containing the source code). Below is a screenshot of the error log.  I would love it if someone points me in the right direction as to how to set up the environment so I can run all the following projects without the effects library causing trouble. 

 

Extra Info: 

- I have the June 2010 SDK all set up

- I use Visual Studio 2013

Share this post


Link to post
Share on other sites
Advertisement
I'm not familiar with this book, but I can see a few problems straight away:
- LNK2038 indicates that effects11.lib was compiled with a different version of the compiler than the rest of your code.
- LNK2019 indicates that you aren't linking to one of the actual Direct3D libraries.

So: make sure you're linking to all the libraries you need, and make sure you have a version of effects11.lib that's built with VS 2013 (_MSC_VER=1800), since the one you have was compiled with Visual Studio 2010 (_MSC_VER=1600). You may need to compile the library yourself from source. I believe you can find the source code and updated binaries somewhere on this page. Edited by Oberon_Command

Share this post


Link to post
Share on other sites

I fixed the LNK2019 problem, and as for LNK2038, downloading VS2010 (I read somewhere that usingcVS2010 will solve some of the problems within the book) and opening the project file directly from the disc provided with the book seems to fix it (initially, for the demo, the author instructed us to copy the contents of the demo project and paste it into a blank Win32 project directory and then adding the items from there, instead of using the "Add Project/Solution" button). I'm not sure if this solves the deprecated effects library problem, but I did open another project just to check and it works fine as well. 

Share this post


Link to post
Share on other sites
If it doesn't, you can build the effects lib (both release and debug) in your own visual studio environment. This worked for me, I'm currently working on chapter 12 :)

Share this post


Link to post
Share on other sites

Cozzie, would you mind telling me how you would do that? Or perhaps link me to a tutorial that explains it? I'm not the best with VS (sorry for any inconvenience). 

Share this post


Link to post
Share on other sites

The compiler versions are wrong. You have two options.

You can rebuild the effects libraries using your current compiler. https://github.com/Microsoft/FX11

Or you can install the windows 7 sdk. Which theoretically -should- work. Maybe.

 

Personally though, I sincerely suggest that you get familiar with not working with the effects library. It's ok to use it to help you learn the basics of the DirectX library. But when you're comfortable enough... drop that sucker immediately.

There's not much control that goes into it, and it becomes a huge hassle with larger or more complex projects (By that... I mean something as simple as a 3D maze game, or a 2D platformer). Directx's documentation does an absolutely horrible job at informing you about it's own API's.

But Rastertek is pretty good about teaching you how to build your own passes and such. Also a dive into some open source projects will teach you a thing or two.

Share this post


Link to post
Share on other sites
It's a decision you have to make.
In my case learning d3d11 was my primary focus and difficult enough on it's own, without replacing effects11 by using shaders "directly".

I prefer to finish the book with effects, then when I'm done I probably feel confident enough to replace effects11 stuff. Otherwise the book logic also falls a bit apart.

When it comes to changing SDK's, my advice is: don't. If you have a fully working setup, and only effects11 doesn't work, just fix that. Adding older SDK versions gave me a lot of irritation and negative energy.

Share this post


Link to post
Share on other sites

Yeah, I won't abandon the library just yet since I barely know anything of 3D graphics :P (just got through the math section of the book, and now onto DirectX Initialization ) , although after reading this book i'll follow your advice. Would you guys mind telling me how I would rebuild FX11 with Visual Studio? Like I said, I'm not the best with VS.

Share this post


Link to post
Share on other sites

You need to build FX11 lib in VS2013, then replace the book's Effects11.lib(Release) and Effects11d.lib(Debug).

In VS, build a lib is a easy thing:

 

1.Create a new empty Win32 Console Application(Choose static lib as app's type), then copy your .h , .inl, .cpp files( Those files are in ..\Microsoft DirectX SDK (June 2010)\Samples\C++\Effects11, or you can download from github(Tangletail has given the link) ) into your project's folder and add them into project in VS.

 

2.Note that these has two folders named Binary, Inc. You also need to copy them into your project's folder. And in project's properties, modify C/C++--General--additional include directories, add .\Binary, .\Inc.

 

3.And in project's properties --- VC++ directories, you need to add "$(DXSDK_DIR)Include" into include directory.

DXSDK_DIR is like a marco that point to your SDK's directory.

 

4.Then build it in debug and release mode, it's OK.

(Maybe it has other options should be modified before compile, you could see details in SDK's Effects11 project property, but I test my way doesn't matter in learning this book, at least before Chapter 19 where I'm currently woking on).

 

Sorry for my poor English, hope it can help you.

Edited by Drimoon

Share this post


Link to post
Share on other sites

Hmm, I did that and replaced the Effects.lib files in the Common folder provided by the book and now i'm getting another error: 

 

 

 

 

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!