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.
This commit is contained in:
Harry Moffat 2007-05-05 00:29:49 +00:00
parent 82db8d7914
commit 910a2abf86
3 changed files with 12 additions and 9 deletions

View file

@ -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);
}

View file

@ -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)

View file

@ -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("<error>");
return std::string("<error>");
}
}
/**
* 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) {