Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Thursday, September 24, 2009

Building Qt4 for Windows using MSVC 2008

  1. Make directories C:\Qt\src and C:\Qt\build (the build procedure really doesn't like fancy paths, so do use something this simple)
  2. Download and unzip Qt Open Source SDK to C:\Qt\src
  3. Copy C:\Qt\src\qt\mkspecs C:\Qt\build\
  4. Open your Visual Studio Command Prompt
  5. $ "bin\vcvars32.bat"
  6. $ cd C:\Qt\src
  7. $ bin\qtenv.bat
  8. $ cd qt\
  9. $ configure -opensource -platform win32-msvc2008 -prefix C:\Qt\build
  10. $ nmake
  11. $ nmake install
  12. set QTDIR=C:\Qt\build
note: Qt will hard-code the prefix path into it's binaries. It cannot be relocated in the file-system.
note: if you get link errors warning about inability to find MOC-related problems (mine was in WebCore), you may want to delete the mocinclude.tmp file (src/3rdparty/webkit/WebCore/tmp/moc/{debug,release}_shared/mocinclude.tmp).

Saturday, June 6, 2009

Why Windows is not yet ready for the Desktop

I don't spend my time telling other people which OS should or shouldn't suit their way of working. But it seems there are people who do, and like to get blog hits for it.

The problem with these "critiques" is always that the author is carrying around the self-serving assumption that their preferred OS embodies the only real way to organize a software ecosystem, and all others have inferior value. Moreover, since they are naturally only looking for a way to justify their existing pre-conclusion, they are often sadly misinformed about most of their "complaints", half of which are either entirely subjective, or just flat-out wrong.

And it is thus that I find myself moved enough to mock their contribution to the state of public discourse as follows (public service announcement: this is tongue-in-cheek parody):

Preface:

In this document we only discuss Windows deficiencies while everyone should keep in mind that there are areas where Windows has excelled other OSes.

A primary target of this comparison is Linux OS.

Windows major shortcomings and problems:

0. Premise: free and open software will stay indefinitely. Full stop. You may argue eternally, but free software is the ultimate disruptive technology, moving up from the low ground, replacing complicated and ill-fitting proprietary alternatives at every turn, such as web-browsers, e-mail clients, video players, office software, etc., which at one point cost money, but now most people find that they can no longer justify spending money to buy an upgrade for more "Clippy the Happy Assistant". Proprietary software will only be able to stay relevant by searching out ever more niche applications, or by massive expenditure on research in high-end applications for which it will take time for the ideas and algorithms to filter down to the greater community, and thus a brief window of profitability will remain. Software patents are nothing but a destructive force to retard innovation, and with more and more of the technology and legal communities realizing this basic fact, software patents are about to go away forever.

1. Security

1.1 History's greatest playground for malicious software. With unpatched machines on the internet taking only minutes to become infested with viruses, or become a slave bot for massive illegal spamming operations, Windows is a blight on the Internet's infrastructure.

1.2 Countless applications are released every year with obvious security holes. The programmers that make Windows applications are clearly some of the worst.

1.3 Microsoft has countless times avoided appropriate steps to secure the OS and limit the potential damage a compromised binary could cause. It has consistently either or added half-measures, out right refused to take necessary steps to ensure a safer computing environment for all users, for fear of making "Auntie Jo'" 10% more confused about the "1.3GHz hard drive" on her desk.

1.4 Every windows application I've ever installed messes with the Registry, places files about my hard drive which it never cleans up, installs icons, or worse surreptitiously installs spy- or ad-ware.

1.5 Any OS that regularly requires a wipe and reinstall to fix is beyond tolerance by any sane person.

1.6 A galore of software bugs across all applications. Just look into Vista, or call Microsoft tech support, pay exorbitant support fees, then wonder why some bugs are now ten years old with over several dozens of duplicates and no one is working on them.

2. User Interface

2.1 No consistent API. Win32? MFC? WinForms? WPF?

2.2 No scripting bindings for UI programming. No Python, Perl, Ruby, Java, etc.

2.3 Themeing and skinning support is laughable. Widget toolkit, display, rendering, input, and window managers, are all joined in a ridgid, monolithic blob, opaque to outside developers. Non-trivial changes to look and behaviour of the UI require either proprietary add-ons or third-party hacks; and even then most of your choices are hard-coded by Microsoft designers.

2.4 Lack of CLI (command line interface) errors for user applications (see clause 4.). All GUI applications should have a CLI errors presentation. Why on earth would you flash some crazy warning message to the user when you should be logging it to a file for a skilled technician to view instead of the poor unsuspecting end-user.

3. Interoperability

3.1 Windows has NO interoperability with non-Windows OSs. Installing Windows arrogantly destroys any previous OS boot-loader you may have had. Totally unable to read non-FAT or NTFS partitions.

3.2 Windows ships no other runtime environments except .NET. Has actively tried to disable or cripple competing platforms such as Netscape or Java.

3.3 Microsoft is in regular legal trouble for monopolistic and anti-competitive practices, which as a consumer of non-Microsoft products, means Microsoft considers me an enemy. Why own an OS that is constantly out to defeat you, from a vendor that requires massive anti-trust lawsuits to force it to simply not behave in an under-handed manner?

3.4 It should be possible to configure everything from the command line. Why should I give myself a work-place injury clicking everywhere with the mouse like a tweaking junkie in order to make a change that could be described succinctly in a line or two of text?

4. Drivers

4.1 Windows driver support is so abysmal, each individual device manufacturer must ship drivers with the device itself. If you have to reinstall windows, none of your devices will work until you individually download and install the latest versions from each vendor's website, potentially consuming many long frustrating hours.

4.2 Drivers often need to be installed, tweaked, or configured before they can even be used as intended. They often don't work "out of the box". Moreover, they never seem to be *just* drivers, there is always some application that gets installed without your consent which provides questionable value yet consumes resources and slows your computer down.

4.2 Drivers are one of the main sources of system instability (likely just behind viruses/malware). Poor quality drivers make Windows experience painful.

4.3 Windows has no means to reliably update drivers when critical updates have been made available for them.

4.4 A lot of Linux specific embedded devices do not have any Windows support. An argument that embedded device developers should make their device Windows compatible is silly since that way Windows won't ever gain even a traction of popularity among people who need source-level access to the OS. Why should I install an OS where my own hardware doesn't work?

5. Installing Applications

5.1 Very few Windows applications, by volume, are free or open source; which means you are totally beholden to application developer in ways that would never be allowed by law for makers of physical products. Happen to have your business critical data in a proprietary format when your license runs out? Lost your dongle just before the big presentation? Had to transfer your application to another computer because your laptop was stolen? Sorry to hear you just went out of business.

5.2 Windows has no regular time-based release cycle. You paid good money for a few features and a lot of bugs. It may be a few years from now when you can expect them truly fixed, but you can't count on it. And you'll have to pay again.

5.3 Windows has no central means of downloading new software, their dependencies, or upgrades. Each new application must be purchased from a physical store, or from each individual vendor's website. There is no dependency tracking (or worse no library sharing!), and updating for security, bug-fixes, or features is ad-hoc and entirely dependent on the whim of the vendor. Likely the vendor will use remote updating features to unethically sneak updates to your computer without your knowledge.

5.4 Windows comes almost barren on a fresh install. To get your machine back to a usable state, you must spend hours remembering what applications you had installed, and manually downloading and installing each one individually. With a reboot in between each install.

5.5 Windows applications need to reboot any time a new application or library is installed. 1991 called. They want their loading technology back. I hear DLL-hell isn't a problem any more though.

5.6 Microsoft enforces a great many intra-windows compatibility constraints to minimize the ever-present costs of portability, but it comes at the cost of inconsistent behaviour, buggy programs, and internal complexity that is slowing rotting Windows itself from the inside out.

5.7 Lack of hard-core Linux programs like grep/awk/GDB/valgrind/SystemTap/SELinux. Programmers just won't bother installing Windows until they can work for real.

6. Problems stemming from the fact that Windows isn't Linux

6.1 Ok I am officially tired of this game.

To be clear, I don't necessary truly believe all of the above, as unlike most people, I realize the world is full of complications and subtlety -- I'm just tired of hearing coming in the opposite direction, and had to vent lest my head explode from idiocy-overload.

Friday, January 16, 2009

Finally a work-related post -- about Windows?!

I decided to force myself to make a technology blog. Its because I have made a very important discovery.

For a long time I've been a linux user working in a world where windows is overly common. Luckily though, I have often been able to make the argument to my bosses that cross-platform development is important, and that free-software tools are high quality and save much time and effort.

What often stymied my noble efforts however, was the pain in the arse, not in making cross-platform code, which is a problem well attended to over the decades, but the trouble of getting something to build on all platforms.

You have autotools on the unix side, Visual Studio solution-files on the windows side, and well-meaning cmake in the middle, with a down-trodden, lonely, underused look on his schoolboy face.

This is issue is oppressing me as we speak at work, with us trying to integrate the powerful and flexible Telepathy messaging framework, and its companion libraries GStreamer and D-Bus. All of it portable C. All of it buried under mounds of steaming autotools.

For the past week we have been doing the slop-work of trying to reverse-engineer the intended build process codified in the dead languages that make up autotools, and re-implement them in cmake in the hopes that it might be accepted upstream, and one day be liberated from the shackles of 1987.

It's not Happy.

And neither was I until I stumbled across this little gem. Long story short: Fedora 11 will ship with a fully functional windows cross compiler.


Autoconf-based programs can generally be cross-compiled by doing:

yum install mingw32-*
./configure --host=i686-pc-mingw32
make


Project page here.

That however means that the binary will not be build with VC++, rather GCC, which may cause some windows programmers to cringe. I'd like to learn just how much performance is really lost. I also wonder what sort of ABI boogie-men are lurking.

To summarize

1. Portable code - Done
2. Cross-platform build system (with no need for windows license!!) - Check
3. Broad binary compatibility - Future is Hazy