【发布时间】:2011-08-30 03:59:18
【问题描述】:
这个函数是全局的,定义在头文件中(暂时我想保留在那里)。
头文件还构成一个具有内联函数的特定类,其中一个函数调用 this 全局函数。
源文件不包含任何出现问题的全局函数。
关于错误原因的任何提示?
如果有人感兴趣,我可以发布代码。
mainwindow.o: In function `tileForCoordinate(double, double, int)':
mainwindow.cpp:(.text+0x310): multiple definition of `tileForCoordinate(double, double, int)'
main.o:main.cpp:(.text+0xd0): first defined here
moc_mainwindow.o: In function `qHash(QPoint const&)':
moc_mainwindow.cpp:(.text+0x0): multiple definition of `qHash(QPoint const&)'
main.o:main.cpp:(.text+0x0): first defined here
moc_mainwindow.o: In function `tileForCoordinate(double, double, int)':
moc_mainwindow.cpp:(.text+0x150): multiple definition of `tileForCoordinate(double, double, int)'
main.o:main.cpp:(.text+0xd0): first defined here
collect2: ld returned 1 exit status
make: *** [SimpleRouting] Error 1
【问题讨论】:
标签: c++ qt multiple-definition-error