Monday, October 5, 2015

Cleaning Debug and release folders in visual studio solutions / projects

Either you need to clean these folders to save space,  make sure that your projects are clean rebuilt, or you have the nasty error :

fatal error C1083: cannot open compiler generated file: 'xxxxxx.xxx': permission denied

 

Searching the internet will give you some results from msdn or stackoverflow , that will mostly work like :

 

MSDN solution .

 

StackOverflow 

 

but the one that worked for me is a small C++ project :

Clean Visual Studio Workspaces

 

from there download the source files and build the project and use it directly to clean all these nasty folders

 

Tuesday, May 26, 2015

fatal error C1083: Cannot open precompiled header file: 'Debug\xxxxx.pch': No such file or directory

This error lost me a lot of time but fortunatly a wise guy at stackoverflow made an extensive explanation on how to solve it, the original thread is at this link :
how-to-fix-pch-file-missing-on-build

The whole problem lies in some header files needs to be already compiled so your compilation goes through. and there is some strategy for handling header files that must be precompiled as Jive Dadson explains in his answer :

  1. Right-click on your project in the Solution Explorer.
  2. Click Properties at the bottom of the drop-down menu.
  3. At the top left of the Properties Pages, select All Configurations from the drop-down menu.
  4. Open the C/C++ tree and select Precompiled Headers
  5. Precompiled Header: Select Use (/Yu)
  6. Fill in the Precompiled Header File field. Standard is stdafx.h
  7. Click Okay
  8. If you do not have stdafx.h in your Header Files put it there. Edit it to #include all the headers you want precompiled.
  9. Put a file named stdafx.cpp into your project. Put #include "stdafx.h" at the top of it, and nothing else.
  10. Right-click on stdafx.cpp in Solution Explorer. Select Properties and All configurations again as in step 4 ...
  11. ... but this time select Precompiled Header Create (/Yc). This will only bind to the one file stdafx.cpp.
  12. Put #include "stdafx.h" at the very top of all your source files. (Unix or cygwin users: find . -name "*.cpp" | xargs -n1 sed -i '1s/^/#include "stdafx.h"\n/')
Lucky 13. Cross your fingers and hit Build.


and this did all the magic for me :)

Tuesday, February 24, 2015

How to download all files recursively from HTTP folders:



Many times we are faced by the problem of downloading a folder listed by apache or IIS on the web, and we have to download the files one by one, or at best case go to each folder and download all links with a tool like downThemAll or FlashGot, which will download the files in a folder but not in sub folders.
a tip at this page :
https://bmwieczorek.wordpress.com/2008/10/01/wget-recursively-download-all-files-from-certain-directory-listed-by-apache/

shows how you can use a command line application named Wget to accomplish this.

Example: recursively download all the files that are in the ‘ddd’  folder for the url ‘http://hostname/aaa/bbb/ccc/ddd/;
Solution:
wget -r -np -nH –cut-dirs=3 -R index.html http://hostname/aaa/bbb/ccc/ddd/
Explanation:
It will download all files and subfolders in ddd directory:
recursively (-r),
not going to upper directories, like ccc/… (-np),
not saving files to hostname folder (-nH),
but to ddd by omitting first 3 folders aaa, bbb, ccc (–cut-dirs=3),
excluding index.html files (-R index.html)

In addition you may want to use a destination folder with the option
-P destDir
where destDir is your destination folder

you can download A GUI for this tool from here:
https://sites.google.com/site/visualwget/a-download-manager-gui-based-on-wget-for-windows

but actually the GUI tool didn't work for me and I ended using the wget.exe file used by this tool from the command line as explained above.