|
藍森林 http://www.lslnet.com 2006年8月18日 15:18
在make時出現的聯接錯誤:到底這個多重定義是在哪個文件中?
/home/yfx/vcm/npuvcm/gui/PrEditorDialog.o(.bss+0x14):/usr/include/Inventor/SbString.h:85: multiple definition of `mygrid'
/home/yfx/vcm/npuvcm/gui/TempEditorDialog.o(.bss+0x4):/usr/local/ViewKit/include/Vk/VkApp.h:234: first defined here
/home/yfx/vcm/npuvcm/gui/PrEditorDialog.o(.bss+0x1c):/home/yfx/vcm/npuvcm/goodies/2ascii.h:50: multiple definition of `markcpos'
/home/yfx/vcm/npuvcm/gui/TempEditorDialog.o(.bss+0x8):/home/yfx/vcm/npuvcm/goodies/2ascii.h:10: first defined here
/home/yfx/vcm/npuvcm/gui/PrEditorDialog.o(.bss+0x28):/usr/include/Inventor/fields/SoSFFloat.h:71: multiple definition of `imarkcpos'
/home/yfx/vcm/npuvcm/gui/TempEditorDialog.o(.bss+0x14):/usr/include/Inventor/SbString.h:85: first defined here
/home/yfx/vcm/npuvcm/gui/PrEditorDialog.o(.bss+0x2c):/usr/include/Inventor/fields/SoField.h:272: multiple definition of `homecpos'
/home/yfx/vcm/npuvcm/gui/TempEditorDialog.o(.bss+0x18):/usr/include/Inventor/SbBox.h:207: first defined here
/home/yfx/vcm/npuvcm/gui/TempEditorDialog.o(.text+0x64): In function `TempEditorDialog::TempEditorDialog[not-in-charge](char const*, Arg*, unsigned)':
/home/yfx/vcm/npuvcm/goodies/2ascii.h:60: undefined reference to `TempEditorDialog::setParent(VkSimpleWindow*)'
/home/yfx/vcm/npuvcm/gui/TempEditorDialog.o(.text+0xf8): In function `TempEditorDialog::TempEditorDialog[in-charge](char const*, Arg*, unsigned)':
/home/yfx/vcm/npuvcm/goodies/2ascii.h:37: undefined reference to `TempEditorDialog::setParent(VkSimpleWindow*)'
collect2: ld returned 1 exit status
make: *** [default] Error 1
以上錯誤中到底哪個是多重定義了?多重定義的文件是在哪個文件中?
我有點看不明白了.
謝謝! |
在make時出現的聯接錯誤:到底這個多重定義是在哪個文件中?
如何解決這個問題?
非常感謝! |
在make時出現的聯接錯誤:到底這個多重定義是在哪個文件中?
已經解決:
If you have defined a public member data mygrid in class A and class B, then, you can compile them ok seperately. But, when you link them in the application, the error msg will be displayed as above.
It is just for the reason that: the compiler cann't locat the correct mygrid for class A or B with the same name "mygrid->;show()".
So, just to rename aGrid for the class A's mygrid and bGrid for class B. |
在make時出現的聯接錯誤:到底這個多重定義是在哪個文件中?
of course, you can define them as private. |
| |