"Winapifamily.H: No Such File or Directory" When Compiling Sdl in Code::Blocks

fatal error: dxgi.h: No such file or directory. Building SDL 2 with biicode

SDl2 since 2.0.2 do not support mingw32. There is no any advantage of using MinGW32 instead mingw-w64. So probably the best way to solve the sdl2 compilation issue is to upgrade mingw.

At biicode you'll find older versions of sdl2 (2.0.1) that do not make use of dxgi directly.

The Mingw64 works on Windows 32 as in 64

proplem with sdl setup windows

I actually just set up SDL2 on Code::Blocks myself a day or two ago. Since I suspect your environment might not be configured correctly, here's how I did it, roughly following the tutorial here:

  1. Download both a runtime binary and a development library from the SDL2 download page. Make sure the runtime binary is appropriate for your apps - in other words, if you're building 32-bit executables, get the 32-bit SDL, and if you're building 64-bit binaries, get the 64-bit SDL.
  2. Unpack the development library into a folder of your choice, and do the same with the runtime binary. Remember what paths you used for these. I used "D:\Programming\C++\SDL\SDL2.dll" for my SDL runtime binary and "D:\Programming\C++\SDL\SDL2-2.0.3" for my development library.
  3. Open your project in Code::Blocks.
  4. Go to the Settings menu and click "Compiler..."
  5. Switch to the "Search Directories" tab, then the "Compiler" subtab.
  6. Click "Add" and browse to the folder for your development library. You'll need to pick whether you're developing for 32-bit apps or 64-bit apps here: if you're going for 32-bit, you'll want to add "\i686-w64-mingw32\include" ("D:\Programming\C++\SDL\SDL2-2.0.3\i686-w64-mingw32\include") and for 64-bit apps you'll want to add "\x86_64-w64-mingw32\include" ("D:\Programming\C++\SDL\SDL2-2.0.3\x86_64-w64-mingw32\include").
  7. Go to the "Linker" tab right next to the "Compiler" tab.
  8. Click "Add" and browse to your the folder for your development library. Once again, based on whether you're going for a 32-bit app or a 64-bit app, add "\i686-w64-mingw32\lib" ("D:\Programming\C++\SDL\SDL2-2.0.3\i686-w64-mingw32\lib") or "\x86_64-w64-mingw32\lib" ("D:\Programming\C++\SDL\SDL2-2.0.3\x86_64-w64-mingw32\lib") respectively.
  9. Take the SDL runtime binary ("D:\Programming\C++\SDL\SDL2.dll") and copy & paste it into the folder your compiled EXE will end up in. Since you're using Code::Blocks, this will usually be %PROJECT_FOLDER%\Bin\%RELEASEMODE%, where %PROJECT_FOLDER% is the path to your project and %RELEASEMODE% is Debug or Release.
  10. Build your project and verify that it works.

You can also set this up on a per-project basis rather than a global basis if you want. Just go into the Project menu and click "Build options..." instead of the Settings menu in step 4.

If SDL still doesn't work after this, I'd suggest getting an updated MinGW and making sure Code::Blocks is properly set up to use it.

Errors in Upgrading VC++ project from VS 2010 to VS2012

I have fixed this problem using the hotfix mentioned in the edit (Update 4, VS2012). Additionally, there is some circular dependency problems going on in the application related to OpenCV which has nothing to do with this question, so by using the hotfix I believe I have uncovered a broader issue with openCV header files which I can resolve in a straightforward manner.

No such file or directory error for hashlib++ library in CodeBlocks

Ok, so I figured out what the issue was. By section 3.1,

  1. Go to your project in the "Management" tab, and right-click the project you are working on. If you cannot see that section go to View > Manager, or press Shift + F2.
  2. After right-clicking, select "add files..." and simply find and add the .h file you will be using. After it should show up in the "Management" section in a folder called "Headers".
  3. Type in appropriate #include line in your code. I downloaded the entire hashlib2plus folder and put it in my project folder, so mine looked like

    #include "hashlib2plus/trunk/src/hashlibpp.h"

Hope this resolves any issues in the future!



Related Topics



Leave a reply



Submit