Trolltech Home | Qt-jambi-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-jambi-interest Archive, October 2006
Problems using generator


Message 1 in thread

Hello,

I'm trying to upgrade my generated qt native widget, but I'm getting these:

Generating Code...
        link /LIBPATH:"c:\Qt\4.2.0\lib" /NOLOGO /INCREMENTAL:NO 
/INCREMENTAL:NO /DLL /OUT:c:\java\lib\maptool\com_trollt
ech_examples_generator.dll @C:\DOCUME~1\Helge\LOCALS~1\Temp\nmCC.tmp
   Creating library 
c:\java\lib\maptool\com_trolltech_examples_generator.lib and object 
c:\java\lib\maptool\com_trolltec
h_examples_generator.exp
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other 
libs; use /NODEFAULTLIB:library
metainfo.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) void __cdecl registerJavaSignature(class
 QString const &,class QString const &)" 
(__imp_?registerJavaSignature@@YAXABVQString@@0@Z) referenced in 
function "void
 __cdecl __metainfo_init(void)" (?__metainfo_init@@YAXXZ)
qtjambishell_CMapDisplay.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) private: void __thiscall
 StaticCache::resolveInternalSignal_internal(void)" 
(__imp_?resolveInternalSignal_internal@StaticCache@@AAEXXZ) referenc
ed in function "void __cdecl qtjambi_call_java_signal(struct JNIEnv_ 
*,struct QtJambiSignalInfo,union jvalue *)" (?qtjam
bi_call_java_signal@@YAXPAUJNIEnv_@@UQtJambiSignalInfo@@PATjvalue@@@Z)
qtjambishell_CMapDisplay.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) bool __cdecl qtjambi_exc
eption_check(struct JNIEnv_ *)" 
(__imp_?qtjambi_exception_check@@YA_NPAUJNIEnv_@@@Z) referenced in 
function "public: vir
tual void __thiscall QtJambiShell_CMapDisplay::actionEvent(class 
QActionEvent *)" (?actionEvent@QtJambiShell_CMapDisplay
@@UAEXPAVQActionEvent@@@Z)
qtjambishell_CMapDisplay.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) class _jobject * __cdecl
 qtjambi_from_enum(struct JNIEnv_ *,int,char const *)" 
(__imp_?qtjambi_from_enum@@YAPAV_jobject@@PAUJNIEnv_@@HPBD@Z) ref
erenced in function "public: virtual class QVariant __thiscall 
QtJambiShell_CMapDisplay::inputMethodQuery(enum Qt::Input
MethodQuery)const " 
(?inputMethodQuery@QtJambiShell_CMapDisplay@@UBE?AVQVariant@@W4InputMethodQuery@Qt@@@Z)
qtjambishell_CMapDisplay.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) void __cdecl qtjambi_end
_paint(struct JNIEnv_ *,class _jobject *)" 
(__imp_?qtjambi_end_paint@@YAXPAUJNIEnv_@@PAV_jobject@@@Z) referenced in 
func
tion "public: virtual void __thiscall 
QtJambiShell_CMapDisplay::paintEvent(class QPaintEvent *)" 
(?paintEvent@QtJambiShe
ll_CMapDisplay@@UAEXPAVQPaintEvent@@@Z)
qtjambishell_CMapDisplay.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) bool __cdecl qtjambi_con
nect_cpp_to_java(struct JNIEnv_ *,class QString const &,class QObject 
*,class QObject *,class QString const &,class QStr
ing const &)" 
(__imp_?qtjambi_connect_cpp_to_java@@YA_NPAUJNIEnv_@@ABVQString@@PAVQObject@@211@Z) 
referenced in function
 _Java_com_trolltech_examples_generator_CMapDisplay__1_1qt_1signalInitialization
qtjambishell_CMapDisplay.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) void __cdecl qtjambi_res
olve_signals(struct JNIEnv_ *,class _jobject *,struct QtJambiSignalInfo 
*,int,char * *,int *)" (__imp_?qtjambi_resolve_s
ignals@@YAXPAUJNIEnv_@@PAV_jobject@@PAUQtJambiSignalInfo@@HPAPADPAH@Z) 
referenced in function _Java_com_trolltech_exampl
es_generator_CMapDisplay__1_1qt_1signalInitialization
c:\java\lib\maptool\com_trolltech_examples_generator.dll : fatal error 
LNK1120: 7 unresolved externals

Any suggestions?

Helge F.


Message 2 in thread

Helge Fredriksen wrote:

> Hello,
>
> I'm trying to upgrade my generated qt native widget, but I'm getting 
> these:
>
[...]

> c:\java\lib\maptool\com_trolltech_examples_generator.dll : fatal error 
> LNK1120: 7 unresolved externals
>
> Any suggestions?
>

Hi, Helge.

Are you sure you are linking against the correct version of the 
qtjambi.lib library and that it's located at the correct location (if 
you're using the original .pro file from the generator example, this 
would be "../lib")

-- Eskil


Message 3 in thread

Eskil A. Blomfeldt wrote:

I didn't change anything in the pro/bat file since the last version, 
just copied all my stuff into the
new qtjambi-win-1.0.0-tp3 directory. However, I've upgraded Qt to Qt 
4.2, don't know if
that could have anything to do with it? I noticed the error:

LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other 
libs; use /NODEFAULTLIB:library

this occurs probably since moc complined about this dll not existing, 
thus leading to that I had
to copy this into $(QTDIR)/bin manually.

How can I set options like /NODEFAULTLIB:MSVCRTD.dll in the pro file?

Helge
> Helge Fredriksen wrote:
>
>> Hello,
>>
>> I'm trying to upgrade my generated qt native widget, but I'm getting 
>> these:
>>
> [...]
>
>> c:\java\lib\maptool\com_trolltech_examples_generator.dll : fatal 
>> error LNK1120: 7 unresolved externals
>>
>> Any suggestions?
>>
>
> Hi, Helge.
>
> Are you sure you are linking against the correct version of the 
> qtjambi.lib library and that it's located at the correct location (if 
> you're using the original .pro file from the generator example, this 
> would be "../lib")
>
> -- Eskil
>
>


Message 4 in thread

Helge Fredriksen wrote:

> Eskil A. Blomfeldt wrote:
>
> I didn't change anything in the pro/bat file since the last version, 
> just copied all my stuff into the
> new qtjambi-win-1.0.0-tp3 directory. However, I've upgraded Qt to Qt 
> 4.2, don't know if

I haven't seen what your pro-file looks like, but wouldn't you have to 
set it up to use your new installation of Qt Jambi? I don't see any 
reference to your qtjambi-win-1.0.0-tp3 directory in any of the output 
you pasted.

In the original pro-file, the destination directory is set to "../lib" 
and this same directory is set as the location of the library files. If 
you have changed the pro-file and want to load the libraries from 
somewhere else, you will have to change the line that says LIBS += in 
the pro-file:

Instead of

    LIBS += -L$$DESTDIR -l$$QTJAMBI_LIB_NAME

put something like

   LIBS += -L/path/to/qtjambi-tp3 -l$$QTJAMBI_LIB_NAME

In your original output, the linker's output was directed to 
c:\java\lib\maptool, which could indicate that this is the problem.

-- Eskil


Message 5 in thread

Eskil A. Blomfeldt wrote:
> Helge Fredriksen wrote:
>
>> Eskil A. Blomfeldt wrote:
>>
>> I didn't change anything in the pro/bat file since the last version, 
>> just copied all my stuff into the
>> new qtjambi-win-1.0.0-tp3 directory. However, I've upgraded Qt to Qt 
>> 4.2, don't know if
>
> I haven't seen what your pro-file looks like, but wouldn't you have to 
> set it up to use your new installation of Qt Jambi? I don't see any 
> reference to your qtjambi-win-1.0.0-tp3 directory in any of the output 
> you pasted.
>
> In the original pro-file, the destination directory is set to "../lib" 
> and this same directory is set as the location of the library files. 
> If you have changed the pro-file and want to load the libraries from 
> somewhere else, you will have to change the line that says LIBS += in 
> the pro-file:
>
> Instead of
>
>    LIBS += -L$$DESTDIR -l$$QTJAMBI_LIB_NAME
>
> put something like
>
>   LIBS += -L/path/to/qtjambi-tp3 -l$$QTJAMBI_LIB_NAME
>
> In your original output, the linker's output was directed to 
> c:\java\lib\maptool, which could indicate that this is the problem.
>
> -- Eskil
>
>

Sorry, same problem still if I change the destination directory 
variables back to original settings. Do you have any clue on how to set 
generic options to the linker? I think this might solve the problem.

        link /LIBPATH:"c:\Qt\4.2.0\lib" /NOLOGO /INCREMENTAL:NO 
/INCREMENTAL:NO /DLL /OUT:..\lib\com_trolltech_examples_
generator.dll @C:\DOCUME~1\Helge\LOCALS~1\Temp\nmEE.tmp
   Creating library ..\lib\com_trolltech_examples_generator.lib and 
object ..\lib\com_trolltech_examples_generator.exp
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other 
libs; use /NODEFAULTLIB:library
metainfo.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) void __cdecl registerJavaSignature(class
 QString const &,class QString const &)" 
(__imp_?registerJavaSignature@@YAXABVQString@@0@Z) referenced in 
function "void
 __cdecl __metainfo_init(void)" (?__metainfo_init@@YAXXZ)

Helge F.



Message 6 in thread

Helge Fredriksen wrote:

> Sorry, same problem still if I change the destination directory 
> variables back to original settings. Do you have any clue on how to 
> set generic options to the linker? I think this might solve the problem.
>
>

In the .pro-file, you can set the linker options by adding e.g.

    QMAKE_LFLAGS += /NODEFAULTLIB:library

Hope that helps.

I did try linking the generator example from TP3 against the qtjambi.lib 
from TP2 and got the exact same error messages that you got, however.

-- Eskil




Message 7 in thread

Sorry, you were right. I had some setting in the environment variable 
LIB that I configured loooong time ago.

Works now.

Helge F.

Eskil A. Blomfeldt wrote:
> Helge Fredriksen wrote:
>
>> Sorry, same problem still if I change the destination directory 
>> variables back to original settings. Do you have any clue on how to 
>> set generic options to the linker? I think this might solve the problem.
>>
>>
>
> In the .pro-file, you can set the linker options by adding e.g.
>
>    QMAKE_LFLAGS += /NODEFAULTLIB:library
>
> Hope that helps.
>
> I did try linking the generator example from TP3 against the 
> qtjambi.lib from TP2 and got the exact same error messages that you 
> got, however.
>
> -- Eskil
>
>
>
>