1. How to compile a 32bit program on 64bit system

  1. install related package and header file, like glibc-devel.i686
  2. If you meet error like:
1
2
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s

Then you need to install libgcc.i686 3. gcc -m32 -o test test.c

How to compile a program with .so file

  1. cc simple_parse.c -o simple_parse -ljansson -L .

export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH