The Definitive C++ Book Guide and List

http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list

Advertisements
The Definitive C++ Book Guide and List

CreateWindow/CreateWindowEx Win32 function behaviors on Windows 7/Visual Studio 2012 differently from Windows 7/Visual Studio 2010.

This happened to me when I migrated my Visual Studio 2010 project files to Visual Studio 2012. The same code didn’t work in the same way it used to work with Visual Studio 2010. I found that if I change the tool set to v110 (Visual Studio 2010), the code works ok. I also found, however, that the target .NET framework is always 4.0 regardless the tool set version.

To my gut feeling, the new Visual Studio uses a different Windows SDK/.Net Framework which is targeted to Windows 8.

I tried to change the target framework by modifying the existing project files as well as creating new ones with .Net Framework 4.5 selected. I referred to this article, but could not find the tag instructed to modify. Instead I modified the following line, but it didn’t help.

<Project DefaultTargets=”Build” ToolsVersion=”4.5″ xmlns=”http://schemas.microsoft.com/developer/msbuild/2003″&gt; …

When I tried to create a new project with .NET Framework 4.5, it didn’t really use 4.5, but 4.0 according to the property page. Maybe .NET Framework 4.5 is not installed in my machine, and Visual Studio 2012 should work with 4.5… Also refer to this article, which seems the most relevant to my problem and may help.

In conclusion, just fall back to the old 2010 tool chain (v100) to work around this problem.

SVN cleanup fails

When trying to update your local repository, if the names of some files to be created are not permitted on an operating system, svn complaints with a message something like:

X:\workspace>svn up
...    ...
A    some\directory\build\Project.build\Release\Project.build\Objects-normal\i386\MainWindow.o~>
svn: E720123: Can't move 'X:\workspace\.svn\tmp\svn-XXXXXXXX' to 'X:\workspace\some\directory\build\Project.build\Release\Project.build\Objects-normal\i386\MainWindow.o~>': The filename, directory name, or volume label syntax is incorrect.

Trying yet to update the repository gives you:

X:\workspace>svn up
svn: E155037: Previous operation has not finished; run 'cleanup' if it was interrupted

And trying to cleaning up:

X:\workspace>svn cleanup
svn: E720123: Can't move 'X:\workspace\.svn\tmp\svn-XXXXXXXX' to 'X:\workspace\some\directory\build\Project.build\Release\Project.build\Objects-normal\i386\MainWindow.o~>': The filename, directory name, or volume label syntax is incorrect.

Well, again:

X:\workspace>svn up
svn: E155037: Previous operation has not finished; run 'cleanup' if it was interrupted

And so on and so forth.

This happens, for instance, when you (sure, unintentionally) included an Xcode build directory to your svn repository and try to check it out on Windows, which will not allow some characters to be used in a file name–‘>’ in the example above. SVN doesn’t resolve this problem: the unaccomplished operation to check out a file with unallowed name is still at svn’s private “to-do” list, which should be done prior to any other operations through “svn cleanup”, which in essence flush all unfinished operations. This, however, makes an error as it tries to do something not achievable.

Since SVN 1.7, the repository is managed with a centralized SQLite data base instead of numerous, small chunks of files inside .svn directory within each subdirectory. The data base is located at .svn directory at your local copy’s top level directory, and named wc.db.

Open wc.db using sqlite3, a command line shell of SQLite, which can be downloaded from http://www.sqlite.org.

X:\workspace>sqlite3 .svn\wc.db

The “to-do” list is stored in a table called WORK_QUEUE:

sqlite> select * from WORK_QUEUE;

which might look like:

XXXX|(file-install 142 some/directory/build/Project.build/Release/Project.build/Objects-normal/i386/MainWindow.o~> 1 0 1 1)
XXXX|(file-install 142 some/directory/build/Project.build/Release/Project.build/Objects-normal/i386/MainWindow.o~? 1 0 1 1)
XXXX|(file-install 142 some/directory/build/Project.build/Release/Project.build/Objects-normal/i386/MainWindow.o~$ 1 0 1 1)
...

Remove all the entries related to the file name problem (here just I remove all):

sqlite> delete from WORK_QUEUE;
sqlite> .quit

“svn cleanup” should work now:

X:\workspace>svn cleanup

Before update, remove the files that caused this problem, or better the build directory containing the files, from the repository to avoid running into the same problem again:

X:\workspace>svn --force rm some\directory\build
X:\workspace>svn up

Reference: http://subversion.1072662.n5.nabble.com/quot-svn-cleanup-quot-fails-because-it-can-t-find-a-temp-file-td157577.html

SVN cleanup fails