How do I point CodeBlocks and Visual Studio Express 2008-2012 to custom Include and Lib directories?

StackOverflow https://stackoverflow.com/questions/21483726

Pregunta

This is a tricky question... I have put together a compilation of DirectX, OpenGL and Windows SDK Include and Lib files into a single directory called, "AllCode." Inside that are Lib and Lib/x64 Directories, and an Include Directory. Essentially everything from DirectX 7 to now is in there. You can check out the page I have this on here: http://hi-techheadache.blogspot.com/p/blog-page.html

The point of this is to make it easy to compile and run code from any book. I want CodeBlocks and Visual Studio Express 2008-2012 to be pointed, as it were, to my AllCode directory, so that anytime it needs to refer to any of those files it can. I don't want any errors from missing files! I want to code something from a book like, "Programming A Multiplayer FPS in DirectX" by Vaughan Young and expect that it will compile, link and run without issue! How do I set each IDE up for this?

BTW I'm on a Windows 7 64-bit machine. All drivers updated and installed. Running the latest version of CodeBlocks, Visual Studio Express 2010 SP1 and Visual Studio Express 2012.

¿Fue útil?

Solución

You can create an empty project that specifies the required settings. You want to specify include directories, and add libraries to be passed to the linker. You can save the project somewhere, and then make a new copy of it every time you need to start a new project. You could even include some boiler-plate code if appropriate.

Certainly on Visual Studio you can take this approach further and convert the project into a fully fledged template that appears in the new project dialog: http://msdn.microsoft.com/en-us/library/vstudio/s365byhx(v=vs.100).aspx. I expect that CodeBlocks has similar functionality.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top