fatal error LNK1104: cannot open file ‘kernel32.lib’

Check the VC++ directories, in VS 2010 these can be found in your project properties. Check whether $(WindowsSdkDir)\lib is included in the directories list, if not, manually add it. If you’re building for X64 platform, you should select X64 from the “Platform” ComboBox, and make sure that $(WindowsSdkDir)\lib\x64 is included in the directories list.

need to call a function at periodic time intervals in c++

To complete the question, the code from @user534498 can be easily adapted to have the periodic tick interval. It’s just needed to determinate the next start time point at the beginning of the timer thread loop and sleep_until that time point after executing the function. #include <iostream> #include <chrono> #include <thread> #include <functional> void timer_start(std::function<void(void)> … Read more

msbuild, how to set environment variables?

The coded task can be put right at the project file since MSBuild v4.0. Like this: <UsingTask TaskName=”SetEnvironmentVariableTask” TaskFactory=”CodeTaskFactory” AssemblyFile=”$(MSBuildToolsPath)\Microsoft.Build.Tasks.v$(MSBuildToolsVersion).dll”> <ParameterGroup> <Name ParameterType=”System.String” Required=”true” /> <Value ParameterType=”System.String” Required=”true” /> </ParameterGroup> <Task> <Using Namespace=”System” /> <Code Type=”Fragment” Language=”cs”> <![CDATA[ Environment.SetEnvironmentVariable(Name, Value); ]]> </Code> </Task> </UsingTask> Note that in MSBuild 14+, the AssemblyFile reference should be just: … Read more

Why is std::weak_ptr::expired optimized away?

Your program is incorrect; the shared-ownership pointer facilities are not intended to be used for synchronization. [intro.multithread]/24: The implementation may assume that any thread will eventually do one of the following: — terminate, — make a call to a library I/O function, — access or modify a volatile object, or — perform a synchronization operation … Read more

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