PDA

View Full Version : Calling a library in Symbian C++ using Qt



zhengping
16th June 2010, 07:33
Hi everyone,

I need to call a function from a library (.dll format) using a Qt program to be run on a Symbian smartphone. However, the driver is written in Symbian C++. I've Googled and been seen some programs and an article about using Symbian and Qt together, but am not sure what procedure to take regarding header files and libraries to import--or where to begin for my own programs.

At present I'm running the following on Windows Vista:

Qt for Symbian 4.6.3
Qt for Windows 4.6.2
Carbide C++ v2.6
and the S60 5th Edition SDK.

Can anyone advise me on the procedure for doing so, and point me to relevant examples you're aware of? Thanks!

Lykurg
16th June 2010, 08:12
See
http://www.forum.nokia.com/Develop/Qt/Getting_started/
http://www.forum.nokia.com/Develop/Qt/Code_examples/
and brows through the wiki from http://www.forum.nokia.com/Develop/Qt/Community/

zhengping
22nd June 2010, 02:04
Hello everyone,

I'm facing a persistent error trying to access a function within a Symbian library using a Qt program. My setup is Qt 4.6.3, S60 5th Edition SDK v1.0 with OpenC/C++ plugin, Carbide v2.6 on Windows Vista Home Premium.

There's a simple function I must call within the class Csample:



EXPORT_C TInt Csample::ExampleSum()
{ return 5; }

and the Qt function I used is:



void s60Calling::callToSym()
{
Csample* sampleAccess;
TInt result = sampleAccess->ExampleSum();

// afterwards display result on the screen
}


I've included the relevant header file sample.h. However, when I build for the Emulator I get the error "Undefined symbol: 'int Csample::ExampleSum(void) (?ExampleSum@Csample@@QAEHXZ)'".

Building for the phone (GCCE) gives the "Undefined reference to Csample::ExampleSum();" error. I've Googled and suspect a library is missing, but found nothing useful. How can I fix these errors?

(thanks Lykurg for the resources!)