CCR code: Splitting a C code file

Willem Ferguson willemferguson at zoology.up.ac.za
Sat Aug 23 07:26:11 PDT 2014


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?
Kind regards,
willem



More information about the subsurface mailing list