How do I set the path to a DLL file in Visual Studio?

Go to project properties (Alt+F7) Under Debugging, look to the right There’s an Environment field. Add your relative path there (relative to vcproj folder) i.e. ..\some-framework\lib by appending PATH=%PATH%;$(ProjectDir)\some-framework\lib or prepending to the path PATH=C:\some-framework\lib;%PATH% Hit F5 (debug) again and it should work.

How to determine if a string is a number with C++?

The most efficient way would be just to iterate over the string until you find a non-digit character. If there are any non-digit characters, you can consider the string not a number. bool is_number(const std::string& s) { std::string::const_iterator it = s.begin(); while (it != s.end() && std::isdigit(*it)) ++it; return !s.empty() && it == s.end(); } … Read more

Which Visual C++ file types should be committed to version control?

Yes: cpp: source code filters: project file h: source code ico: resource rc: resource script rc2: resource script sln: project file txt: project element vcxproj: project file No: aps: last resource editor state exe: build result idb: build state ipch: build helper lastbuildstate: build helper lib: build result. Can be 3rd party log: build log … Read more

What does “#pragma comment” mean?

#pragma comment is a compiler directive which indicates Visual C++ to leave a comment in the generated object file. The comment can then be read by the linker when it processes object files. #pragma comment(lib, libname) tells the linker to add the ‘libname’ library to the list of library dependencies, as if you had added … Read more

Automatically add all files in a folder to a target using CMake?

As of CMake 3.1+ the developers strongly discourage users from using file(GLOB or file(GLOB_RECURSE to collect lists of source files. Note: We do not recommend using GLOB to collect a list of source files from your source tree. If no CMakeLists.txt file changes when a source is added or removed then the generated build system … Read more

fatal error LNK1112: module machine type ‘x64’ conflicts with target machine type ‘X86’

I wrote a blog entry about this, as I encountered this maddening problem, and finally yanked my system back into working order. These are the things to check, in this order: Check your properties options in your linker settings at: Properties > Configuration Properties > Linker > Advanced > Target Machine. Select MachineX64 if you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)