![]() |
Здравствуйте, гость ( Вход | Регистрация )
![]() |
defnull |
![]()
Сообщение
#1
|
Студент ![]() Группа: Участник Сообщений: 49 Регистрация: 1.5.2008 Пользователь №: 165 Спасибо сказали: 0 раз(а) Репутация: ![]() ![]() ![]() |
Добрый день. Столкнулся с проблемой переноса работающих QT приложений на другие машины. Было решено использовать статическую сборку.
1) Установил Qt. 4.3.4 2) Выставил переменные окружения. 3) Открыл Visual Studio 2005 Command Prompt и соответственно войдя в папку с QT выбрал configure -static && nmake После длительной сборки установил интегратор QT на VS. Открываю VS 2005 интегратор встал нормально, всё ок. При попытке компилирования линкер не нашёл библиотеки QtCored4.lib. Я читал статью по линковке на сайте и помнил что при статической линковке либы меняют свои названия в которых пропадают буквы. В свойствах проекта, в линкере указал необходимые либы, просто убрав цифру 4. После чего вроде как либы он видит.. но посыпалось уйма ошибок линкера. CODE ------ Build started: Project: qt_kashestvo, Configuration: Debug Win32 ------ Linking... LINK : C:\Share\qt_kashestvo\Debug\qt_kashestvo.exe not found or not built by the last incremental link; performing full link main.obj : warning LNK4217: locally defined symbol ??1QApplication@@UAE@XZ (public: virtual __thiscall QApplication::~QApplication(void)) imported in function _main main.obj : warning LNK4217: locally defined symbol ?exec@QApplication@@SAHXZ (public: static int __cdecl QApplication::exec(void)) imported in function _main main.obj : warning LNK4217: locally defined symbol ?show@QWidget@@QAEXXZ (public: void __thiscall QWidget::show(void)) imported in function _main main.obj : warning LNK4217: locally defined symbol ??0QApplication@@QAE@AAHPAPADH@Z (public: __thiscall QApplication::QApplication(int &,char * *,int)) imported in function _main main.obj : warning LNK4217: locally defined symbol ??1QWidget@@UAE@XZ (public: virtual __thiscall QWidget::~QWidget(void)) imported in function "public: virtual __thiscall Window_mein::~Window_mein(void)" (??1Window_mein@@UAE@XZ) window_mein.obj : warning LNK4049: locally defined symbol ??1QWidget@@UAE@XZ (public: virtual __thiscall QWidget::~QWidget(void)) imported window_mein.obj : warning LNK4217: locally defined symbol ?setLayout@QWidget@@QAEXPAVQLayout@@@Z (public: void __thiscall QWidget::setLayout(class QLayout *)) imported in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ?addLayout@QBoxLayout@@QAEXPAVQLayout@@H@Z (public: void __thiscall QBoxLayout::addLayout(class QLayout *,int)) imported in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ?addStretch@QBoxLayout@@QAEXH@Z (public: void __thiscall QBoxLayout::addStretch(int)) imported in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ?addWidget@QBoxLayout@@QAEXPAVQWidget@@HV?$QFlags@W4AlignmentFlag@Qt@@@@@Z (public: void __thiscall QBoxLayout::addWidget(class QWidget *,int,class QFlags<enum Qt::AlignmentFlag>)) imported in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ?setItem@QTableWidget@@QAEXHHPAVQTableWidgetItem@@@Z (public: void __thiscall QTableWidget::setItem(int,int,class QTableWidgetItem *)) imported in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ??0QTableWidgetItem@@QAE@ABVQString@@H@Z (public: __thiscall QTableWidgetItem::QTableWidgetItem(class QString const &,int)) imported in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ?setEditTriggers@QAbstractItemView@@QAEXV?$QFlags@W4EditTrigger@QAbstractItemView@@@@@Z (public: void __thiscall QAbstractItemView::setEditTriggers(class QFlags<enum QAbstractItemView::EditTrigger>)) imported in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ?setVerticalHeaderLabels@QTableWidget@@QAEXABVQStringList@@@Z (public: void __thiscall QTableWidget::setVerticalHeaderLabels(class QStringList const &)) imported in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ?setHorizontalHeaderLabels@QTableWidget@@QAEXABVQStringList@@@Z (public: void __thiscall QTableWidget::setHorizontalHeaderLabels(class QStringList const &)) imported in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ?number@QString@@SA?AV1@HH@Z (public: static class QString __cdecl QString::number(int,int)) imported in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ?connect@QObject@@QBE_NPBV1@PBD1W4ConnectionType@Qt@@@Z (public: bool __thiscall QObject::connect(class QObject const *,char const *,char const *,enum Qt::ConnectionType)const ) imported in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ??1QString@@QAE@XZ (public: __thiscall QString::~QString(void)) imported in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ??0QPushButton@@QAE@ABVQString@@PAVQWidget@@@Z (public: __thiscall QPushButton::QPushButton(class QString const &,class QWidget *)) imported in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ??0QComboBox@@QAE@PAVQWidget@@@Z (public: __thiscall QComboBox::QComboBox(class QWidget *)) imported in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ??0QTableWidget@@QAE@HHPAVQWidget@@@Z (public: __thiscall QTableWidget::QTableWidget(int,int,class QWidget *)) imported in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ??0QVBoxLayout@@QAE@XZ (public: __thiscall QVBoxLayout::QVBoxLayout(void)) imported in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ??0QHBoxLayout@@QAE@XZ (public: __thiscall QHBoxLayout::QHBoxLayout(void)) imported in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ??0QWidget@@QAE@PAV0@V?$QFlags@W4WindowType@Qt@@@@@Z (public: __thiscall QWidget::QWidget(class QWidget *,class QFlags<enum Qt::WindowType>)) imported in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ??1QHBoxLayout@@UAE@XZ (public: virtual __thiscall QHBoxLayout::~QHBoxLayout(void)) imported in function "public: virtual void * __thiscall QHBoxLayout::`scalar deleting destructor'(unsigned int)" (??_GQHBoxLayout@@UAEPAXI@Z) window_mein.obj : warning LNK4217: locally defined symbol ??1QVBoxLayout@@UAE@XZ (public: virtual __thiscall QVBoxLayout::~QVBoxLayout(void)) imported in function "public: virtual void * __thiscall QVBoxLayout::`scalar deleting destructor'(unsigned int)" (??_GQVBoxLayout@@UAEPAXI@Z) window_mein.obj : warning LNK4217: locally defined symbol ??1QTableWidget@@UAE@XZ (public: virtual __thiscall QTableWidget::~QTableWidget(void)) imported in function "public: virtual void * __thiscall QTableWidget::`scalar deleting destructor'(unsigned int)" (??_GQTableWidget@@UAEPAXI@Z) window_mein.obj : warning LNK4217: locally defined symbol ??1QComboBox@@UAE@XZ (public: virtual __thiscall QComboBox::~QComboBox(void)) imported in function "public: virtual void * __thiscall QComboBox::`scalar deleting destructor'(unsigned int)" (??_GQComboBox@@UAEPAXI@Z) window_mein.obj : warning LNK4217: locally defined symbol ??1QPushButton@@UAE@XZ (public: virtual __thiscall QPushButton::~QPushButton(void)) imported in function "public: virtual void * __thiscall QPushButton::`scalar deleting destructor'(unsigned int)" (??_GQPushButton@@UAEPAXI@Z) window_mein.obj : warning LNK4217: locally defined symbol ??1QTableWidgetItem@@UAE@XZ (public: virtual __thiscall QTableWidgetItem::~QTableWidgetItem(void)) imported in function "public: virtual void * __thiscall QTableWidgetItem::`scalar deleting destructor'(unsigned int)" (??_GQTableWidgetItem@@UAEPAXI@Z) window_mein.obj : warning LNK4217: locally defined symbol ?setEnabled@QWidget@@QAEX_N@Z (public: void __thiscall QWidget::setEnabled(bool)) imported in function "public: void __thiscall Window_mein::indexC(int)" (?indexC@Window_mein@@QAEXH@Z) window_mein.obj : warning LNK4217: locally defined symbol ?setText@QTableWidgetItem@@QAEXABVQString@@@Z (public: void __thiscall QTableWidgetItem::setText(class QString const &)) imported in function "public: void __thiscall Window_mein::obrabotka(void)" (?obrabotka@Window_mein@@QAEXXZ) window_mein.obj : warning LNK4217: locally defined symbol ?number@QString@@SA?AV1@NDH@Z (public: static class QString __cdecl QString::number(double,char,int)) imported in function "public: void __thiscall Window_mein::obrabotka(void)" (?obrabotka@Window_mein@@QAEXXZ) window_mein.obj : warning LNK4217: locally defined symbol ?takeItem@QTableWidget@@QAEPAVQTableWidgetItem@@HH@Z (public: class QTableWidgetItem * __thiscall QTableWidget::takeItem(int,int)) imported in function "public: void __thiscall Window_mein::obrabotka(void)" (?obrabotka@Window_mein@@QAEXXZ) window_mein.obj : warning LNK4049: locally defined symbol ?shared_null@QListData@@2UData@1@A (public: static struct QListData::Data QListData::shared_null) imported window_mein.obj : warning LNK4217: locally defined symbol ??0QString@@QAE@ABV0@@Z (public: __thiscall QString::QString(class QString const &)) imported in function "public: void __thiscall QList<class QString>::append(class QString const &)" (?append@?$QList@VQString@@@@QAEXABVQString@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ?append@QListData@@QAEPAPAXXZ (public: void * * __thiscall QListData::append(void)) imported in function "public: void __thiscall QList<class QString>::append(class QString const &)" (?append@?$QList@VQString@@@@QAEXABVQString@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ?end@QListData@@QBEPAPAXXZ (public: void * * __thiscall QListData::end(void)const ) imported in function "private: void __thiscall QList<class QString>::detach_helper(void)" (?detach_helper@?$QList@VQString@@@@AAEXXZ) window_mein.obj : warning LNK4217: locally defined symbol ?detach2@QListData@@QAEPAUData@1@XZ (public: struct QListData::Data * __thiscall QListData::detach2(void)) imported in function "private: void __thiscall QList<class QString>::detach_helper(void)" (?detach_helper@?$QList@VQString@@@@AAEXXZ) window_mein.obj : warning LNK4217: locally defined symbol ?begin@QListData@@QBEPAPAXXZ (public: void * * __thiscall QListData::begin(void)const ) imported in function "private: void __thiscall QList<class QString>::detach_helper(void)" (?detach_helper@?$QList@VQString@@@@AAEXXZ) window_mein.obj : warning LNK4217: locally defined symbol ?qFree@@YAXPAX@Z (void __cdecl qFree(void *)) imported in function "private: void __thiscall QList<class QString>::free(struct QListData::Data *)" (?free@?$QList@VQString@@@@AAEXPAUData@QListData@@@Z) window_mein.obj : warning LNK4217: locally defined symbol ??4QString@@QAEAAV0@ABV0@@Z (public: class QString & __thiscall QString::operator=(class QString const &)) imported in function "private: void __thiscall QList<class QString>::node_construct(struct QList<class QString>::Node *,class QString const &)" (?node_construct@?$QList@VQString@@@@AAEXPAUNode@1@ABVQString@@@Z) window_mein.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall QComboBox::addItems(class QStringList const &)" (__imp_?addItems@QComboBox@@QAEXABVQStringList@@@Z) referenced in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) window_mein.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QString::QString(char const *)" (__imp_??0QString@@QAE@PBD@Z) referenced in function "public: __thiscall Window_mein::Window_mein(class QWidget *)" (??0Window_mein@@QAE@PAVQWidget@@@Z) QtCored.lib(qeventdispatcher_win.obj) : error LNK2019: unresolved external symbol _WSAAsyncSelect@16 referenced in function "public: void __thiscall QEventDispatcherWin32Private::doWsaAsyncSelect(int)" (?doWsaAsyncSelect@QEventDispatcherWin32Private@@QAEXH@Z) QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmSetCandidateWindow@8 referenced in function "public: virtual void __thiscall QWinInputContext::update(void)" (?update@QWinInputContext@@UAEXXZ) QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmSetCompositionWindow@8 referenced in function "public: virtual void __thiscall QWinInputContext::update(void)" (?update@QWinInputContext@@UAEXXZ) QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmSetCompositionFontA@8 referenced in function "public: virtual void __thiscall QWinInputContext::update(void)" (?update@QWinInputContext@@UAEXXZ) QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmSetCompositionFontW@8 referenced in function "public: virtual void __thiscall QWinInputContext::update(void)" (?update@QWinInputContext@@UAEXXZ) QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmGetContext@4 referenced in function "struct HIMC__ * __cdecl getContext(struct HWND__ *)" (?getContext@@YAPAUHIMC__@@PAUHWND__@@@Z) QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmReleaseContext@8 referenced in function "void __cdecl releaseContext(struct HWND__ *,struct HIMC__ *)" (?releaseContext@@YAXPAUHWND__@@PAUHIMC__@@@Z) QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmNotifyIME@16 referenced in function "void __cdecl notifyIME(struct HIMC__ *,unsigned long,unsigned long,unsigned long)" (?notifyIME@@YAXPAUHIMC__@@KKK@Z) QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmGetCompositionStringA@16 referenced in function "long __cdecl getCompositionString(struct HIMC__ *,unsigned long,void *,unsigned long,bool *)" (?getCompositionString@@YAJPAUHIMC__@@KPAXKPA_N@Z) QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmGetCompositionStringW@16 referenced in function "long __cdecl getCompositionString(struct HIMC__ *,unsigned long,void *,unsigned long,bool *)" (?getCompositionString@@YAJPAUHIMC__@@KPAXKPA_N@Z) QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmAssociateContext@8 referenced in function "public: static void __cdecl QWinInputContext::enable(class QWidget *,bool)" (?enable@QWinInputContext@@SAXPAVQWidget@@_N@Z) QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmGetDefaultIMEWnd@4 referenced in function "struct HWND__ * __cdecl getDefaultIMEWnd(struct HWND__ *)" (?getDefaultIMEWnd@@YAPAUHWND__@@PAU1@@Z) QtGuid.lib(qaccessible_win.obj) : error LNK2019: unresolved external symbol __imp__PlaySoundA@12 referenced in function "public: static void __cdecl QAccessible::updateAccessibility(class QObject *,int,enum QAccessible::Event)" (?updateAccessibility@QAccessible@@SAXPAVQObject@@HW4Event@1@@Z) C:\Share\qt_kashestvo\Debug\qt_kashestvo.exe : fatal error LNK1120: 15 unresolved externals Build log was saved at "file://c:\Share\qt_kashestvo\qt_kashestvo\Debug\BuildLog.htm" qt_kashestvo - 16 error(s), 42 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== Подскажите пожайлуста в чём может быть моя ошибка?Всё вышенаписанное делал на виртуальной машине, ибо на домашней всё скомпилированно по дефолту (я так понимаю что если в configure не указывать атрибутов то на выходе получаем динамическую линковку), всё работает и трогать не хотелось. Эта программа работала на домашней машине, поэтому имхо сомнительно что ошиби в коде.. В принципе вариант со статической линковкой был выбран только для того чтобы бытро всё сделать, ибо время поджимает. Поэтому если вы можете подсказать как сделать перенос динамический буду рад, ибо на данный момент главное именно перенести приложение. (з.ы. ) з.з.ы Плохо знаком с настройкой свойств проектов в VS, да и просто необходимых настроек компиляции, может быть кто-нибудь может посоветовать что-нибудь по этой теме??? |
|
|
![]() ![]() ![]() |
![]() |
|
Текстовая версия | Сейчас: 22.4.2025, 20:23 |