c - Building software in Visual Studio -


i'm spoiled because learned write software on osx , linux tooling straightforward , ides typically use external build system of heavy lifting. tried vs2015 , have code editor , ui isn't bad. wouldn't interface as qtcreator debugging support looks pretty good.

anyway, i'm working on game , want try using visual studio (and visual studio - i'm aware of cmake , premake) build project. problem it's not terribly simple project build - @ least not in visual studio.

it's written in standard c, no surprises there. have library (common.lib) , client application (mygame.exe). common.lib , mygame.exe use functionality libpng, glew, sdl2, , freetype, having problems 2 things: include paths , linker paths. can manually specify these in project settings, if want give project else work on? libraries installed in c:/oss may not be.

with 30 lines of autotools use pkg-config find right include paths , linker paths , link right libraries in, it's real hassle use on windows. standard way of configuring dependencies in visual studio? also, best way tell visual studio mygame.exe needs linked common.lib?

later in development process, feasible use visual studio run custom build steps say, embed glsl shaders application?

for defining link dependencies, there 3 ways:

  • the standard way of defining 'external' link dependencies in visual studio input them in project properties. if developing c project, in project->properties... linker->input->additional dependencies property. configure directory libraries in, done in linker->general->additional library directories. generally, make directories relative project, can relocate project, or have work other users getting source control different workspace mapping.
  • if compiling static libraries within same solution file, adding dependency between executable/dll , static library cause static library linked (by default) executable, not have modify settings. can done project->project dependencies....
  • you can use statements link libraries, example: #pragma comment(lib, "library.lib") within source code itself, cause linker try , link "library.lib". however, wouldn't recommend it, can obfuscate linking process.

as embedding glsl shaders, can embed them strings in .c/.cpp file, , have source file compiled, it's not example embedding resources. but, answer generally, can embed resources within application, creating resource file, , importing file wish. see here more information. can access them findresource , loadresource.

if you're looking somehow precompile shaders , embed them (as might directx hlsl), can make custom build commands this. in project->properties...custom build step - used on per-file basis. can create custom build rules, files of particular type (eg. *.glsl). see here more information on how that.

also, lots of people hate on visual studio. have learning curve, every other reasonably functional ide. if don't it, don't use it. said, have plenty of other options, on windows.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -