CCR code: Splitting a C code file

Dirk Hohndel dirk at hohndel.org
Sat Aug 23 07:44:52 PDT 2014


On August 23, 2014 7:29:47 AM Willem Ferguson 
<willemferguson at zoology.up.ac.za> wrote:

> I am (at last) getting back to working with the rebreather code for
> Subsurface, and have hit a snag. I am splitting all the code dealing
> with cylinder pressures into a separate file as suggested by Robert.
> This shortens the code in profile.c by about a third (450 lines).
>
> I did something quite simple:
> 1) create a new file gaspressures.c
> 2) cut and paste a single function from profile.c into gaspressures.c,
> (including the appropriate header files from profile.c). This
> transferred function is called by profile.c.
> 3) create a prototype of this transferred function at the start of
> profile.c, so that, at link time, the symbol can be resolved.
> 4) in subsurface.pro, I inserted gaspressures.c into the section marked
> SOURCES.
>
> Run qmake (no errors or warnings)
> Run make (Error: cannot find the transferred function referred to in
> profile.c)
>
> The function name is not resolved. I suspect I do not understand the
> interaction between qmake and make. Is this correct?

Is the function marked as "static" by any chance?

/D




More information about the subsurface mailing list