На главную Наши проекты:
Журнал   ·   Discuz!ML   ·   Wiki   ·   DRKB   ·   Помощь проекту
ПРАВИЛА FAQ Помощь Участники Календарь Избранное RSS
msm.ru
! Правила раздела *nix / gcc / Eclipse / Qt / wxWidgets / GTK+
  • При создании темы ОБЯЗАТЕЛЬНО указывайте версию тулкита / библиотеки / компилятора.
  • Перед тем как задать вопрос, сформулируйте его правильно, чтобы вас могли понять.
  • Нарушение Правил может повлечь наказание со стороны модераторов.


Полезные ссылки:
user posted image Boost по-русски
user posted image Qt по-русски
Модераторы: Majestio
  
> странная, просто необъяснимая ошибка , Qt 4.3.1, gcc 4.2.1
    Ошибка появилась внезапно. Причин понять никак не могу. Редефиниций нету. Без Qt файлы собираются.

    Сообщение об ошибке:
    ExpandedWrap disabled
      make -f Makefile.Release
      make[1]: Entering directory `/media/disk-1/Graphica3'
      g++  -o Graphica3 release/main.o release/graphica3.o release/moc_graphica3.o  -L/usr/lib -lQtGui -L/usr/lib -L/usr/X11R6/lib -lpng -lSM -lICE -pthread -pthread -lXi -lXrender -lXrandr -lXfixes -lXcursor -lXinerama -lfreetype -lfontconfig -lXext -lX11 -lQtCore -lz -lm -pthread -lgthread-2.0 -lrt -lglib-2.0 -ldl -lpthread
      release/graphica3.o: In function `VolumePoint::VolumePoint()':
      graphica3.cpp:(.text+0x0): multiple definition of `VolumePoint::VolumePoint()'
      release/main.o:main.cpp:(.text+0x0): first defined here
      release/graphica3.o: In function `VolumePoint::VolumePoint()':
      graphica3.cpp:(.text+0x20): multiple definition of `VolumePoint::VolumePoint()'
      release/main.o:main.cpp:(.text+0x20): first defined here
      release/graphica3.o: In function `VolumePoint::VolumePoint(double, double, double)':
      graphica3.cpp:(.text+0x40): multiple definition of `VolumePoint::VolumePoint(double, double, double)'
      release/main.o:main.cpp:(.text+0x40): first defined here
      release/graphica3.o: In function `VolumePoint::VolumePoint(double, double, double)':
      graphica3.cpp:(.text+0x60): multiple definition of `VolumePoint::VolumePoint(double, double, double)'
      release/main.o:main.cpp:(.text+0x60): first defined here
      release/graphica3.o: In function `VolumePoint::VolumePoint(VolumePoint const&)':
      graphica3.cpp:(.text+0x80): multiple definition of `VolumePoint::VolumePoint(VolumePoint const&)'
      release/main.o:main.cpp:(.text+0x80): first defined here
      release/graphica3.o: In function `VolumePoint::VolumePoint(VolumePoint const&)':
      graphica3.cpp:(.text+0xa0): multiple definition of `VolumePoint::VolumePoint(VolumePoint const&)'
      release/main.o:main.cpp:(.text+0xa0): first defined here
      release/graphica3.o: In function `VolumePoint::setX(double)':
      graphica3.cpp:(.text+0xc0): multiple definition of `VolumePoint::setX(double)'
      release/main.o:main.cpp:(.text+0xc0): first defined here
      release/graphica3.o: In function `VolumePoint::setY(double)':
      graphica3.cpp:(.text+0xd0): multiple definition of `VolumePoint::setY(double)'
      release/main.o:main.cpp:(.text+0xd0): first defined here
      release/graphica3.o: In function `VolumePoint::setZ(double)':
      graphica3.cpp:(.text+0xe0): multiple definition of `VolumePoint::setZ(double)'
      release/main.o:main.cpp:(.text+0xe0): first defined here
      release/graphica3.o: In function `VolumePoint::getX() const':
      graphica3.cpp:(.text+0xf0): multiple definition of `VolumePoint::getX() const'
      release/main.o:main.cpp:(.text+0xf0): first defined here
      release/graphica3.o: In function `VolumePoint::getY() const':
      graphica3.cpp:(.text+0x100): multiple definition of `VolumePoint::getY() const'
      release/main.o:main.cpp:(.text+0x100): first defined here
      release/graphica3.o: In function `VolumePoint::getZ() const':
      graphica3.cpp:(.text+0x110): multiple definition of `VolumePoint::getZ() const'
      release/main.o:main.cpp:(.text+0x110): first defined here
      release/graphica3.o: In function `VolumePoint::operator!=(VolumePoint const&)const':
      graphica3.cpp:(.text+0x120): multiple definition of `VolumePoint::operator!=(VolumePoint const&) const'
      release/main.o:main.cpp:(.text+0x120): first defined here
      release/graphica3.o: In function `VolumePoint::operator==(VolumePoint const&)const':
      graphica3.cpp:(.text+0x170): multiple definition of `VolumePoint::operator==(VolumePoint const&) const'
      release/main.o:main.cpp:(.text+0x170): first defined here
      release/graphica3.o: In function `VolumePoint::operator=(VolumePoint const&)':
      graphica3.cpp:(.text+0x1c0): multiple definition of `VolumePoint::operator=(VolumePoint const&)'
      release/main.o:main.cpp:(.text+0x1c0): first defined here
      release/graphica3.o: In function `Perspective::Perspective(double)':
      graphica3.cpp:(.text+0x1e0): multiple definition of `Perspective::Perspective(double)'
      release/main.o:main.cpp:(.text+0x1e0): first defined here
      release/graphica3.o: In function `Perspective::Perspective(double)':
      graphica3.cpp:(.text+0x1f0): multiple definition of `Perspective::Perspective(double)'
      release/main.o:main.cpp:(.text+0x1f0): first defined here
      release/graphica3.o: In function `Perspective::setDist(double)':
      graphica3.cpp:(.text+0x200): multiple definition of `Perspective::setDist(double)'
      release/main.o:main.cpp:(.text+0x200): first defined here
      release/graphica3.o: In function `Side::anglesCount() const':
      graphica3.cpp:(.text+0x210): multiple definition of `Side::anglesCount() const'
      release/main.o:main.cpp:(.text+0x210): first defined here
      release/graphica3.o: In function `Side::nearer(Side const&) const':
      graphica3.cpp:(.text+0x220): multiple definition of `Side::nearer(Side const&) const'
      release/main.o:main.cpp:(.text+0x220): first defined here
      release/graphica3.o: In function `Side::visible() const':
      graphica3.cpp:(.text+0x270): multiple definition of `Side::visible() const'
      release/main.o:main.cpp:(.text+0x270): first defined here
      release/graphica3.o: In function `Perspective::makeFlat(VolumePoint const&)':
      graphica3.cpp:(.text+0x370): multiple definition of `Perspective::makeFlat(VolumePoint const&)'
      release/main.o:main.cpp:(.text+0x8d0): first defined here
      release/graphica3.o: In function `Transform::transformate(VolumePoint const&)const':
      graphica3.cpp:(.text+0x3b0): multiple definition of `Transform::transformate(VolumePoint const&) const'
      release/main.o:main.cpp:(.text+0x910): first defined here
      release/graphica3.o: In function `Side::~Side()':
      graphica3.cpp:(.text+0x420): multiple definition of `Side::~Side()'
      release/main.o:main.cpp:(.text+0x3a0): first defined here
      release/graphica3.o: In function `Side::~Side()':
      graphica3.cpp:(.text+0x440): multiple definition of `Side::~Side()'
      release/main.o:main.cpp:(.text+0x3c0): first defined here
      release/graphica3.o: In function `Side::operator=(Side const&)':
      graphica3.cpp:(.text+0x460): multiple definition of `Side::operator=(Side const&)'
      release/main.o:main.cpp:(.text+0x3e0): first defined here
      release/graphica3.o: In function `Side::Side(Side const&)':
      graphica3.cpp:(.text+0x510): multiple definition of `Side::Side(Side const&)'
      release/main.o:main.cpp:(.text+0x490): first defined here
      release/graphica3.o: In function `Side::Side(Side const&)':
      graphica3.cpp:(.text+0x5c0): multiple definition of `Side::Side(Side const&)'
      release/main.o:main.cpp:(.text+0x540): first defined here
      release/graphica3.o: In function `Side::Side(VolumePoint const*, unsigned int)':
      graphica3.cpp:(.text+0x670): multiple definition of `Side::Side(VolumePoint const*, unsigned int)'
      release/main.o:main.cpp:(.text+0x5f0): first defined here
      release/graphica3.o: In function `Side::Side(VolumePoint const*, unsigned int)':
      graphica3.cpp:(.text+0x7e0): multiple definition of `Side::Side(VolumePoint const*, unsigned int)'
      release/main.o:main.cpp:(.text+0x760): first defined here
      release/graphica3.o: In function `Transform::modifyTransform(double, double, double, double, double, double, double)':
      graphica3.cpp:(.text+0x950): multiple definition of `Transform::modifyTransform(double, double, double, double, double, double, double)'
      release/main.o:main.cpp:(.text+0x980): first defined here
      release/graphica3.o: In function `Transform::setTransform(double, double, double, double, double, double, double)':
      graphica3.cpp:(.text+0xb10): multiple definition of `Transform::setTransform(double, double, double, double, double, double, double)'
      release/main.o:main.cpp:(.text+0xb40): first defined here
      release/graphica3.o: In function `Transform::Transform(double, double, double, double, double, double, double)':
      graphica3.cpp:(.text+0xd80): multiple definition of `Transform::Transform(double, double, double, double, double, double, double)'
      release/main.o:main.cpp:(.text+0xdb0): first defined here
      release/graphica3.o: In function `Transform::Transform(double, double, double, double, double, double, double)':
      graphica3.cpp:(.text+0xff0): multiple definition of `Transform::Transform(double, double, double, double, double, double, double)'
      release/main.o:main.cpp:(.text+0x1020): first defined here
      release/moc_graphica3.o: In function `VolumePoint::VolumePoint()':
      moc_graphica3.cpp:(.text+0x0): multiple definition of `VolumePoint::VolumePoint()'
      release/main.o:main.cpp:(.text+0x0): first defined here
      release/moc_graphica3.o: In function `VolumePoint::VolumePoint()':
      moc_graphica3.cpp:(.text+0x20): multiple definition of `VolumePoint::VolumePoint()'
      release/main.o:main.cpp:(.text+0x20): first defined here
      release/moc_graphica3.o: In function `VolumePoint::VolumePoint(double, double, double)':
      moc_graphica3.cpp:(.text+0x40): multiple definition of `VolumePoint::VolumePoint(double, double, double)'
      release/main.o:main.cpp:(.text+0x40): first defined here
      release/moc_graphica3.o: In function `VolumePoint::VolumePoint(double, double, double)':
      moc_graphica3.cpp:(.text+0x60): multiple definition of `VolumePoint::VolumePoint(double, double, double)'
      release/main.o:main.cpp:(.text+0x60): first defined here
      release/moc_graphica3.o: In function `VolumePoint::VolumePoint(VolumePoint const&)':
      moc_graphica3.cpp:(.text+0x80): multiple definition of `VolumePoint::VolumePoint(VolumePoint const&)'
      release/main.o:main.cpp:(.text+0x80): first defined here
      release/moc_graphica3.o: In function `VolumePoint::VolumePoint(VolumePoint const&)':
      moc_graphica3.cpp:(.text+0xa0): multiple definition of `VolumePoint::VolumePoint(VolumePoint const&)'
      release/main.o:main.cpp:(.text+0xa0): first defined here
      release/moc_graphica3.o: In function `VolumePoint::setX(double)':
      moc_graphica3.cpp:(.text+0xc0): multiple definition of `VolumePoint::setX(double)'
      release/main.o:main.cpp:(.text+0xc0): first defined here
      release/moc_graphica3.o: In function `VolumePoint::setY(double)':
      moc_graphica3.cpp:(.text+0xd0): multiple definition of `VolumePoint::setY(double)'
      release/main.o:main.cpp:(.text+0xd0): first defined here
      release/moc_graphica3.o: In function `VolumePoint::setZ(double)':
      moc_graphica3.cpp:(.text+0xe0): multiple definition of `VolumePoint::setZ(double)'
      release/main.o:main.cpp:(.text+0xe0): first defined here
      release/moc_graphica3.o: In function `VolumePoint::getX() const':
      moc_graphica3.cpp:(.text+0xf0): multiple definition of `VolumePoint::getX() const'
      release/main.o:main.cpp:(.text+0xf0): first defined here
      release/moc_graphica3.o: In function `VolumePoint::getY() const':
      moc_graphica3.cpp:(.text+0x100): multiple definition of `VolumePoint::getY() const'
      release/main.o:main.cpp:(.text+0x100): first defined here
      release/moc_graphica3.o: In function `VolumePoint::getZ() const':
      moc_graphica3.cpp:(.text+0x110): multiple definition of `VolumePoint::getZ() const'
      release/main.o:main.cpp:(.text+0x110): first defined here
      release/moc_graphica3.o: In function `VolumePoint::operator!=(VolumePoint const&) const':
      moc_graphica3.cpp:(.text+0x120): multiple definition of `VolumePoint::operator!=(VolumePoint const&) const'
      release/main.o:main.cpp:(.text+0x120): first defined here
      release/moc_graphica3.o: In function `VolumePoint::operator==(VolumePoint const&) const':
      moc_graphica3.cpp:(.text+0x170): multiple definition of `VolumePoint::operator==(VolumePoint const&) const'
      release/main.o:main.cpp:(.text+0x170): first defined here
      release/moc_graphica3.o: In function `VolumePoint::operator=(VolumePoint const&)':
      moc_graphica3.cpp:(.text+0x1c0): multiple definition of `VolumePoint::operator=(VolumePoint const&)'
      release/main.o:main.cpp:(.text+0x1c0): first defined here
      release/moc_graphica3.o: In function `Perspective::Perspective(double)':
      moc_graphica3.cpp:(.text+0x1e0): multiple definition of `Perspective::Perspective(double)'
      release/main.o:main.cpp:(.text+0x1e0): first defined here
      release/moc_graphica3.o: In function `Perspective::Perspective(double)':
      moc_graphica3.cpp:(.text+0x1f0): multiple definition of `Perspective::Perspective(double)'
      release/main.o:main.cpp:(.text+0x1f0): first defined here
      release/moc_graphica3.o: In function `Perspective::setDist(double)':
      moc_graphica3.cpp:(.text+0x200): multiple definition of `Perspective::setDist(double)'
      release/main.o:main.cpp:(.text+0x200): first defined here
      release/moc_graphica3.o: In function `Side::anglesCount() const':
      moc_graphica3.cpp:(.text+0x210): multiple definition of `Side::anglesCount() const'
      release/main.o:main.cpp:(.text+0x210): first defined here
      release/moc_graphica3.o: In function `Side::nearer(Side const&) const':
      moc_graphica3.cpp:(.text+0x220): multiple definition of `Side::nearer(Side const&) const'
      release/main.o:main.cpp:(.text+0x220): first defined here
      release/moc_graphica3.o: In function `Side::visible() const':
      moc_graphica3.cpp:(.text+0x270): multiple definition of `Side::visible() const'
      release/main.o:main.cpp:(.text+0x270): first defined here
      release/moc_graphica3.o: In function `Side::~Side()':
      moc_graphica3.cpp:(.text+0x370): multiple definition of `Side::~Side()'
      release/main.o:main.cpp:(.text+0x3a0): first defined here
      release/moc_graphica3.o: In function `Side::~Side()':
      moc_graphica3.cpp:(.text+0x390): multiple definition of `Side::~Side()'
      release/main.o:main.cpp:(.text+0x3c0): first defined here
      release/moc_graphica3.o: In function `Side::operator=(Side const&)':
      moc_graphica3.cpp:(.text+0x3b0): multiple definition of `Side::operator=(Sideconst&)'
      release/main.o:main.cpp:(.text+0x3e0): first defined here
      release/moc_graphica3.o: In function `Side::Side(Side const&)':
      moc_graphica3.cpp:(.text+0x460): multiple definition of `Side::Side(Side const&)'
      release/main.o:main.cpp:(.text+0x490): first defined here
      release/moc_graphica3.o: In function `Side::Side(Side const&)':
      moc_graphica3.cpp:(.text+0x510): multiple definition of `Side::Side(Side const&)'
      release/main.o:main.cpp:(.text+0x540): first defined here
      release/moc_graphica3.o: In function `Side::Side(VolumePoint const*, unsignedint)':
      moc_graphica3.cpp:(.text+0x5c0): multiple definition of `Side::Side(VolumePoint const*, unsigned int)'
      release/main.o:main.cpp:(.text+0x5f0): first defined here
      release/moc_graphica3.o: In function `Side::Side(VolumePoint const*, unsignedint)':
      moc_graphica3.cpp:(.text+0x730): multiple definition of `Side::Side(VolumePoint const*, unsigned int)'
      release/main.o:main.cpp:(.text+0x760): first defined here
      release/moc_graphica3.o: In function `Perspective::makeFlat(VolumePoint const&)':
      moc_graphica3.cpp:(.text+0x8a0): multiple definition of `Perspective::makeFlat(VolumePoint const&)'
      release/main.o:main.cpp:(.text+0x8d0): first defined here
      release/moc_graphica3.o: In function `Transform::transformate(VolumePoint const&) const':
      moc_graphica3.cpp:(.text+0x8e0): multiple definition of `Transform::transformate(VolumePoint const&) const'
      release/main.o:main.cpp:(.text+0x910): first defined here
      release/moc_graphica3.o: In function `Transform::modifyTransform(double, double, double, double, double, double, double)':
      moc_graphica3.cpp:(.text+0x950): multiple definition of `Transform::modifyTransform(double, double, double, double, double, double, double)'
      release/main.o:main.cpp:(.text+0x980): first defined here
      release/moc_graphica3.o: In function `Transform::setTransform(double, double,double, double, double, double, double)':
      moc_graphica3.cpp:(.text+0xb10): multiple definition of `Transform::setTransform(double, double, double, double, double, double, double)'
      release/main.o:main.cpp:(.text+0xb40): first defined here
      release/moc_graphica3.o: In function `Transform::Transform(double, double, double, double, double, double, double)':
      moc_graphica3.cpp:(.text+0xd80): multiple definition of `Transform::Transform(double, double, double, double, double, double, double)'
      release/main.o:main.cpp:(.text+0xdb0): first defined here
      release/moc_graphica3.o: In function `Transform::Transform(double, double, double, double, double, double, double)':
      moc_graphica3.cpp:(.text+0xff0): multiple definition of `Transform::Transform(double, double, double, double, double, double, double)'
      release/main.o:main.cpp:(.text+0x1020): first defined here
      collect2: ld returned 1 exit status
      make[1]: *** [Graphica3] Ошибка 1
      make[1]: Leaving directory `/media/disk-1/Graphica3'
      make: *** [release] Ошибка 2


    может кто-то встречал что-то подобное? Или хотя бы подскажет где смотреть?
      вероятно у того файла что заинклуден в graphica3.cpp и main.cpp отсутствует #prаgma once (#ifndef .. #define .. #endif)
      Сообщение отредактировано: mes -
        не, всё есть. (((
          Цитата Рамабахара @
          Редефиниций нету

          Значит таки есть, тока компилятор их не видит
          Обрати внимание, что определения перечисленных функций должны попадать только в один из .o файлов. В хедере оформляй классы с инлайн функциями, как то:
          ExpandedWrap disabled
            class Side
            {
               bool visible() const
               { //Писать сюда
               }
            };
            bool Side::visible()const //В хедер файлах такое недопустимо
            { //Ошибка
            }

          Цитата mes @
          отсутствует #prаgma once (#ifndef .. #define .. #endif)

          В данном случае это не поможет, иначе бы ругался компилятор а не линкер.
            вопрос решен. Это с#ка зло#бучий gcc не осиливал много функций из хидеров выбирать. У него, видимо, тупо кончались уникальные идентификаторы для функций и он начинал плужить в объектники. А линкер, само-собой меня радовал выше приложенной простынёй.


            Мораль: Никогда без необходимости не объявляйте тело функций в .h файлах.
            Я её надолго запомню. Сутки уже мчался.
            1 пользователей читают эту тему (1 гостей и 0 скрытых пользователей)
            0 пользователей:


            Рейтинг@Mail.ru
            [ Script execution time: 0.0703 ]   [ 15 queries used ]   [ Generated: 24.07.26, 13:00 GMT ]