Compiling a new thermophysical model
Dear Foamers,
I'm making my own thermophysical model. For that reason I wrote some functions I want to you use to calculate the different properties (in thermoI.H, and the respective rho*I.H, transport*I.H, thermo*I.H files). I include the header-file declaring all my functions in "thermoI.H", otherwise the compilation fails, since my functions are not defined. The compilation of libspecie works w/o problems, but when I try to compile libfluidThermophysicalModels (in the "basic" folder), I get compiler errors telling me, that my functions are multiple defined, e.g. a small fraction of the error message: Code:
Make/linux64GccDPInt32Opt/rhoThermo/rhoThermos.o: In function `PN_sSCByPT(double, double)': These lines occur for all of my functions twice: - for psiThermos.o & rhoThermos.o - for psiThermos.o & liquidThermo.o It seems like the compiler declares the functions several times, since their definitions are called by "thermoI.H". I now tried several options to circumvent that issue, but without success. Does anybody has an idea how to solve that issue? Sincerely, stockzahn |
Dear Stockzahn:
It sounds like you might need to implement include guards to your header file, so that all the objects / functions only get declared once during compile. You should surround the contents of your header file with the following lines: Code:
#ifndef __YOUR_HEADER_NAME__ |
Dear Gerry,
thanks for the fast response, unfortunately that didn't work. stockzahn EDIT: I solved it: obviously a very beginner's mistake: I tested the functions in a different program, for which in included all C-files in the header files. This was the problem, I just copied all files into the inlude-folder and deleted the #include-commands in the header-files. But thanks for the hint with the include guards! That will be advantegeous in the future. |
All times are GMT -4. The time now is 01:34. |