开发者

QT 4 - How to build QuaZip and QtCrypto to .Lib?

开发者 https://www.devze.com 2023-04-12 22:17 出处:网络
Latest news: I fixed QuaZip issue The QtCrypto is work on Desktop platform (with AES 256) now. But how to build the lib for Symbian?

Latest news:

  1. I fixed QuaZip issue

  2. The QtCrypto is work on Desktop platform (with AES 256) now. But how to build the lib for Symbian?

Questions:

  1. How do I Build the .lib file of QtCryptoand QuaZip ? (details as below)
  2. How to Use the Lib in a new QT Mobile Application Project (QT Create 2.3) ?

    Background:

  3. I am using Qt Creator to make an UnZip Manager App for Nokia Symbian device.

  4. I need to use QtCrypto (decrypt the file) and QuaZip (unzip the ePub zip file)
  5. I cannot use them in my project.

Platform:

  1. Qt Creator 2.3.0 base on Qt 4.7.4
  2. Window 7 32bit
  3. Deploy to Nokia N8

Step i tried:

A) Build Lib

  1. Download and open the QtCtypto and QuaZip project

    QtCtypto: http://delta.affinix.com/qca/

    QuaZip: http://quazip.sourceforge.net/

  2. Open it without any change. Click "Build"

  3. Cannot find the .lib file. So i copy the .dll and .h instead

  4. Still fail even if i follow the instruction of QuaZip website

B) Import to project

  1. I create new Project (Mobile Qt Application)

  2. Choosed "Symbian Simulator" ,"Symbian Device" ,"Window desktop" build environment

  3. Import the above-mentioned .dll .h files.

  4. Import the zdll.lib, zlib.def (It's come with QuaZip project)

  5. Add below code in .pro file

开发者_JAVA技巧 OTHER_FILES += \    
 lib/zdll.lib \    
 lib/zlib.def \    
 lib/QuaZip.dll


 LIBS += $$PWD/lib/zdll.lib    
 LIBS += $$PWD/lib/QuaZip.dll   

 INCLUDEPATH += $$PWD/include    
 DEPENDPATH += $$PWD/include

 6. In the .cpp file, it can detect and i can create a variable

 7. I follow the example in QuaZip website. Its like: QuaZip(fileName);

 8. But when i run the app, it cannot start up. But no error when i build it

C) Others

  1. I try to build .lib from QuaZip and QtCtypto but fail

  2. It always build .dll or .a but not .lib


A while ago I needed QuaZip, badly. Here's SConscript file I made to build it:

# SConscript

env = Environment (tools = ['default', 'qt4'])
env.Tool ('qt4')
env.Append (CPPFLAGS = ['-O2'], CPPDEFINES = ['QT_NO_DEBUG', 'QT_NO_DEBUG_OUTPUT'])
if (env ['PLATFORM'] == 'win32'):
        env.Append (CPPPATH = [env ['QT4DIR'] + '/src/3rdparty/zlib'])
env.EnableQt4Modules (['QtCore'])
lib_quazip = env.StaticLibrary ('quazip', Glob ('*.cpp') + Glob ('*.c'))
env.Default (lib_quazip)
Export ('lib_quazip')

If you're not familiar with SCons, it's a handy remplacement for autotools / makefiles. This SConscript worked on both Windows and Linux, if I remember correctly. You will also need the scons-qt4 plugin (found at Tools Index) Building QtQrypto might or might not be similar.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号