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

Qt-jambi-interest Archive, November 2007
UnsatisifiedLinkError


Message 1 in thread

Hi! Running the following program :

 

/*

 * Main.java

 *

 * Created on 2 novembre 2007, 14.20

 *

 * To change this template, choose Tools | Template Manager

 * and open the template in the editor.

 */

 

package qjambitest;

import com.trolltech.qt.core.*;

import com.trolltech.qt.network.*;

 

/**

 *

 * @author Marco

 */

public class Main {

    

    /** Creates a new instance of Main */

    public Main() {

    }

    

    /**

     * @param args the command line arguments

     */

    public static void main(String[] args) {

        // TODO code application logic here

        QCoreApplication.initialize(args);

        

        //QTcpServer server = new QTcpServer();

        //QHostAddress addr = new QHostAddress("127.0.0.1");

        //server.listen(addr, 55000);

        

        QCoreApplication.exec();

    }

    static

    {

        System.loadLibrary("jiaxclient");

    }

    

}

 

I have the following exception:

 

Exception in thread "main" java.lang.UnsatisfiedLinkError:
com.trolltech.qt.core.QtJambi_LibraryInitializer.__qt_initLibrary()V

        at
com.trolltech.qt.core.QtJambi_LibraryInitializer.__qt_initLibrary(Native
Method)

        at
com.trolltech.qt.core.QtJambi_LibraryInitializer.<clinit>(QtJambi_LibraryIni
tializer.java:10)

        at
com.trolltech.qt.core.QAbstractFileEngineHandler.<clinit>(QAbstractFileEngin
eHandler.java:10)

        at
com.trolltech.qt.QtJambi_LibraryInitializer.<clinit>(QtJambi_LibraryInitiali
zer.java:24)

        at com.trolltech.qt.QtJambiObject.<clinit>(QtJambiObject.java:29)

        at qjambitest.Main.main(Main.java:29)

Java Result: 1

The line System.loadLibrary(?jiaxclient?) loads a library that make use
inside its code of classes QTcpServer, QTcpSocket, QHostAddress? The dll
compiled to use this classes inside c++ are build for VS2005? QtJambi has
been download from open source link.

 

Could someone help me to solve the problem?

 

Best regards,

 

Marco Bnà


Message 2 in thread

Marco Bnà wrote:
> The line System.loadLibrary(“jiaxclient”) loads a library that make use
> inside its code of classes QTcpServer, QTcpSocket, QHostAddress… The dll
> compiled to use this classes inside c++ are build for VS2005… QtJambi has
> been download from open source link.
>
>  
>
>   
[...]
> Another aspect that I’ve noticed is the fact that if I don’t load my lib
> calls to QtCoreApplication.initialize an QtCoreApplication.exec are executed
> without problems…

Which Qt version does your jiaxclient library link against? If you are 
loading an older version of the Qt dlls than what is required by Jambi, 
then this might be your problem.

-- Eskil


Message 3 in thread

Eskil Abrahamsen Blomfeldt wrote:
> Marco Bnà wrote:
>> The line System.loadLibrary(“jiaxclient”) loads a library that make use
>> inside its code of classes QTcpServer, QTcpSocket, QHostAddress… The dll
>> compiled to use this classes inside c++ are build for VS2005… QtJambi 
>> has
>> been download from open source link.
>
> Which Qt version does your jiaxclient library link against? If you are 
> loading an older version of the Qt dlls than what is required by 
> Jambi, then this might be your problem.
>


Also, if you're on Windows, it will be a problem that the open source Qt 
Jambi libraries are built with the mingw compiler, while your own 
Qt-based library is built with VS2005. I recommend you download the open 
source version of both Qt and Qt Jambi and build everything using the 
same compiler (mingw if you're on Windows), and link both Qt Jambi and 
your own library against the same Qt version (will have to be in the Qt 
4.3 series.)

-- Eskil


Message 4 in thread

Qt and QtJambi are of the same version (4.3.1). I will rebuild Qt using
MinGW. Hope this will solve the problem.

Thanks.

Best Regards,
Marco Bnà

-----Messaggio originale-----
Da: Eskil Abrahamsen Blomfeldt [mailto:eblomfel@xxxxxxxxxxxxx] 
Inviato: lunedì 5 novembre 2007 8.18
A: Marco Bnà
Cc: qt-jambi-interest@xxxxxxxxxxxxx
Oggetto: Re: UnsatisifiedLinkError

Marco Bnà wrote:
> The line System.loadLibrary(?jiaxclient?) loads a library that make use
> inside its code of classes QTcpServer, QTcpSocket, QHostAddress? The dll
> compiled to use this classes inside c++ are build for VS2005? QtJambi has
> been download from open source link.
>
>  
>
>   
[...]
> Another aspect that I?ve noticed is the fact that if I don?t load my lib
> calls to QtCoreApplication.initialize an QtCoreApplication.exec are
executed
> without problems?

Which Qt version does your jiaxclient library link against? If you are 
loading an older version of the Qt dlls than what is required by Jambi, 
then this might be your problem.

-- Eskil