2010-02-11

lparse 1.1.1 compiling conflicts with GCC 4.4.1 on Ubuntu Linux 9.10

by Forrest Sheng Bao http://fsbao.net

It seems people are looking for my blog on how to compile lparse with modern GCC or Ubuntu. The major problem is that many programs in lparse source code do not include stdio.h or other needed head files. I do not know why on some platform such code can be compiled. At least it does not work for my GCC 4.x. And it seems since version 4.2, GCC is getting strict on C standard.

Here is the solution to solve such problems if you are using GCC 4.4.1 on Ubuntu Linux 9.10. An earlier version for GCC 4.33 on Ubuntu Linux 9.04 is at http://forrestbao.blogspot.com/2009/11/lparse-111-conflicts-with-gcc-433.html Janosch reported the problem on Ubuntu 9.10. So I am writing this blog entry.

Step 1: Install bison. You can use
sudo apt-get install bison
or other ways.

Step 2: Comment out line 85 of src/extern.h
//long int strtol(const char *nptr, char **endptr, int base);
PS: I do not know why the HAVE_STRTOL does not work.

Step 3: Include stdarg.h and stdio.h into src/global.h

#include <stdio.h>
#include <stdarg.h>

Step 4: Done! Make and you shall get tons of warnings but finally the lparse executable.

2010-02-08

No sense to learn Microsoft Visual Studio in C/C++ courses

by Forrest Sheng Bao http://fsbao.net
  1. A lot people begin their C/C++ learning experience from Microsoft Visual Studio (MSV).
  2. If using MSV, beginners will be frustrated by many concepts and warnings from the tool, not the language itself or their programs.
  3. The goal is to learn a programming language rather than mastering MSV.
  4. Development on Windows using Microsoft tool chain is not easy. Microsoft even has a certification for this, Microsoft Certified Solution Developer (MCSD) - if it is easy, why bother a certificate? Do you need a certificate to drink water?
  5. So we just simply need an editor and a compiler, with optional debugger (for beginners, printing is the best debugging).
  6. I really don't think many industry leaders are using Microsoft solutions in their R&D. For hardware gurus, like TI or ATMEL, their development environment is based on Eclipse, an IBM-initiated open-source IDE. For software gurus, you can just search how many of them are embracing open source solutions. Personally, I feel MSV is suitable for small companies with less than or equal to 25 people. If we are educating engineers for local small firms, fine, teach them MSV. If we are providing engineers for much bigger teams distributed all over the world, we'd better teach them how to play with big brothers.