From 910a2abf86e2c31195d72afb70a3977397454ecb Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Sat, 5 May 2007 00:29:49 +0000 Subject: [PATCH] Fixed an error that occurred during linking of applications. There were multiple definitions of importPhase(string, string), one per application file. I moved the definition of importPhase to libctxx.a as it had to be in an object file, and I retained the declaration within importPhase.h. I also added declarations for the other functions in libctxx.a into importPhase.h, as they weren't declared anywhere in the interface. --- Cantera/cxx/include/importPhase.h | 11 +++++++---- Cantera/cxx/src/Makefile.in | 2 +- Cantera/cxx/src/cxxutils.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Cantera/cxx/include/importPhase.h b/Cantera/cxx/include/importPhase.h index 89bc01b3c..94e86f4be 100644 --- a/Cantera/cxx/include/importPhase.h +++ b/Cantera/cxx/include/importPhase.h @@ -6,12 +6,15 @@ #include "kernel/ThermoPhase.h" #include "kernel/ThermoFactory.h" +/* + * The Definitions for these functions are all located in + * libctxx.a + */ namespace Cantera { + ThermoPhase* importPhase(std::string infile, std::string id=""); - ThermoPhase* importPhase(std::string infile, std::string id="") { - ThermoPhase* p = newPhase(infile, id); - return p; - } + std::string report(const ThermoPhase& th, bool show_thermo); + std::string formatCompList(const Phase& mix, int xyc); } diff --git a/Cantera/cxx/src/Makefile.in b/Cantera/cxx/src/Makefile.in index b9440d8ac..5efa87258 100644 --- a/Cantera/cxx/src/Makefile.in +++ b/Cantera/cxx/src/Makefile.in @@ -15,7 +15,7 @@ SUFFIXES= .cpp .d .o PIC_FLAG=@PIC@ CXX_FLAGS = @CXXFLAGS@ $(CXX_OPT) $(PIC_FLAG) -OBJS = cxxutils.o +OBJS = cxxutils.o importPhase.o DEPENDS = $(OBJS:.o=.d) diff --git a/Cantera/cxx/src/cxxutils.cpp b/Cantera/cxx/src/cxxutils.cpp index 24fae7a45..70eb60ecd 100644 --- a/Cantera/cxx/src/cxxutils.cpp +++ b/Cantera/cxx/src/cxxutils.cpp @@ -14,7 +14,7 @@ namespace Cantera { /** * Format a summary of the mixture state for output. */ - string report(const ThermoPhase& th, bool show_thermo) { + std::string report(const ThermoPhase& th, bool show_thermo) { try { char p[200]; @@ -76,19 +76,19 @@ namespace Cantera { return s; } catch (CanteraError) { - return string(""); + return std::string(""); } } /** * Format a composition list for output. */ - string formatCompList(const Phase& mix, int xyc) { + std::string formatCompList(const Phase& mix, int xyc) { const doublereal Threshold = 1.e-20; char p[200]; - string s = ""; + std::string s = ""; int kk = mix.nSpecies(); array_fp zz(kk); switch (xyc) {