主题 : 为什么make之后生成的是共享库文件? 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 24486
精华: 0
发帖: 7
金钱: 35 两
威望: 7 点
综合积分: 14 分
注册时间: 2010-07-08
最后登录: 2011-05-18
楼主  发表于: 2010-07-12 11:09

 为什么make之后生成的是共享库文件?

编译好了ARM平台的Qtopia-2.2.0,按mini2440手册搭建的,
我的qt程序需要多线程支持,本来想按帖子http://www.aiothome.net/read.php?tid-2298-page-e-fpage-1.html#a的方法得到libqte-mt.so库的,结果行不通,错误都在里面了。
后来看到http://www.aiothome.net/read.php?tid-4027-fpage-0-toread--page-3.html     eddylau的方法,就试了一下,结果最后编译qt程序只得到库文件而没有可执行文件:
gcc是友善自带的4.3.2主机是虚拟机fedora9
下面是我编译的具体步骤:
1.
复制代码
  1. #source /opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/setQpeEnv

2.
复制代码
  1. #qmake -project

生成pro然后再手动加上CONFIG+= qtopiaapp thread这一句得到的pro:
复制代码
  1. 1 ######################################################################
  2.   2 # Automatically generated by qmake (1.06c-Qtopia) Mon Jul 12 10:23:34 2010
  3.   3 ######################################################################
  4.   4
  5.   5 TEMPLATE = app
  6.   6 INCLUDEPATH += .
  7.   7 CONFIG+= qtopiaapp thread
  8.   8
  9.   9 # Input
  10. 10 HEADERS += dataRecieve.h \
  11. 11            ******
  12. 30 SOURCES += dataRecieve.cpp \
  13. ****

3.
复制代码
  1. # qmake -spec /opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/mkspecs/qws/linux-arm-g++ -o Makefile *.pro
  2. Project ERROR: Please set a target in /opt/FriendlyARM/mini2440/radar-v72/src

4.于是在pro最后面加了
复制代码
  1. INTERFACES    =
  2. TARGET        = radar

5.
复制代码
  1. qmake -spec /opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/mkspecs/qws/linux-arm-g++ -o Makefile *.pro

生成的Makefile,也放附件里了


6.
复制代码
  1. # make
  2. 文字太多,放附件里了:
  3. 得到的
  4. [code]# readelf -h libradar.so
  5. ELF Header:
  6.   Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  7.   Class:                             ELF32
  8.   Data:                              2's complement, little endian
  9.   Version:                           1 (current)
  10.   OS/ABI:                            UNIX - System V
  11.   ABI Version:                       0
  12.   Type:                              DYN (Shared object file)
  13.   Machine:                           ARM
  14.   Version:                           0x1
  15.   Entry point address:               0x133c4
  16.   Start of program headers:          52 (bytes into file)
  17.   Start of section headers:          273272 (bytes into file)
  18.   Flags:                             0x5000002, has entry point, Version5 EABI
  19.   Size of this header:               52 (bytes)
  20.   Size of program headers:           32 (bytes)
  21.   Number of program headers:         4
  22.   Size of section headers:           40 (bytes)
  23.   Number of section headers:         27
  24.   Section header string table index: 24

如何才能得到可执行文件啊/