Win32 odyssey: who needs documentation?

Feb 14 2008

Dur­ing my cod­ing adven­tures, I have just found myself hav­ing to port an exist­ing Win32 appli­ca­tion to CMake. After writ­ing a mere 283 lines CMakeLists.txt file, and get­ting the appli­ca­tion suc­cess­fully com­pile, I fired it up to see if it worked, of course. I found it fail­ing when doing a WSAA­sync­S­e­lect, and fail­ing there didn’t seem to make any sense. So, to get to the point, I decided I’d just care­fully com­pare the compiler’s options gen­er­ated from CMake with the ones that were in the orig­i­nal Visual Stu­dio project file. After find­ing the dif­fer­ence, I decided I was gonna learn what those flags meant, so I googled for “visual c++ com­piler flags” and guess what? Noth­ing use­ful. The right string to google would be “visual c++ com­piler options”. But before get­ting to it, I had to unsuc­cess­fully go thru “visual stu­dio com­piler options”. You’d think that would cut it, right? Since “visual c++ com­piler options” did it. But, sur­pringly, “visual stu­dio com­piler flags” did actu­ally find what I wanted. Inter­est­ing combination.

I don’t really feel like blam­ing Google on this. Repro­duc­ing the same search pat­tern in the inter­nal Help func­tion of Microsoft Visual Stu­dio gave me the same success/no-success scheme. Besides, the whole point-and-click pro­ce­dure is a ter­ri­bly uncom­fort­able expe­ri­ence. Not only I have to get my hands off my key­board (inher­ently a waste of time), but also do I have to (mind: have to) wan­der my mouse around for a while to get to the information.

So, I won­dered, is there an alter­na­tive? I went to my rxvt ter­mi­nal emu­la­tor (which I run through Cyg­win, can’t really be both­ered with using the native Win­dows Ter­mi­nal), and tried to get some help from cl.exe. No luck. After some try-and-fail recur­sion, the least use­less thing I would find was cl.exe -help which would give me 106 (one hun­dred and six!) lines of doc­u­men­ta­tion. Wow, impres­sive, isn’t it? Com­par­ing, gcc’s man­ual page is 7820 lines, as for the lat­est stable.

Tags:

2 responses so far

  1. Well that’s just silly. It sounds to me like you’re upset because you don’t know how to use Win­dows, rather than some­thing being intrin­si­cally wrong with Win­dows itself.

    For the sake of argu­ment, I assumed your prob­lem with the WSA* call was from not prop­erly link­ing in the ws2_32.lib. Whether or not that was the case, I found a solu­tion to that in no more than 2 steps know­ing noth­ing more than cl is the com­piler. Search­ing my local copy of MSDN for cl offers “Com­piler Options (C++)” as its first sug­ges­tion for what you’re look­ing for. Seems like a pretty good sug­ges­tion to me. A quick find on the sub­se­quent page led to me to the cor­rect flag.

    Fur­ther, I did all of this with­out ever tak­ing my hand off the key­board. 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 ter­mi­nal wasn’t all ready open.

  2. look­ing for­ward for more infor­ma­tion about this. thanks for shar­ing. Eugene

Leave a Reply