# CCodeGenerate and calling external functions

Is it possible to use CCodeGenerate to generate code which calls functions from other C libraries? For example, I would like to do something like this:

CCodeGenerate[Compile[{{x}}, f[x]+1], "f1"]


where f is a function defined in some other library (which I would then link to the generated code). I tried to first make f available in Mathematica via LibraryLink, but then CCodeGenerate issues a warning (CCodeGenerate::wmreq) and returns \$Failed.

-
According to Wolfram support "Calling functions from external C libraries is currently not supported by CCodeGenerate. It only supports creation of libraries from the code generated using LibraryGenerate function." I find this rather disappointing. –  Martin Aug 18 '13 at 15:16