C
ChrisG
Hi,
I am building an executable using Sun Forte 7 compilers. Because I
have both Fortran and
C++ source codes, I have to use f77 to do the final linking:
f77 -xarch=v9 -xildoff -o ../bin/rdc
*.o (... list of all the objects) \
-L. -L../bin/ -lsocket -lnsl -lintl -xarch=v9 -xildoff
-lpthread -lCrun -lCstd -lc
and I got tons of errors like:
Undefined first referenced
symbol in file
__1cMDynamicArray4Cb_2t6Mkb_v_ AlgebraicExprParser.o
__1cMDynamicArray4CpnENode__2T6M_v_ AlgebraicExprTree.o
__1cEList4CpnIPCEOrder__JdumpDeref6kMpkcrnDstdNbasic_ostream4Ccn0CLchar_traits4Cc____4_v_
UncertainInput.o
__1cEList4CpnSPermuteInstruction__2t6M_v_ SAXLoader.o
.......
All the undefined symbols are related to DynamicArray and List, which
are both templates.
Here is the DynamicArray code:
template <class T>
class DynamicArray {
private:
enum InitialSize { initDynArray = 1 };
public:
explicit DynamicArray (T const valDefault);
~DynamicArray ();
void setValue (int i, T const val);
...
private:
T * m_arr;
int m_capacity;
...;
};
template <class T>
DynamicArray <T>:ynamicArray (T const valDefault)
: m_capacity (initDynArray), m_highestAdd (0), m_valDefault
(valDefault) {
m_arr = new T [initDynArray]; // allocate memory
for (int i = 0; i < initDynArray; ++i)
m_arr = m_valDefault;
}
I have successful builds of the same project on all the other UNIX
platforms, including Linux,
HP, IRIX, AIX. I don't know what's going on with the Sun Forte build.
Any suggestions are
welcome.
Thanks in advance,
Chris
I am building an executable using Sun Forte 7 compilers. Because I
have both Fortran and
C++ source codes, I have to use f77 to do the final linking:
f77 -xarch=v9 -xildoff -o ../bin/rdc
*.o (... list of all the objects) \
-L. -L../bin/ -lsocket -lnsl -lintl -xarch=v9 -xildoff
-lpthread -lCrun -lCstd -lc
and I got tons of errors like:
Undefined first referenced
symbol in file
__1cMDynamicArray4Cb_2t6Mkb_v_ AlgebraicExprParser.o
__1cMDynamicArray4CpnENode__2T6M_v_ AlgebraicExprTree.o
__1cEList4CpnIPCEOrder__JdumpDeref6kMpkcrnDstdNbasic_ostream4Ccn0CLchar_traits4Cc____4_v_
UncertainInput.o
__1cEList4CpnSPermuteInstruction__2t6M_v_ SAXLoader.o
.......
All the undefined symbols are related to DynamicArray and List, which
are both templates.
Here is the DynamicArray code:
template <class T>
class DynamicArray {
private:
enum InitialSize { initDynArray = 1 };
public:
explicit DynamicArray (T const valDefault);
~DynamicArray ();
void setValue (int i, T const val);
...
private:
T * m_arr;
int m_capacity;
...;
};
template <class T>
DynamicArray <T>:ynamicArray (T const valDefault)
: m_capacity (initDynArray), m_highestAdd (0), m_valDefault
(valDefault) {
m_arr = new T [initDynArray]; // allocate memory
for (int i = 0; i < initDynArray; ++i)
m_arr = m_valDefault;
}
I have successful builds of the same project on all the other UNIX
platforms, including Linux,
HP, IRIX, AIX. I don't know what's going on with the Sun Forte build.
Any suggestions are
welcome.
Thanks in advance,
Chris