PDA

View Full Version : Problem with the SoQt-1.5.0,would some one help me!



xiongxiongchuan
20th May 2010, 02:47
i use the visual c++2008 and QT4.6.2 and Qt4 Visual Studio Add-in complied the SoQt-1.5.0 ,but when i test the following code:
#include <Inventor/Qt/SoQt.h>
#include <Inventor/Qt/viewers/SoQtExaminerViewer.h>

#include <Inventor/nodes/SoCube.h>
#include <Inventor/nodes/SoCallback.h>
#include <Inventor/nodes/SoSeparator.h>

#include <Inventor/actions/SoHandleEventAction.h>
#include <Inventor/events/SoMouseButtonEvent.h>

#include <stdlib.h>
#include <stdio.h>

void
callback(void * closure, SoAction * action)
{
if ( action->isOfType(SoHandleEventAction::getClassTypeId()) ) {
SoHandleEventAction * heaction =
(SoHandleEventAction *) action;
if ( heaction->getEvent()->isOfType(SoMouseButtonEvent::getClassTypeId()) ) {
SoSeparator * sep = (SoSeparator *) closure;
sep->addChild(NULL); // trigger assert inside Coin
}
}
}

int
main(int argc, char ** argv)
{
QWidget * win = SoQt::init("Debug Test");
SoQtExaminerViewer * viewer = new SoQtExaminerViewer(win);
viewer->show();
SoQt::show(win);
SoSeparator * sep = new SoSeparator;
SoCallback * cb = new SoCallback;
cb->setCallback(callback, sep);
sep->addChild(cb);
sep->addChild(new SoCube);
viewer->setSceneGraph(sep);
viewer->setViewing(FALSE);
SoQt::mainLoop();
viewer->hide();
// delete viewer;
return 0;
}


it complier has errors like this :
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: int __thiscall SoEvent::isOfType(class SoType)const " (__imp_?isOfType@SoEvent@@QBEHVSoType@@@Z),该符号在函数 "void __cdecl callback(void *,class SoAction *)" (?callback@@YAXPAXPAVSoAction@@@Z) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class SoEvent const * __thiscall SoHandleEventAction::getEvent(void)const " (__imp_?getEvent@SoHandleEventAction@@QBEPBVSoEven t@@XZ),该符号在函数 "void __cdecl callback(void *,class SoAction *)" (?callback@@YAXPAXPAVSoAction@@@Z) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static class SoType __cdecl SoMouseButtonEvent::getClassTypeId(void)" (__imp_?getClassTypeId@SoMouseButtonEvent@@SA?AVSo Type@@XZ),该符号在函数 "void __cdecl callback(void *,class SoAction *)" (?callback@@YAXPAXPAVSoAction@@@Z) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static class SoType __cdecl SoHandleEventAction::getClassTypeId(void)" (__imp_?getClassTypeId@SoHandleEventAction@@SA?AVS oType@@XZ),该符号在函数 "void __cdecl callback(void *,class SoAction *)" (?callback@@YAXPAXPAVSoAction@@@Z) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static void __cdecl SoQt::mainLoop(void)" (__imp_?mainLoop@SoQt@@SAXXZ),该符号在函数 _main 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall SoCube::SoCube(void)" (__imp_??0SoCube@@QAE@XZ),该符号在函数 _main 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall SoCallback::setCallback(void (__cdecl*)(void *,class SoAction *),void *)" (__imp_?setCallback@SoCallback@@QAEXP6AXPAXPAVSoAc tion@@@Z0@Z),该符号在函数 _main 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall SoCallback::SoCallback(void)" (__imp_??0SoCallback@@QAE@XZ),该符号在函数 _main 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall SoSeparator::SoSeparator(void)" (__imp_??0SoSeparator@@QAE@XZ),该符号在函数 _main 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static void __cdecl SoQt::show(class QWidget * const)" (__imp_?show@SoQt@@SAXQAVQWidget@@@Z),该符号在函数 _main 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall SoQtExaminerViewer::SoQtExaminerViewer(class QWidget *,char const *,int,enum SoQtFullViewer::BuildFlag,enum SoQtViewer::Type)" (__imp_??0SoQtExaminerViewer@@QAE@PAVQWidget@@PBDH W4BuildFlag@SoQtFullViewer@@W4Type@SoQtViewer@@@Z) ,该符号在函数 _main 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static class QWidget * __cdecl SoQt::init(char const *,char const *)" (__imp_?init@SoQt@@SAPAVQWidget@@PBD0@Z),该符号在函数 _main 中被引用
1>main.obj : error LNK2001: 无法解析的外部符号 "public: virtual class SoType __thiscall SoQtExaminerViewer::getTypeId(void)const " (?getTypeId@SoQtExaminerViewer@@UBE?AVSoType@@XZ)
1>main.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall SoQtComponent::show(void)" (?show@SoQtComponent@@UAEXXZ)
1>main.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall SoQtComponent::hide(void)" (?hide@SoQtComponent@@UAEXXZ)
1>main.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall SoQtFullViewer::setComponentCursor(class SoQtCursor const &)" (?setComponentCursor@SoQtFullViewer@@UAEXABVSoQtCu rsor@@@Z)
1>main.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall SoQtExaminerViewer::afterRealizeHook(void)" (?afterRealizeHook@SoQtExaminerViewer@@MAEXXZ)
1>main.obj : error LNK2001: 无法解析的外部符号 "protected: virtual char const * __thiscall SoQtExaminerViewer::getDefaultWidgetName(void)cons t " (?getDefaultWidgetName@SoQtExaminerViewer@@MBEPBDX Z)
1>main.obj : error LNK2001: 无法解析的外部符号 "protected: virtual char const * __thiscall SoQtExaminerViewer::getDefaultTitle(void)const " (?getDefaultTitle@SoQtExaminerViewer@@MBEPBDXZ)
1>main.obj : error LNK2001: 无法解析的外部符号 "protected: virtual char const * __thiscall SoQtExaminerViewer::getDefaultIconTitle(void)const " (?getDefaultIconTitle@SoQtExaminerViewer@@MBEPBDXZ )
1>main.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall SoQtFullViewer::sizeChanged(class SbVec2s const &)" (?sizeChanged@SoQtFullViewer@@MAEXABVSbVec2s@@@Z)
1>main.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __thiscall SoQtViewer::setDoubleBuffer(int)" (?setDoubleBuffer@SoQtViewer@@UAEXH@Z)
1>main.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall SoQtRenderArea::processEvent(class QEvent *)" (?processEvent@SoQtRenderArea@@MAEXPAVQEvent@@@Z)
1>main.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall SoQtRenderArea::redraw(void)" (?redraw@SoQtRenderArea@@MAEXXZ)
1>main.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall SoQtRenderArea::redrawOverlay(void)" (?redrawOverlay@SoQtRenderArea@@MAEXXZ)
1>main.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall SoQtRenderArea::initGraphic(void)" (?initGraphic@SoQtRenderArea@@MAEXXZ)
1>main.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall SoQtRenderArea::initOverlayGraphic(void)" (?initOverlayGraphic@SoQtRenderArea@@MAEXXZ)
1>main.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __thiscall SoQtRenderArea::widgetChanged(class QWidget *)" (?widgetChanged@SoQtRenderArea@@MAEXPAVQWidget@@@Z )

anyone can help me?
thanks in advance