странная, просто необъяснимая ошибка
, Qt 4.3.1, gcc 4.2.1
![]() |
Наши проекты:
Журнал · Discuz!ML · Wiki · DRKB · Помощь проекту |
|
| ПРАВИЛА | FAQ | Помощь | Поиск | Участники | Календарь | Избранное | RSS |
| [216.73.216.249] |
|
|
Правила раздела *nix / gcc / Eclipse / Qt / wxWidgets / GTK+
странная, просто необъяснимая ошибка
, Qt 4.3.1, gcc 4.2.1
|
|
|
|
|
Ошибка появилась внезапно. Причин понять никак не могу. Редефиниций нету. Без Qt файлы собираются.
Сообщение об ошибке: ![]() ![]() 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 может кто-то встречал что-то подобное? Или хотя бы подскажет где смотреть? |
|
Сообщ.
#2
,
|
|
|
|
вероятно у того файла что заинклуден в graphica3.cpp и main.cpp отсутствует #prаgma once (#ifndef .. #define .. #endif)
|
|
Сообщ.
#3
,
|
|
|
|
не, всё есть. (((
|
|
Сообщ.
#4
,
|
|
|
|
Цитата Рамабахара @ Редефиниций нету Значит таки есть, тока компилятор их не видит Обрати внимание, что определения перечисленных функций должны попадать только в один из .o файлов. В хедере оформляй классы с инлайн функциями, как то: ![]() ![]() class Side { bool visible() const { //Писать сюда } }; bool Side::visible()const //В хедер файлах такое недопустимо { //Ошибка } Цитата mes @ отсутствует #prаgma once (#ifndef .. #define .. #endif) В данном случае это не поможет, иначе бы ругался компилятор а не линкер. |
|
Сообщ.
#5
,
|
|
|
|
вопрос решен. Это с#ка зло#бучий gcc не осиливал много функций из хидеров выбирать. У него, видимо, тупо кончались уникальные идентификаторы для функций и он начинал плужить в объектники. А линкер, само-собой меня радовал выше приложенной простынёй.
Мораль: Никогда без необходимости не объявляйте тело функций в .h файлах. Я её надолго запомню. Сутки уже мчался. |