Visual Studio is designed to be used only one machine/HDD : problems the precompiler header brings

Actually this is general design flaw of MS Windows.
Have you ever though situation where you install some application programs to a disk other than C: drive? Then did you try unmounting it and mounting it on a different computer as anything else than C:? Then you will have problems. Your applicaiton programs would not be recognized by the Windows on the “different” computer, if the program is heavily depends on information in registry and location of the program files.

It is main reason I prefer Mac to Windows. Windows is not flexible.

However, let’s focus on development side here.
Let’s assume that you have worked on a office computer, and take the source codes to home and work from home.
You don’t change any source codes, but when you try to debug it, Visual Studio suddenly tries rebuilding your project. To make things worse, it will spit out lots of error messages.

1>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\afxusertool.h(23) : error C2011: ‘CUserTool’ : ‘class’ type redefinition
1> c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxusertool.h(23) : see declaration of ‘CUserTool’
1>c:\program files (x86)\microsoft visual studio 9.0\vc\atlmfc\include\afxusertoolsmanager.h(24) : error C2011: ‘CUserToolsManager’ : ‘class’ type redefinition
1> c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxusertoolsmanager.h(24) : see declaration of ‘CUserToolsManager’

Why does this happen? If you check the messages carefully, you will find out that VS thinks that the same symbols are defined already in a location which is for your office computer. In this case, I worked with 64bit Windows at home and 32bit Windows at work.

How to solve this problem? Just clean the project and build it again. If you clean the project, it will also remove precompiled header. then it will forget all the information which are for your office computer.

In the example above, it complaint with files which were from MFC. With the same reason, if your source codes are on C: but you copy them to an external HDD and build those there, it will also complain with similar messages.

So, Visual Studio is also designed with “All files on a same HDD, same directory name” in mind. Actually most of end users even don’t make their HDD partitioned. Even many programmers don’t make HDD partitioned. They will not know about this problem. However, sophisticated users and programmers will notice such problems.

Although Windows is very powerful OS, it is still designed for simple home computer model in mind.

The Mac users’ usage pattern is different. They copy programs and any files to external HDDs and mount it on their friends’ computers, their own computers, and so on. Without any problems like the one described above, they just can use their programs without any such stupid problems.

I don’t understand why MS doesn’t change their OS in terms of this usage pattern. Probably it is because most Windows users don’t complain and don’t recognize the issue, or that part is not really critical in making money, or something else.

MFC Feature Pack also shows different problems. First it was not designed by MS, but adopted by MS. However, classes defined in MFC Feature pack don’t work well with other MFC classes. You will end up with customizing those for your necessity. MS even didn’t put good documentation about them. And they seem to relay on community for filling up their document. Probably they laid off lots of technical writers and tries to get help from infinite number of Huxley monkeys inspired by Wikipedia.
IMHO, this is very silly idea. As a responsible originator of MFC, they should provide good amount of explanation at first. Then they can get help from community if they need more.

I’m OK with MS products usually, but their products lack spirit.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: