Compilation error

Help
2011-03-23
2013-05-15
  • Eric Tanguy
    Eric Tanguy
    2011-03-23

    Hi, i try to update the new version in fedora package but i have some errors :
    spfile.cpp: In member function 'matrix spfile::correlationMatrix(double, nr_complex_t, double, matrix)':
    spfile.cpp:412:21: error: call of overloaded 'conj(nr_complex_t)' is ambiguous
    /usr/lib/gcc/i686-redhat-linux/4.5.1/../../../../include/c++/4.5.1/complex:667:33: note: candidates are: std::complex<_Tp> std::conj(const std::complex<_Tp>&)

    What's the problem and how i can solve it ?
    Thanks

    Eric

     
  • Stefan Jahn
    Stefan Jahn
    2011-03-24

    The problem is, that g++ 4.5 gets confused about conj() function.

    You can solve it by using std::conj() instead of conj().

    I am still thinking about what will be the correct upstream solution for this…

    Bastien, can you help?

     
  • Eric Tanguy
    Eric Tanguy
    2011-03-24

    Thanks i'm just the fedora packager of qucs and i don't know much about g++
    the good way for fedora accepting the package update is to have a patch solving this problem.
    Thanks
    Eric

     
  • Eric Tanguy
    Eric Tanguy
    2011-03-27

    Ok i solve a lot of this kind of errors but now i found some different errors :
    g++ -DHAVE_CONFIG_H -I. -I.. -I../src/math -I../src/components    -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector -param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -pipe -fno-exceptions -fno-rtti -fno-check-new -c -o evaluate.o evaluate.cpp
    In file included from eqnsys.h:133:0,
                     from nasolver.h:30,
                     from dcsolver.cpp:37:
    eqnsys.cpp: In member function 'void eqnsys<nr_type_t>::substitute_qr_householder() ':
    eqnsys.cpp:815:3:   instantiated from 'void eqnsys<nr_type_t>::solve_qr() '
    eqnsys.cpp:165:5:   instantiated from 'void eqnsys<nr_type_t>::solve() '
    nasolver.cpp:870:3:   instantiated from 'void nasolver<nr_type_t>::runMNA() '
    nasolver.cpp:145:5:   instantiated from 'int nasolver<nr_type_t>::solve_once() '
    nasolver.cpp:463:22:   instantiated from 'int nasolver<nr_type_t>::solve_linear() '
    dcsolver.cpp:121:13:   instantiated from here
    eqnsys.cpp:1024:48: error: no match for 'operator+=' in 'f += std::operator* (((const std::complex<double>&)((const std::complex<double>*)(& std::tr1::conj (((eqnsys<double>*)this)->eqnsys<double>::A->tmatrix<nr_type_t>::operator() (r, c))))), ((const double&)((const double*)((eqnsys<double>*)this)->eqnsys<double>::B->tvector<nr_type_t>::operator() (r))))'
    eqnsys.cpp:1026:7: error: no match for 'operator*=' in 'f *= std::tr1::conj (((eqnsys<double>*)this)->eqnsys<double>::T->tvector<nr_type_t>::operator() (C))'
    eqnsys.cpp: In member function 'void eqnsys<nr_type_t>::substitute_qr_householder_ls() ':
    eqnsys.cpp:825:3:   instantiated from 'void eqnsys<nr_type_t>::solve_qr_ls() '
    eqnsys.cpp:168:5:   instantiated from 'void eqnsys<nr_type_t>::solve() '
    nasolver.cpp:870:3:   instantiated from 'void nasolver<nr_type_t>::runMNA() '
    nasolver.cpp:145:5:   instantiated from 'int nasolver<nr_type_t>::solve_once() '
    nasolver.cpp:463:22:   instantiated from 'int nasolver<nr_type_t>::solve_linear() '
    dcsolver.cpp:121:13:   instantiated from here
    eqnsys.cpp:1063:48: error: no match for 'operator+=' in 'f += std::operator* (((const std::complex<double>&)((const std::complex<double>*)(& std::tr1::conj (((eqnsys<double>*)this)->eqnsys<double>::A->tmatrix<nr_type_t>::operator() (r, c))))), ((const double&)((const double*)((eqnsys<double>*)this)->eqnsys<double>::B->tvector<nr_type_t>::operator() (r))))'

    Any idea ??
    Eric

     
  • Eric Tanguy
    Eric Tanguy
    2011-04-02

    No one obtain this error or know how to solve this ??
    Thanks
    Eric

     
  • Eric Tanguy
    Eric Tanguy
    2011-04-19

    Fedora 15 is near the corner and i would like to update qucs before that but i need help to solve these problems before. Anyone ?
    Eric

     

  • Anonymous
    2011-06-22

    I'm still stuck at the "call of overloaded ‘conj(nr_complex_t)’ is ambiguous" error.

    Can anyone tell me, in plain English, how to deal with it?

     
  • Eric Tanguy
    Eric Tanguy
    2011-06-29

    i'm trying to update fedora package to 0.16 but i still have compilation problems. I definitely does not have comptences to solve these problems. If i can't update the package qucs will be retire definitly from fedora.
    Here is the problem :
    spfile.cpp: In member function 'matrix spfile::correlationMatrix(double, nr_complex_t, double, matrix)':
    spfile.cpp:412:21: error: call of overloaded 'conj(nr_complex_t)' is ambiguous
    spfile.cpp:412:21: note: candidates are:
    /usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../../include/c++/4.6.0/complex:669:33: note: std::complex<_Tp> std::conj(const std::complex<_Tp>&)
    /usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../../include/c++/4.6.0/tr1/complex:379:5: note: std::complex<_Tp> std::tr1::conj(const std::complex<_Tp>&)
    /usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../../include/c++/4.6.0/tr1/complex:384:5: note: std::complex<typename __gnu_cxx::__promote<_Tp>::__type> std::tr1::conj(_Tp)
    spfile.cpp:412:35: error: call of overloaded 'conj(nr_complex_t&)' is ambiguous
    spfile.cpp:412:35: note: candidates are:
    /usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../../include/c++/4.6.0/complex:669:33: note: std::complex<_Tp> std::conj(const std::complex<_Tp>&)
    /usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../../include/c++/4.6.0/tr1/complex:379:5: note: std::complex<_Tp> std::tr1::conj(const std::complex<_Tp>&)
    /usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../../include/c++/4.6.0/tr1/complex:384:5: note: std::complex<typename __gnu_cxx::__promote<_Tp>::__type> std::tr1::conj(_Tp)
    spfile.cpp:413:34: error: call of overloaded 'conj(nr_complex_t)' is ambiguous
    spfile.cpp:413:34: note: candidates are:
    /usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../../include/c++/4.6.0/complex:669:33: note: std::complex<_Tp> std::conj(const std::complex<_Tp>&)
    /usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../../include/c++/4.6.0/tr1/complex:379:5: note: std::complex<_Tp> std::tr1::conj(const std::complex<_Tp>&)
    /usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../../include/c++/4.6.0/tr1/complex:384:5: note: std::complex<typename __gnu_cxx::__promote<_Tp>::__type> std::tr1::conj(_Tp)
    spfile.cpp: In member function 'double spfile::noiseFigure(matrix, matrix, double&, nr_complex_t&, double&)':
    spfile.cpp:425:63: error: call of overloaded 'conj(nr_complex_t)' is ambiguous
    spfile.cpp:425:63: note: candidates are:
    /usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../../include/c++/4.6.0/complex:669:33: note: std::complex<_Tp> std::conj(const std::complex<_Tp>&)
    /usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../../include/c++/4.6.0/tr1/complex:379:5: note: std::complex<_Tp> std::tr1::conj(const std::complex<_Tp>&)
    /usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../../include/c++/4.6.0/tr1/complex:384:5: note: std::complex<typename __gnu_cxx::__promote<_Tp>::__type> std::tr1::conj(_Tp)
    spfile.cpp:443:58: error: call of overloaded 'conj(std::complex<double>)' is ambiguous
    spfile.cpp:443:58: note: candidates are:
    /usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../../include/c++/4.6.0/complex:669:33: note: std::complex<_Tp> std::conj(const std::complex<_Tp>&)
    /usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../../include/c++/4.6.0/tr1/complex:379:5: note: std::complex<_Tp> std::tr1::conj(const std::complex<_Tp>&)
    /usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../../include/c++/4.6.0/tr1/complex:384:5: note: std::complex<typename __gnu_cxx::__promote<_Tp>::__type> std::tr1::conj(_Tp)
    make: ***  Error 1
    make: *** Waiting for unfinished jobs….
    make: Leaving directory `/home/tanguy-e/rpmbuild/BUILD/qucs-0.0.16/qucs-core/src/components'
    make: ***  Error 1
    make: Leaving directory `/home/tanguy-e/rpmbuild/BUILD/qucs-0.0.16/qucs-core/src/components'
    make: ***  Error 1
    make: Leaving directory `/home/tanguy-e/rpmbuild/BUILD/qucs-0.0.16/qucs-core/src'
    make: ***  Error 1
    make: Leaving directory `/home/tanguy-e/rpmbuild/BUILD/qucs-0.0.16/qucs-core'
    make: ***  Error 2
    make: Leaving directory `/home/tanguy-e/rpmbuild/BUILD/qucs-0.0.16/qucs-core'
    make: ***  Error 1
    make: Leaving directory `/home/tanguy-e/rpmbuild/BUILD/qucs-0.0.16'
    make: ***  Error 2

    Help please
    Eric

     
  • F Rockenberger
    F Rockenberger
    2013-03-08

    Still no resolution here? I have seeing the same problem and none of the solutions that I google up are fixing it.

     
  • Hi.

    The problem is with g++-4.5 or higher. You need to compile it with g++-4.4 .-

    Try the following steps:

    First, obtain your g++ version

    g++ --version

    It says:

    g++ (Ubuntu/Linaro 4.8.0-3ubuntu3~12.04) 4.8.0
    Copyright (C) 2013 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    If your version is 4.4.7, you have the correct version, and you dont need to do the steps, else, remember the version cause you will need it after the steps.

    Now you need to install g++ 4.4

    sudo apt-get install g++-4.4

    Update the link for use g++-4.4 as g++

    sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 1

    Update alternatives says something like that :

    update-alternatives: using /usr/bin/g++-4.4 to provide /usr/bin/g++ (g++) >>automatically.

    Go to qucs source file folder..

    cd ~/qucs-0.0.16$

    Do make and make install

    sudo make
    sudo make install

    At this point, qucs should be succesfully installed on your system.

    Now, its necessary rollback the link to your version of g++, because future compilations maybe requires a higher version of g++ than g++-4.4

    sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-"version" 10

    "version" is the two most significant numbers.

    For example, if your version number is 4.7.3 you do:

    sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 10

    Hope that help you!

    Sorry for my bad english.

    Regards

    Cristian