How to modify a project Makefile to integrate boehm gc

70 views Asked by At

Please, is someone familiar with Boehm GC?

I want to use it in the word-count app of Phoenix (https://github.com/kozyraki/phoenix), but I fail to modify the Makefile to include the GC library.

On the documentation page of Boehm, they only provide a simple c example and a command to compile it from the GC directory tree. I can't find any tutorial on how to link it with an existing project.

Thanks

1

There are 1 answers

0
Ivan Maidanski On

The following steps should help you:

  1. ensure libgc is installed on your host, e.g. on Ubuntu type like this: sudo apt install libgc-dev
  2. your source files (which call GC_* functions) should include <gc.h>.
  3. add -lgc to LIBS variable in the Makefile