Win32 odyssey: who needs documentation?
During my coding adventures, I have just found myself having to port an existing Win32 application to CMake. After writing a mere 283 lines CMakeLists.txt file, and getting the application successfully compile, I fired it up to see if it worked, of course. I found it failing when doing a WSAAsyncSelect, and failing there didn’t seem to make any sense. So, to get to the point, I decided I’d just carefully compare the compiler’s options generated from CMake with the ones that were in the original Visual Studio project file. After finding the difference, I decided I was gonna learn what those flags meant, so I googled for “visual c++ compiler flags” and guess what? Nothing useful. The right string to google would be “visual c++ compiler options”. But before getting to it, I had to unsuccessfully go thru “visual studio compiler options”. You’d think that would cut it, right? Since “visual c++ compiler options” did it. But, surpringly, “visual studio compiler flags” did actually find what I wanted. Interesting combination.
I don’t really feel like blaming Google on this. Reproducing the same search pattern in the internal Help function of Microsoft Visual Studio gave me the same success/no-success scheme. Besides, the whole point-and-click procedure is a terribly uncomfortable experience. Not only I have to get my hands off my keyboard (inherently a waste of time), but also do I have to (mind: have to) wander my mouse around for a while to get to the information.
So, I wondered, is there an alternative? I went to my rxvt terminal emulator (which I run through Cygwin, can’t really be bothered with using the native Windows Terminal), and tried to get some help from cl.exe. No luck. After some try-and-fail recursion, the least useless thing I would find was cl.exe -help which would give me 106 (one hundred and six!) lines of documentation. Wow, impressive, isn’t it? Comparing, gcc’s manual page is 7820 lines, as for the latest stable.
Related posts:
2 Comments »
RSS feed for comments on this post. TrackBack URI



Well that’s just silly. It sounds to me like you’re upset because you don’t know how to use Windows, rather than something being intrinsically wrong with Windows itself.
For the sake of argument, I assumed your problem with the WSA* call was from not properly linking in the ws2_32.lib. Whether or not that was the case, I found a solution to that in no more than 2 steps knowing nothing more than cl is the compiler. Searching my local copy of MSDN for cl offers “Compiler Options (C++)” as its first suggestion for what you’re looking for. Seems like a pretty good suggestion to me. A quick find on the subsequent page led to me to the correct flag.
Further, I did all of this without ever taking my hand off the keyboard. In fact, the machine I did this from doesn’t have a mouse hooked up to it. And I agree that using a mouse does result in a time waste. But AFAIK, to do these same steps using Fluxbox would require me to use the mouse to load MSDN if a terminal wasn’t all ready open.
Comment by John — October 19, 2008 @ 12:23 am
looking forward for more information about this. thanks for sharing. Eugene
Comment by Eugene — October 22, 2008 @ 8:00 pm