Building zlib 1.2.5 on windows

To build zlib on windows I did the following:

  1. Opened up a windows cmd prompt and ran vsvars32.bat from C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools (You may need to change this depending on which version of Visual Studio you may have)
  2. Ran nmake -f win32/Makefile.msc. At this point I ran into a LNK2001 error with _inflate_fast being unresolved
  3. Editted Makefile.msc to add the inffast.obj to the OBJS target per the hint given at here Chinese instructions to build zlib on Windows
  4. Reran nmake -f win32/Makefile.msc. This time it worked.

Edit: Justin in the comments pointed out a better way to resolve this issue:

There is a facility in the Makefile that lets you chose if you want the regular inffast, or one that was written in assembler (there is a 32-bit of 64-bit version).
Instead of editing the Makefile, you can instead use
nmame -f win32/Makefile.msc OBJA=inffast.obj
or instead of using inffast.obj, you can pick on of the assembler built ones

Emachines M5414 CMOS (Bios) Battery Replacement

I recently had to replace the CMOS battery for an Emachines M5414 for a relative. The battery is in a rather hard to reach area, but instructions given at Emachines M53XX disassembly instructions give a detailed breakdown of how to disassemble the machine. The M53XX has a slightly different layout than the M5414, but the instructions are similar enough that I was able to follow them 90% of the way. Two things of note though – when removing the hotkeys panel, a spudger comes in quite handy in unlatching the panel. Credit cards cut into thin strips make great spudgers. In addition, be very careful when removing the trackpad cable from the motherboard, the latches are very delicate and hard to reach. A slight push into the side is all that is needed to lift the plastic piece up (don’t try to completely remove it) at which point, the cable should come up easily.

The CMOS battery used in M5414 is indeed a Maxell CR1220 battery, and it’s a simple replacement once the entire top assembly of the laptop is removed.

Visual Studio Build Enviroment Variables (aka Property Sheet User Macro)

Here’s a howto for setting build environment variables within Visual Studio itself. Given that I’ve seen plenty of projects that used system wide environment variables for project level settings, I suspect this will be of use to other developers as well.

  1. From the menu: View > Other Windows > Property manager.
  2. Right click on Property Manager, add Property Sheet.
  3. Double click on the just created Property Sheet.
  4. Click on User Macros.
  5. Click Add Macro.
  6. Add the build variable’s name and value. Check “Set this macro as an environment variable in the build environment”.

References