Porting from Solaris to Linux RH 7.3
a9028033@unet.univie.ac.at
a9028033@unet.univie.ac.at
Tue Feb 17 16:42:00 GMT 2004
Eljay Love-Jensen <eljay@adobe.com> wrote:
> Hi Iavor,
>
> It appears that HCSmain.cc does not contain a main() routine.
>
> Also, I presume that Solaris Workshop C++ generated object files are NOT compatible with GCC's C++ object files. (I expect that their ABI's are different.) That may be an issue if you are trying to mix-n-match.
>
> Plus, I would not expect Solaris generated object files to work with Linux. Even if it is Solaris for Intel and Linux for Intel.
>
> HTH,
> --Eljay
>
Eljay, thanks for the speedy response :)
You are right, just for a moment a have worked on the wrong file.
Now I have removed all previous object files and the output is a
long list from errors like this:
make -f mymakegnu1 HCSmain
g++ -g -v -o HCSmain HCSmain.cc
Reading specs from /export/uti/sparc/bin/../lib/gcc-lib/sparc-sun-solaris2.6/3.0.3/specs
Configured with: ../configure --with-as=/usr/local/bin/as --with-ld=/usr/local/bin/ld : (reconfigured) ../configure --with-as=/usr/local/bin/as --with-ld=/usr/local/bin/ld
Thread model: posix
gcc version 3.0.3
/export/uti/sparc/bin/../lib/gcc-lib/sparc-sun-solaris2.6/3.0.3/cc1plus -v -iprefix /export/uti/sparc/bin/../lib/gcc-lib/sparc-sun-solaris2.6/3.0.3/ -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=3 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__sparc -D__sun -D__unix -Asystem=unix -Asystem=svr4 -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D__EXTENSIONS__ -D__GCC_NEW_VARARGS__ -Acpu=sparc -Amachine=sparc HCSmain.cc -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase HCSmain.cc -g -version -o /var/tmp/ccaojhJ0.s
GNU CPP version 3.0.3 (cpplib) (sparc)
GNU C++ version 3.0.3 (sparc-sun-solaris2.6)
compiled by GNU C version 3.0.3.
ignoring nonexistent directory "/export/uti/sparc/lib/gcc-lib/../../sparc-sun-solaris2.6/include"
ignoring nonexistent directory "/usr/local/lib/gcc-lib/sparc-sun-solaris2.6/3.0.3/../../../../include/g++-v3"
ignoring nonexistent directory "/usr/local/lib/gcc-lib/sparc-sun-solaris2.6/3.0.3/../../../../include/g++-v3/sparc-sun-solaris2.6"
ignoring nonexistent directory "/usr/local/lib/gcc-lib/sparc-sun-solaris2.6/3.0.3/../../../../include/g++-v3/backward"
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/local/lib/gcc-lib/sparc-sun-solaris2.6/3.0.3/include"
ignoring nonexistent directory "/usr/local/lib/gcc-lib/sparc-sun-solaris2.6/3.0.3/../../../../sparc-sun-solaris2.6/include"
#include "..." search starts here:
#include <...> search starts here:
/export/uti/sparc/lib/gcc-lib/../../include/g++-v3
/export/uti/sparc/lib/gcc-lib/../../include/g++-v3/sparc-sun-solaris2.6
/export/uti/sparc/lib/gcc-lib/../../include/g++-v3/backward
/export/uti/sparc/lib/gcc-lib/sparc-sun-solaris2.6/3.0.3/include
/usr/include
End of search list.
In file included from basestation.h:6,
from basestation.cc:1,
from HCSmain.cc:19:
radio.h:47: cannot declare member function `static double Radio<T1,
T2>::get_radiofrequency()' to have static linkage
In file included from mobility_typedefs.h:5,
from street_type_table.h:7,
from mobility.h:7,
from mobilestation.h:11,
from mobilestation.cc:1,
from HCSmain.cc:20:
sudrand.h:31:8: warning: extra tokens at end of #endif directive
In file included from matrix.h:5,
from mobility_typedefs.h:8,
from street_type_table.h:7,
from mobility.h:7,
from mobilestation.h:11,
from mobilestation.cc:1,
from HCSmain.cc:20:
checkvec.h:33: parse error before `,' token
checkvec.h:35: missing ';' before right brace
checkvec.h:37: ISO C++ forbids defining types within return type
checkvec.h:37: syntax error before `operator'
checkvec.h:37: `difference_type' was not declared in this scope
checkvec.h:37: parse error before `)' token
checkvec.h:38: ISO C++ forbids declaration of `operator[]' with no type
checkvec.h:38: `int operator[](...)' must be a nonstatic member function
checkvec.h:38: `int operator[](...)' must take exactly two arguments
checkvec.h: In function `int operator[](...)':
checkvec.h:39: `index' undeclared (first use this function)
checkvec.h:39: (Each undeclared identifier is reported only once for each
function it appears in.)
checkvec.h:39: parse error before `>' token
checkvec.h:39: parse error before `)' token
checkvec.h:41: `T' undeclared (first use this function)
checkvec.h:41: template argument 1 is invalid
checkvec.h:41: template argument 2 is invalid
checkvec.h: At global scope:
checkvec.h:44: syntax error before `operator'
.....
....
In file included from system.h:12,
from mobilestation.h:13,
from mobilestation.cc:1,
from HCSmain.cc:20:
intraHO.h: In constructor `intraHO::intraHO(Microlayer&, Macrolayer&)':
intraHO.h:88: no matching function for call to
`HOfailure<intraHO>::setHOexeFunction(<unknown type>)'
HOfailure.h:81: candidates are: void HOfailure<HOType>::setHOexeFunction(void
(HOType::*)(Mobilestation&)) [with HOType = intraHO]
intraHO.h:89: no matching function for call to
`HOfailure<intraHO>::setHOexeFunction(<unknown type>)'
HOfailure.h:81: candidates are: void HOfailure<HOType>::setHOexeFunction(void
(HOType::*)(Mobilestation&)) [with HOType = intraHO]
intraHO.h:90: no matching function for call to
`HOfailure<intraHO>::setFailureFunction(<unknown type>)'
HOfailure.h:87: candidates are: void HOfailure<HOType>::setFailureFunction(void
(HOType::*)(Mobilestation&)) [with HOType = intraHO]
intraHO.h:91: no matching function for call to
`HOfailure<intraHO>::setFailureFunction(<unknown type>)'
HOfailure.h:87: candidates are: void HOfailure<HOType>::setFailureFunction(void
(HOType::*)(Mobilestation&)) [with HOType = intraHO]
....
....
*** Error code 1
make: Fatal error: Command failed for target `HCSmain'
This is only a small part of the output.
Is it really possible that the Workshop C++ compiler solves all
this without problems, wirting out not more than 2 warnings and
the gcc fails over the same source code.
Some part of the code is included:
// radio.h
#ifndef radio__h
#define radio__h radio__h
#include "positionT.h"
template <class T1,class T2>
class Radio
{
private:
static double radiofrequency; // units in MHz
protected: // public changed to protected 04.08.2000
Radio(const T1&, const T2&);
Radio(const pair<T1,T2>&);
PositionT<T1,T2> location;
public:
void static set_radiofrequency(const double);
static double get_radiofrequency();
};
/* class variable */
template <class T1, class T2>
double Radio<T1,T2>::radiofrequency = 2000.0; // units in MHz
/* inline methods */
/* also a default constructor is possible and then a call of
locationset_position in Basestation::Basestation(,) */
template <class T1, class T2>
inline Radio<T1,T2>::Radio(const T1& xcoord, const T2& ycoord)
: location(xcoord, ycoord)
{};
template <class T1, class T2>
inline Radio<T1,T2>::Radio(const pair<T1,T2>& position)
: location(position)
{};
template <class T1, class T2>
inline void Radio<T1,T2>::set_radiofrequency(const double freq)
{
radiofrequency = freq;
};
template <class T1, class T2>
inline static double Radio<T1,T2>::get_radiofrequency()
{
return radiofrequency;
}
#endif // radio__h
and for checkvec.h
// include/checkvec : vector class with checked limits
#ifndef CHECKVEC_H
#define CHECKVEC_H
#include<cassert>
#include<vector>
using namespace std;
template<class T>
class checkedVector : public vector<T> // inherit from std::vector<T>
{
/* In the Sun Compiler the types from vector<T> are not inherited.
Hence we need the following definitions */
public:
typedef typename vector<T>::size_type size_type;
typedef typename vector<T>::difference_type difference_type;
typedef typename vector<T>::reference reference;
typedef typename vector<T>::const_reference const_reference;
public:
// type names like iterator etc. are also inherited
checkedVector()
{}
checkedVector(size_type n, const T& value = T())
: vector<T>(n, value)
{}
checkedVector(iterator i, iterator j)
: vector<T>(i, j)
{}
reference operator[](difference_type index)
{
assert(index >=0
&& index < static_cast<difference_type>(size()));
return vector<T>::operator[](index);
}
const_reference operator[](difference_type index) const
{
assert(index >=0
&& index < static_cast<difference_type>(size()));
return vector<T>::operator[](index);
}
};
#endif
The source code is quite huge and if you have some hint
how can be solved i will be very gratefull.
Regards. Iavor
More information about the Gcc-help
mailing list