Build Succeeded, but no .lib file gets created

Open the Project Properties (right-click the project in Solution Explorer, select ‘Properties’). Under ‘Librarian’, check ‘Output File’ – that’s where the output should go. If this looks right, try dir /s *.lib in a suitable subdirectory for your project, to see if you can locate the output library by date and time. If you still … Read more

fopen deprecated warning

It looks like Microsoft has deprecated lots of calls which use buffers to improve code security. However, the solutions they’re providing aren’t portable. Anyway, if you aren’t interested in using the secure version of their calls (like fopen_s), you need to place a definition of _CRT_SECURE_NO_DEPRECATE before your included header files. For example: #define _CRT_SECURE_NO_DEPRECATE … Read more

Disabling Warnings generated via _CRT_SECURE_NO_DEPRECATE

If you don’t want to pollute your source code (after all this warning presents only with Microsoft compiler), add _CRT_SECURE_NO_WARNINGS symbol to your project settings via “Project”->”Properties”->”Configuration properties”->”C/C++”->”Preprocessor”->”Preprocessor definitions”. Also you can define it just before you include a header file which generates this warning. You should add something like this #ifdef _MSC_VER #define _CRT_SECURE_NO_WARNINGS … Read more

Visual Studio: can I copy a project’s properties to use in another project?

Try using Property Sheets. These can create a single properties file that can be inherited by multiple projects. Use “View > Other Windows > Property Manager” to bring up the Property Manager. It will show your projects and configurations. Right click a configuration, and select “Add New Project Property Sheet…”. You can name it, and … Read more

How to generate an import library (LIB-file) from a DLL?

You can generate a DEF file using dumpbin /exports: echo LIBRARY SQLITE3 > sqlite3.def echo EXPORTS >> sqlite3.def for /f “skip=19 tokens=4” %A in (‘dumpbin /exports sqlite3.dll’) do echo %A >> sqlite3.def The librarian can use this DEF file to generate the LIB: lib /def:sqlite3.def /out:sqlite3.lib /machine:x86 All of the filenames (sqlite3.dll, sqlite3.def, etc.) should … Read more

Why is Visual C++ lacking refactor functionality?

The syntax and semantics of C++ make it incredibly difficult to correctly implement refactoring functionality. It’s possible to implement something relatively simple to cover 90% of the cases, but in the remaining 10% of cases that simple solution will horribly break your code by changing things you never wanted to change. Read http://yosefk.com/c++fqa/defective.html#defect-8 for a … Read more