LNK2038: mismatch detected for ‘RuntimeLibrary’: value ‘MT_StaticRelease’ doesn’t match value ‘MD_DynamicRelease’ in file.obj

This error can occur when you are statically linking your project with a library (typically a file with .lib extension) but the linker setting in your Visual Studio project are set to dynamically link (meaning the link will occur during runtime, usually with a .dll file). To define that you need the project to use … Read more

How do I set a path in Visual Studio?

Search MSDN for “How to: Set Environment Variables for Projects”. (It’s Project>Properties>Configuration Properties>Debugging “Environment” and “Merge Environment” properties for those who are in a rush.) The syntax is NAME=VALUE and macros can be used (for example, $(OutDir)). For example, to prepend C:\Windows\Temp to the PATH: PATH=C:\WINDOWS\Temp;%PATH% Similarly, to append $(TargetDir)\DLLS to the PATH: PATH=%PATH%;$(TargetDir)\DLLS

How to add additional libraries to Visual Studio project?

For Visual Studio you’ll want to right click on your project in the solution explorer and then click on Properties. Next open Configuration Properties and then Linker. Now you want to add the folder you have the Allegro libraries in to Additional Library Directories, Linker -> Input you’ll add the actual library files under Additional … Read more

How to call C++ function from C?

You need to create a C API for exposing the functionality of your C++ code. Basically, you will need to write C++ code that is declared extern “C” and that has a pure C API (not using classes, for example) that wraps the C++ library. Then you use the pure C wrapper library that you’ve … Read more