Russian Qt Forum
Апрель 29, 2024, 13:58 *
Добро пожаловать, Гость. Пожалуйста, войдите или зарегистрируйтесь.
Вам не пришло письмо с кодом активации?

Войти
 
  Начало   Форум  WIKI (Вики)FAQ Помощь Поиск Войти Регистрация  

Страниц: [1]   Вниз
  Печать  
Автор Тема: Qt и ActiveX: проблема  (Прочитано 12100 раз)
USergey
Гость
« : Июль 19, 2006, 09:46 »

Есть следующий код
Код:

...
#include <qaxwidget.h>
...

QAxWidget* wmp = new QAxWidget(this);
wmp->setControl("{22D6F312-B0F6-11D0-94AB-0080C74C7E95}");


При линковке выдает следующее:

main.obj : error LNK2001: unresolved external symbol "public: bool __thiscall QAxBase::setControl(class QString const &)" (?setControl@QAxBase@@QAE_NABVQString@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall QAxWidget::QAxWidget(class QWidget *,char const *,unsigned int)" (??0QAxWidget@@QAE@PAVQWidget@@PBDI@Z)
Debug/ax.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

Пробовал различные модификации создания экземпляра класса QAxWidget, но в результате одно и то же. Не подскажите в чем может быть проблема?
Qt 3.3.5
Заранее спасибо.
Записан
DenKor
Гость
« Ответ #1 : Июль 19, 2006, 09:58 »

Например в том. Что в проект нужно включить qaxwidget.cpp.
Т.е. файл где реализован код используемых тобой методов
Записан
Sergeich
Гость
« Ответ #2 : Июль 19, 2006, 10:53 »

LIBS += qaxcontainer.lib
пробовал?
Записан
USergey
Гость
« Ответ #3 : Июль 19, 2006, 11:48 »

Цитата: "Sergeich"
LIBS += qaxcontainer.lib
пробовал?

Спасибо, вопрос исчерпан
Записан
ufna
Гость
« Ответ #4 : Март 15, 2008, 09:47 »

Подниму эту тему, т.к. столкнулся со схожей проблемой  Грустный
Только добавление .lib не помогает, куча unresolved external лезет. Либы пересобрал студией 2005. То же самое.
В чем может быть проблема?  Непонимающий
Записан
ufna
Гость
« Ответ #5 : Март 15, 2008, 10:49 »

Проблема решена. Надо было добавить еще в линковку несколько не кутяшных библиотек.
Записан
Jpost
Гость
« Ответ #6 : Март 27, 2009, 09:57 »

Проблема решена. Надо было добавить еще в линковку несколько не кутяшных библиотек.
У меня тоже подобная проблема компилятор пришет
mingw32-make release
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Documents and Settings/jpost.LOCALNET/workspace/proba2'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o release\proba2.exe release/obzor304lib.o release/main.o release/proba2.o release/moc_proba2.o  -L"c:\Qt\2009.01\qt\lib" -lmingw32 -lqtmain -lQAxContainer -lQtGui4 -lQtCore4
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxobject.o):qaxobject.cpp:(.text+0xa17): undefined reference to `IID_IOleObject'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxobject.o):qaxobject.cpp:(.text+0xa26): undefined reference to `IID_IOleObject'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxobject.o):qaxobject.cpp:(.text+0xa31): undefined reference to `IID_IOleObject'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxobject.o):qaxobject.cpp:(.text+0xa43): undefined reference to `IID_IOleObject'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x12f): undefined reference to `IID_IClassFactory2'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x159): undefined reference to `SysAllocStringLen@8'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x166): undefined reference to `IID_IUnknown'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x191): undefined reference to `SysFreeString@4'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x1ba): undefined reference to `IID_IUnknown'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0xb84): undefined reference to `IID_IClassFactory'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0xc61): undefined reference to `CoGetClassObject@20'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x138d): undefined reference to `IID_IUnknown'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x1685): undefined reference to `IID_IClassFactory'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x1695): undefined reference to `CoGetClassObject@20'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x1b34): undefined reference to `GetActiveObject@12'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x1d07): undefined reference to `CreateILockBytesOnHGlobal@12'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x1d26): undefined reference to `StgCreateDocfileOnILockBytes@16'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x1d79): undefined reference to `GUID_NULL'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x1d82): undefined reference to `IID_IUnknown'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x1d8b): undefined reference to `OleCreateFromFile@32'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x20aa): undefined reference to `IID_IUnknown'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x210a): undefined reference to `CoCreateInstance@20'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x4b63): undefined reference to `CLSIDFromProgID@8'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x5935): undefined reference to `SysFreeString@4'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x5a05): undefined reference to `SysFreeString@4'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x8651): undefined reference to `IID_IPersistPropertyBag'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x8c2f): undefined reference to `IID_IPersistPropertyBag'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x9dc8): undefined reference to `IID_IProvideClassInfo'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0xae93): undefined reference to `LoadTypeLib@8'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0xb0e6): undefined reference to `LoadTypeLib@8'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0xb2a7): undefined reference to `LoadTypeLib@8'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0xe3ed): undefined reference to `IID_IPropertyNotifySink'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0xe3f5): undefined reference to `IID_IPropertyNotifySink'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0xe407): undefined reference to `IID_IPropertyNotifySink'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0xe412): undefined reference to `IID_IPropertyNotifySink'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0xe7a0): undefined reference to `IID_IDispatch'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0xee43): undefined reference to `IID_IDispatch'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0xef7e): undefined reference to `SysFreeString@4'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0xf202): undefined reference to `IID_IOleObject'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0xf895): undefined reference to `IID_IDispatch'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0xfb9c): undefined reference to `IID_IDispatch'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x10cb1): undefined reference to `VariantInit@4'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x115f6): undefined reference to `IID_IDispatch'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x116a4): undefined reference to `GUID_NULL'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x1185b): undefined reference to `GUID_NULL'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x1203a): undefined reference to `GUID_NULL'
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxbase.o):qaxbase.cpp:(.text+0x12468): undefined reference to `SysFreeString@4'

В чем проблема, непонятно
Записан
Jpost
Гость
« Ответ #7 : Март 27, 2009, 10:43 »

Проблема решена. Надо было добавить еще в линковку несколько не кутяшных библиотек.
У меня тоже подобная проблема компилятор пришет
mingw32-make release
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Documents and Settings/jpost.LOCALNET/workspace/proba2'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o release\proba2.exe release/obzor304lib.o release/main.o release/proba2.o release/moc_proba2.o  -L"c:\Qt\2009.01\qt\lib" -lmingw32 -lqtmain -lQAxContainer -lQtGui4 -lQtCore4
c:\Qt\2009.01\qt\lib/libQAxContainer.a(qaxobject.o):qaxobject.cpp:(.text+0xa17): undefined reference to `IID_IOleObject'

В чем проблема, непонятно
Решил проблему, всего то надо было добавить в pro файл строчку
CONFIG += qaxcontainer
Записан
Страниц: [1]   Вверх
  Печать  
 
Перейти в:  


Страница сгенерирована за 0.052 секунд. Запросов: 20.