Passing flags to compiler from gem or “How to install Curb gem on windows”

•October 21, 2013 • 1 Comment

First, install curl.. should be easy enough… then…

gem install curb — –with-curl-include=c:\code\curl\include –with-curl-lib=c:\code\curl\bin

Build systems or Make Replacements.

•November 16, 2011 • Leave a Comment

When I moved away from Visual Studio and to Eclipse, I needed to replace the build system. My original motivation for an alternate build system actually arose when I was still an avid Visual C++ user. I had somehow settled on a non-default project settings for my builds as I always linked with the static runtime for reasons I do not fully remember now. Anyways, every time I made a new VS project, I needed to go through and manual change things through their GUI which was cumbersome and slow. So I started to look into alternate build systems that could generate the proj files for me. In fact, what I did at first was write my own tool that did it for me, then I started looking for an alternate more appropriate tool.

 

My requirements were:

  • Must generate project files for visual studio (or now Eclipse)
  • Must be fast
  • Must be easy to use

There are actually tons of build systems out there:

All of them have pros and cons. Tools likeĀ  Tup or Jam all are fast and closer to what one might expect in a makefile, yet the syntax for them is extremely terse and unfriendly, which while allowing experts the ability to create a build script with very few keystrokes, does not allow beginners an easy entry to the system. These build systems designed a DSL to be extremely compact whereas IMO they should have designed a DSL that was easy to learn and use. CMake on the other hand made their DSL extremely verbose and IMO limited, which again makes it harder to learn than what it should be.

Currently CMake and SCons seem to be the widest adopted of the non make-based tools. After discovering that SCons visual studio support was hackish at the time and that Waf was linux only at the time (Both have much better Visual Studio support now) I went with CMake. Honestly, I don’t like CMake that much. Their custom language is the worst language I have ever seen in my life and while the developer seem to have been open to a Lua extension at one point, it seems that they are very excited about their crappy CMake language. The good thing about CMake is that after using it for a little bit, you can make some simple build scripts with it and then do a bunch of copy pasting of that script for new projects.

As things would have it, I’ve spent part of today re-researching build systems. It turns out that Waf now has support for Visual Studio and Eclipse project files, which means it is now cross platform and SCons seems to have good Visual Studio support. I think I will convert some of my build scripts over to SCons and Waf and test them out now. SCons is supposed to have ironed out some of the build speed issues and Waf seems to have a lot more features than it used to.

GCC 4.6.1 for Windows

•November 14, 2011 • Leave a Comment

You can download it from here:

http://nuwen.net/files/mingw/mingw-7.2.exe

This distro is built by a guy who works on the Visual C++ team at Microsoft.

Robust PDF parsing

•November 14, 2011 • Leave a Comment

I’ve ported Didier Steven’s pdf-parser.py script to C++. The problem I have is that the parser doesn’t handle malformed but still loadable by Adobe Reader X pdf files. I found a collection here: http://code.google.com/p/corkami/wiki/PDFTricks – some of the files there no longer load in Reader X it appears though.

 

If anyone knows of some open source PDF parser that will handle these documents, please inform me. I would like to see how they perform the parsing. So far sumatrapdf and pdfminer do not handle these documents.

 

(You can also get a lot of PE tricks here: http://code.google.com/p/corkami/downloads/list?can=1&q=Binary+corpus)

You can find Didier’s original code here: http://blog.didierstevens.com/programs/pdf-tools/

Chemtrails

•November 14, 2011 • Leave a Comment

Gerrit – code review for git

•November 14, 2011 • Leave a Comment

http://code.google.com/p/gerrit/

Objective

Gerrit is a web based code review system, facilitating online code reviews for projects using the Git version control system.

Gerrit makes reviews easier by showing changes in a side-by-side display, and allowing inline comments to be added by any reviewer.

Gerrit simplifies Git based project maintainership by permitting any authorized user to submit changes to the master Git repository, rather than requiring all approved changes to be merged in by hand by the project maintainer. This functionality enables a more centralized usage of Git.

Java git implementation.

•November 14, 2011 • Leave a Comment

It looks like JGit and EGit will be the closest thing to a native windows implementation of git us windows users can hope for.

Check them out here:
http://www.eclipse.org/jgit/
http://www.eclipse.org/egit/

User guide:
http://wiki.eclipse.org/JGit/User_Guide

Ascii Chart

•November 11, 2011 • Leave a Comment

I look for this a lot:

Alternatively if you have a tool such as 010 Editor, there is an ascii chart there too I believe.

Boost C++11 GCC and MinGW

•November 11, 2011 • Leave a Comment

If you want to use the new C++11 features when compiling boost, you’ll need to add this:

cxxflags=-std=gnu++0x

to your build command line. If you add

cxxflags=-std=std++0x

You will get build errors about something to do with ‘environ’. It took me quite some time to figure this one out.

Defcon 19

•August 10, 2011 • 1 Comment

MikeD and I delivered this presentation to a reasonably full room (for sunday @ 5pm) at the Rio for Defcon 19. Hacking MMORPGs for Fun and Mostly Profit