g++ works in my machine but not work on another machine

Feb 2, 2016 at 5:52pm
I use the following command and am able to generate the execution file

g++ -o T201_UniformFilm -std=c++11 -I ~/Work/PhD/Runs/Eigen324 -O3 T201_UniformFilm.cpp BoundaryCondition.cpp CalculateEvaporation.cpp CalculateFlowfield.cpp CalculationDomain.cpp FiniteVolume.cpp Geometry.cpp Meshing.cpp Physics.cpp PoreThroat.cpp Testing.cpp

but after I copy all stuff to the supercomputer, they also got the same compiler installed, I cannot get the results, always says "...is not defined", looks like it cannot find the head file. But all the .cpp file and .h file are there, all the library are copied keeping the same file structure.

What can be the problem, Thanks!

The error message: I didn't copy all of them, it is too long, but something like thi.
/tmp//ccCUjCW3.o: In function `readCase()':
T201_UniformFilm.cpp:(.text+0x44a): undefined reference to `cd_c::phy'
T201_UniformFilm.cpp:(.text+0x44f): undefined reference to `operator>>(std::istream&, physics_c&)'
T201_UniformFilm.cpp:(.text+0x454): undefined reference to `cd_c::phy'
T201_UniformFilm.cpp:(.text+0x459): undefined reference to `physics_c::nondimensionalize()'
T201_UniformFilm.cpp:(.text+0x4a9): undefined reference to `operator>>(std::istream&, point_c&)'
T201_UniformFilm.cpp:(.text+0x4b1): undefined reference to `cd_c::phy'
T201_UniformFilm.cpp:(.text+0xb6d): undefined reference to `operator>>(std::istream&, block_c&)'
T201_UniformFilm.cpp:(.text+0xb7a): undefined reference to `cd_c::phy'
T201_UniformFilm.cpp:(.text+0xb7f): undefined reference to `block_c::nondimensionalize(physics_c const&)'
T201_UniformFilm.cpp:(.text+0xfbc): undefined reference to `cd_c::phy'
T201_UniformFilm.cpp:(.text+0xfc6): undefined reference to `operator<<(std::ostream&, physics_c const&)'
/tmp//ccCUjCW3.o: In function `cCell_c::~cCell_c()':
T201_UniformFilm.cpp:(.text._ZN7cCell_cD2Ev[_ZN7cCell_cD5Ev]+0x7): undefined reference to `vtable for cCell_c'
/tmp//ccCUjCW3.o: In function `std::vector<cCell_c, std::allocator<cCell_c> >::~vector()':
T201_UniformFilm.cpp:(.text._ZNSt6vectorI7cCell_cSaIS0_EED2Ev[_ZNSt6vectorI7cCell_cSaIS0_EED5Ev]+0x2a): undefined reference to `vtable for cCell_c'
/tmp//ccCUjCW3.o: In function `main':
T201_UniformFilm.cpp:(.text.startup+0x275): undefined reference to `readMesh()'
T201_UniformFilm.cpp:(.text.startup+0x2ff): undefined reference to `meshing()'
T201_UniformFilm.cpp:(.text.startup+0x31a): undefined reference to `Testing()'
/tmp//ccCUjCW3.o: In function `cCell_c::~cCell_c()':
T201_UniformFilm.cpp:(.text._ZN7cCell_cD0Ev[_ZN7cCell_cD5Ev]+0x7): undefined reference to `vtable for cCell_c'
/tmp//cczwrnDG.o: In function `inClusterToEmpty(unsigned long const&)':
CalculateEvaporation.cpp:(.text+0x1133): undefined reference to `cd_c::ClusterToEmpty'
CalculateEvaporation.cpp:(.text+0x113a): undefined reference to `cd_c::ClusterToEmpty'
/tmp//cczwrnDG.o: In function `checkNetwork()':
CalculateEvaporation.cpp:(.text+0x12a9): undefined reference to `pore_c::isMeniscus()'
CalculateEvaporation.cpp:(.text+0x16e7): undefined reference to `throat_c::isMeniscus()'
CalculateEvaporation.cpp:(.text+0x1799): undefined reference to `pore_c::MassOutFlux(unsigned long const&)'
CalculateEvaporation.cpp:(.text+0x17e9): undefined reference to `throat_c::MassOutFlux(unsigned long const&)'
CalculateEvaporation.cpp:(.text+0x1abc): undefined reference to `cd_c::TotLiquid'
CalculateEvaporation.cpp:(.text+0x1add): undefined reference to `cd_c::TotLiquid0'
/tmp//cczwrnDG.o: In function `plotAllField(std::basic_ofstream<char, std::char_traits<char> >&)':
CalculateEvaporation.cpp:(.text+0x1f36): undefined reference to `cd_c::phy'
CalculateEvaporation.cpp:(.text+0x292e): undefined reference to `cd_c::phy'
CalculateEvaporation.cpp:(.text+0x2a0e): undefined reference to `cd_c::phy'
CalculateEvaporation.cpp:(.text+0x2b0f): undefined reference to `cd_c::phy'
CalculateEvaporation.cpp:(.text+0x2d2b): undefined reference to `cd_c::phy'
/tmp//cczwrnDG.o:CalculateEvaporation.cpp:(.text+0x2e26): more undefined references to `cd_c::phy' follow
/tmp//cczwrnDG.o: In function `cluster_c::calcMassOutFlux(unsigned long const&)':
CalculateEvaporation.cpp:(.text+0x4699): undefined reference to `throat_c::isMeniscus()'
CalculateEvaporation.cpp:(.text+0x46bc): undefined reference to `throat_c::MassOutFlux(unsigned long const&)'
CalculateEvaporation.cpp:(.text+0x472e): undefined reference to `throat_c::MassOutFlux(unsigned long const&)'
/tmp//cczwrnDG.o: In function `cluster_c::calctimeToEmptyMax()':
CalculateEvaporation.cpp:(.text+0x490b): undefined reference to `cd_c::phy'
/tmp//cczwrnDG.o: In function `cluster_c::drying(double const&, bool)':
CalculateEvaporation.cpp:(.text+0x4a1b): undefined reference to `cd_c::phy'
CalculateEvaporation.cpp:(.text+0x4a23): undefined reference to `cd_c::phy'
CalculateEvaporation.cpp:(.text+0x4b1d): undefined reference to `cd_c::phy'
CalculateEvaporation.cpp:(.text+0x4b28): undefined reference to `cd_c::EDT'
CalculateEvaporation.cpp:(.text+0x4b30): undefined reference to `cd_c::phy'
/tmp//cczwrnDG.o: In function `cluster_c::findMaxThroat()':
CalculateEvaporation.cpp:(.text+0x60d8): undefined reference to `throat_c::isMeniscus()'
Last edited on Feb 2, 2016 at 6:23pm
Feb 2, 2016 at 5:59pm
what is not defined? Can you get the actual error message?
Feb 2, 2016 at 6:24pm
thanks doug4, I edited my topic, please take a look!

Those undefined staff are all the variables, member variables, member functions
Last edited on Feb 2, 2016 at 6:34pm
Feb 3, 2016 at 11:58am
Those are link errors. Are all those undefined references to symbols defined in your code? Or are they in external libraries?
Topic archived. No new replies allowed.