• 90904阅读
  • 196回复

qtembedded的桌面系统EMD(即Embedded desktop) [复制链接]

上一主题 下一主题
离线hangbing0203
只看该作者 40楼 发表于: 2010-07-29
首先要谢谢你回复:
我是这样编译的 :

我的环境是qt-embedded  4.5.2  ubuntu10.4   安装在/usr/local/Trolltech/Qt-4.5.2/
  首先  1 qmake  -project
               qmake
                vi  Makefile    /修改makefile
               修改成如下:
11 CC            = gcc
12 CXX           = g++
13 DEFINES       = -DQT_NO_DEBUG -DQT_TESTLIB_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
14 CFLAGS        = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
15 CXXFLAGS      = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
16 INCPATH       = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.5.2/include/QtCore -I/usr/local/Trolltech/Qt-4.5.2/include/QtGui -I/usr/local/Trolltech/      Qt-4.5.2/include/QtTest -I/usr/local/Trolltech/Qt-4.5.2/include -I. -Iemdecorationplugin -Iemdesktopclient -Iemdesktopserver -Icommon/include -Iemdesktopserver/                 MurphyPinyin -Iemdesktopserver/MurphyPinyin/scim -Iemdesktopserver/MurphyPinyin/phrase -Iapp/pdfviewer -Itests/testappinfo -Itests/testapplicationsmanager -Itests/              testmimetype -Iapp/imageviewer/src -Iapp/imageviewer/tests -I.



不过出现错误信息是:
       sts/testappinfo -Itests/testapplicationsmanager -Itests/testmimetype -Iapp/imageviewer/src -Iapp/imageviewer/tests -I. -o scim_pinyin.o emdesktopserver/MurphyPinyin/scim/scim_pinyin.cpp
emdesktopserver/MurphyPinyin/scim/scim_pinyin.cpp:39: warning: missing initializer for member ‘utf8_table::cval’
emdesktopserver/MurphyPinyin/scim/scim_pinyin.cpp:39: warning: missing initializer for member ‘utf8_table::shift’
emdesktopserver/MurphyPinyin/scim/scim_pinyin.cpp:39: warning: missing initializer for member ‘utf8_table::lmask’
emdesktopserver/MurphyPinyin/scim/scim_pinyin.cpp:39: warning: missing initializer for member ‘utf8_table::lval’
/usr/bin/moc-qt4 -DQT_NO_DEBUG -DQT_TESTLIB_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.5.2/include/QtCore -I/usr/local/Trolltech/Qt-4.5.2/include/QtGui -I/usr/local/Trolltech/Qt-4.5.2/include/QtTest -I/usr/local/Trolltech/Qt-4.5.2/include -I. -Iemdecorationplugin -Iemdesktopclient -Iemdesktopserver -Icommon/include -Iemdesktopserver/MurphyPinyin -Iemdesktopserver/MurphyPinyin/scim -Iemdesktopserver/MurphyPinyin/phrase -Iapp/pdfviewer -Itests/testappinfo -Itests/testapplicationsmanager -Itests/testmimetype -Iapp/imageviewer/src -Iapp/imageviewer/tests -I. emdesktopclient/emdesktopclient.h -o moc_emdesktopclient.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_TESTLIB_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.5.2/include/QtCore -I/usr/local/Trolltech/Qt-4.5.2/include/QtGui -I/usr/local/Trolltech/Qt-4.5.2/include/QtTest -I/usr/local/Trolltech/Qt-4.5.2/include -I. -Iemdecorationplugin -Iemdesktopclient -Iemdesktopserver -Icommon/include -Iemdesktopserver/MurphyPinyin -Iemdesktopserver/MurphyPinyin/scim -Iemdesktopserver/MurphyPinyin/phrase -Iapp/pdfviewer -Itests/testappinfo -Itests/testapplicationsmanager -Itests/testmimetype -Iapp/imageviewer/src -Iapp/imageviewer/tests -I. -o moc_emdesktopclient.o moc_emdesktopclient.cpp
moc_emdesktopclient.cpp:14:2: error: #error "This file was generated using the moc from 4.6.2. It"
moc_emdesktopclient.cpp:15:2: error: #error "cannot be used with the include files from this version of Qt."
moc_emdesktopclient.cpp:16:2: error: #error "(The moc has changed too much.)"
moc_emdesktopclient.cpp: In member function ‘virtual const QMetaObject* Container::metaObject() const’:
moc_emdesktopclient.cpp:54: error: ‘class QObjectData’ has no member named ‘metaObject’
moc_emdesktopclient.cpp:54: error: ‘class QObjectData’ has no member named ‘metaObject’
说QT版本不一样。ubuntu10.04QT版本是4.6.2.
  不知道该怎么修改,请指教。
                                            
离线zzz945
只看该作者 41楼 发表于: 2010-07-29
肯定是你以前用qt4.6.2编译过产生的moc文件和.o文件没有清除, 请make clean
离线hangbing0203
只看该作者 42楼 发表于: 2010-07-30
昨天任务已经解决了,修改Makefile 可以了。
但是现出现这样的问题了:
  pdfviewer.o moc_fileselectdialog.o moc_fileselectlistwidget.o moc_PinyinFrame.o moc_testappinfo.o moc_testapplicationsmanager.o moc_testmimetype.o moc_imageviewer.o moc_testimageviewerdata.o qrc_resource.o    -L/usr/local/Trolltech/Qt-4.5.2/lib -lQtTest -lQtGui -lQtCore -lpthread  -lqwt  -lpoppler  
main.o: In function `main':
main.cpp:(.text+0x0): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
main.o: In function `main':
main.cpp:(.text+0x0): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
main.o: In function `main':
main.cpp:(.text+0x0): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
main.o: In function `main':
main.cpp:(.text+0x0): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
testappinfo.o: In function `main':
testappinfo.cpp:(.text+0x0): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
testapplicationsmanager.o: In function `main':
testapplicationsmanager.cpp:(.text+0x3180): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
testmimetype.o: In function `main':
testmimetype.cpp:(.text+0x0): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
main.o: In function `main':
main.cpp:(.text+0x0): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
main.o: In function `main':
main.cpp:(.text+0x0): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
pdfviewer.o: In function `PdfViewer::~PdfViewer()':
pdfviewer.cpp:(.text+0x197): undefined reference to `Poppler::Document::~Document()'
pdfviewer.o: In function `PdfViewer::~PdfViewer()':
pdfviewer.cpp:(.text+0x207): undefined reference to `Poppler::Document::~Document()'
pdfviewer.o: In function `PdfViewer::~PdfViewer()':
pdfviewer.cpp:(.text+0x267): undefined reference to `Poppler::Document::~Document()'
pdfviewer.o: In function `PdfViewer::loadPage(int)':
pdfviewer.cpp:(.text+0xfff): undefined reference to `Poppler::Document::numPages() const'
pdfviewer.cpp:(.text+0x110d): undefined reference to `Poppler::Document::page(int) const'
pdfviewer.cpp:(.text+0x11f2): undefined reference to `Poppler::Page::renderToImage(double, double, int, int, int, int, Poppler::Page::Rotation) const'
pdfviewer.cpp:(.text+0x13a8): undefined reference to `Poppler::Page::renderToImage(double, double, int, int, int, int, Poppler::Page::Rotation) const'
pdfviewer.cpp:(.text+0x1506): undefined reference to `Poppler::Page::~Page()'
pdfviewer.o: In function `PdfViewer::loadDocument(QString const&)':
pdfviewer.cpp:(.text+0x1fa7): undefined reference to `Poppler::Document::~Document()'
pdfviewer.cpp:(.text+0x1fea): undefined reference to `Poppler::Document::load(QString const&, QByteArray const&, QByteArray const&)'
pdfviewer.cpp:(.text+0x2025): undefined reference to `Poppler::Document::isLocked() const'
pdfviewer.cpp:(.text+0x211e): undefined reference to `Poppler::Document::~Document()'
pdfviewer.cpp:(.text+0x2171): undefined reference to `Poppler::Document::numPages() const'
pdfviewer.o: In function `PdfViewer::doChangePageRequest()':
pdfviewer.cpp:(.text+0x2b3f): undefined reference to `Poppler::Document::numPages() const'
pdfviewer.o: In function `PdfViewer::nextPage()':
pdfviewer.cpp:(.text+0x2e3f): undefined reference to `Poppler::Document::numPages() const'
pdfviewer.cpp:(.text+0x2e67): undefined reference to `Poppler::Document::numPages() const'
/usr/local/Trolltech/Qt-4.5.2/lib/libqwt.so: undefined reference to `QMapData::createData(int)'
/usr/local/Trolltech/Qt-4.5.2/lib/libqwt.so: undefined reference to `QVectorData::reallocate(QVectorData*, int, int, int)'
/usr/local/Trolltech/Qt-4.5.2/lib/libqwt.so: undefined reference to `QMapData::node_create(QMapData::Node**, int, int)'
/usr/local/Trolltech/Qt-4.5.2/lib/libqwt.so: undefined reference to `QWidget::x11Info() const'
/usr/local/Trolltech/Qt-4.5.2/lib/libqwt.so: undefined reference to `QPixmap::x11Info() const'
/usr/local/Trolltech/Qt-4.5.2/lib/libqwt.so: undefined reference to `QListData::detach3()'
/usr/local/Trolltech/Qt-4.5.2/lib/libqwt.so: undefined reference to `QWidget::x11Event(_XEvent*)'
/usr/local/Trolltech/Qt-4.5.2/lib/libqwt.so: undefined reference to `QPixmap::x11SetScreen(int)'
/usr/local/Trolltech/Qt-4.5.2/lib/libqwt.so: undefined reference to `QVectorData::free(QVectorData*, int)'
/usr/local/Trolltech/Qt-4.5.2/lib/libqwt.so: undefined reference to `QListData::append2(QListData const&)'
/usr/local/Trolltech/Qt-4.5.2/lib/libqwt.so: undefined reference to `QX11Info::screen() const'
/usr/local/Trolltech/Qt-4.5.2/lib/libqwt.so: undefined reference to `qBadAlloc()'
/usr/local/Trolltech/Qt-4.5.2/lib/libqwt.so: undefined reference to `QVectorData::allocate(int, int)'
collect2: ld returned 1 exit status
make: *** [emd] Error 1


我在app/app.pro把pdfview去掉。同时我也把qwt,poppler的现头文件全部放到/usr/local/Trolltech/Qt-4.5.2/include/qwt/里面.同时路径 也指定了 -I//usr/local/Trolltech/Qt-4.5.2/include/qwt/
相关库放在/usr/local/Trolltech/Qt-4.5.2/lib里面。

但是为什么还出现找不库呢?
请问 这是怎么回事呢 。
离线hangbing0203
只看该作者 43楼 发表于: 2010-07-30
QMapData::createData  的定义在qwt找到了,请问 需要编译什么库呢 》
离线hangbing0203
只看该作者 44楼 发表于: 2010-07-30
QMapData::createData  的定义在qwt没有找到,请问 还需要编译什么库呢 》
离线zzz945
只看该作者 45楼 发表于: 2010-07-30
1.不是已经去掉pdfview了吗, 怎么还在编译pdfview, 是不是改完.pro文件后没有运行qmake。
2.INCPATH       = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.5.2/include/QtCore -I/usr/local/Trolltech/Qt-4.5.2/include/QtGui -I/usr/local/Trolltech/      Qt-4.5.2/include/QtTest -I/usr/local/Trolltech/Qt-4.5.2/include -I. -Iemdecorationplugin -Iemdesktopclient -Iemdesktopserver -Icommon/include -Iemdesktopserver/                 MurphyPinyin -Iemdesktopserver/MurphyPinyin/scim -Iemdesktopserver/MurphyPinyin/phrase -Iapp/pdfviewer -Itests/testappinfo -Itests/testapplicationsmanager -Itests/              testmimetype -Iapp/imageviewer/src -Iapp/imageviewer/tests -I.
这是main函数重定义的原因, 为什么要在顶层makefile中加入这些东西, 完全不必要修改Makefile的, 只要设好环境变量让编译器能找到正确的qt库就足够了。
3.INSTALL文件中关于qwt的内容有误, 正确做法应该是:下载并编译qwt库, 然后把qwt的src文件夹下面的
所有.h文件拷贝到"QTEDIR"/include里面, 或者在emdesktopserver.pro文件中添加INCLUDEPATH += "path of your qwt di
r"/src。还要把qwt的.so文件拷贝到"QTEDIR"/lib文件夹里。 这个错误在目前的版本中已经得到修改
离线hangbing0203
只看该作者 46楼 发表于: 2010-07-31

1  我修改了app.pro,确实没有在qmake,我直接修改的Makefile(这是不对的)
2  在顶层的Makefile加入INCPAT环境变量.以后的成出来的Makefile文件就会在自动添加INCPAT变量吗并且值是我修改指定的值吗?
      但是后面生成Makefile文件的INCPAT变量没有被修改。
环境变量我是这样设置的:
liuyang@liuyang-laptop:~/Documents/emd/emd$ vi  /etc/profile
     32 export EMD_RUNNING_DIR=~/Documents/emd/emd/desktop-running-environment
     33 export QTEDIR=/usr/local/Trolltech/Qt-4.5.2 //QT安装路径
liuyang@liuyang-laptop:~/Documents/emd/emd$ source  /etc/profile //使环境变量生效。
我是这样操作的:
                         1 liuyang@liuyang-laptop:~/Documents$ tar -zxvf  emd.tar.gz
                         2 liuyang@liuyang-laptop:~/Documents/emd/emd$ ls
                            app  common  emdecorationplugin  emdesktopclient  emdesktopserver  emd.pro  INSTALL  README  tests

                        3 liuyang@liuyang-laptop:~/Documents/emd/emd$ find  ./  -name  Makefile  //没有找到Makefile文件
                        4 liuyang@liuyang-laptop:~/Documents/emd/emd$ vi app/app.pro                //干掉pdfviewer
                        5 liuyang@liuyang-laptop:~/Documents/emd/emd$ qmake                             //生成Makefile
                        6 liuyang@liuyang-laptop:~/Documents/emd/emd$ find  ./  -name  Makefile// 只找一个Makefile文件。应该只有一个Makefile文件
                       7 liuyang@liuyang-laptop:~/Documents/emd/emd$ vi  Makefile     //修改Makefile文件,,添加INCPAT变量。
    下面是生成的Makefile:
/********************************************************************************************************************/
1 #############################################################################
  2 # Makefile for building: emd
  3 # Generated by qmake (2.01a) (Qt 4.6.2) on: Sat Jul 31 10:01:39 2010
  4 # Project:  emd.pro
  5 # Template: subdirs
  6 # Command: /usr/bin/qmake -unix -o Makefile emd.pro
  7 #############################################################################
  8
  9 first: make_default
10 MAKEFILE      = Makefile
11 QMAKE         = /usr/bin/qmake
12 INCPATH     = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.5.2/include/QtCore -I/usr/local/Trolltech/Qt-4.5.2/include/QtGui -I/usr/local/Trolltech/Qt-     4.5.2/include/QtTest -I/usr/local/Trolltech/Qt-4.5.2/include -I. -Iemdecorationplugin -Iemdesktopclient -Iemdesktopserver -Icommon/include -Iemdesktopserver/MurphyPinyin -      Iemdesktopserver/MurphyPinyin/scim -Iemdesktopserver/MurphyPinyin/phrase -Iapp/pdfviewer -Itests/testappinfo -Itests/testapplicationsmanager -Itests/testmimetype -Iapp/         imageviewer/src -Iapp/imageviewer/tests -I.
13 DEL_FILE      = rm -f
14 CHK_DIR_EXISTS= test -d
15 MKDIR         = mkdir -p
16 COPY          = cp -f
17 COPY_FILE     = $(COPY)
18 COPY_DIR      = $(COPY) -r
19 INSTALL_FILE  = install -m 644 -p
20 INSTALL_PROGRAM = install -m 755 -p
21 INSTALL_DIR   = $(COPY_DIR)
22 DEL_FILE      = rm -f
23 SYMLINK       = ln -f -s
24 DEL_DIR       = rmdir
25 MOVE          = mv -f
26 CHK_DIR_EXISTS= test -d
27 MKDIR         = mkdir -p
28 SUBTARGETS    =  \
29         sub-common-lib \
30         sub-emdesktopclient \
31         sub-app \
32         sub-emdecorationplugin \
33         sub-emdesktopserver \
34         sub-tests
35
36 common/lib//$(MAKEFILE):
37     @$(CHK_DIR_EXISTS) common/lib/ || $(MKDIR) common/lib/
38     cd common/lib/ && $(QMAKE) /home/liuyang/Documents/emd/emd/common/lib/lib.pro -unix -o $(MAKEFILE)
39 sub-common-lib-qmake_all:  FORCE
[~/Documents/emd/emd/Makefile][make][+]            
/*************************************************************************************************************************/                                      
8  liuyang@liuyang-laptop:~/Documents/emd/emd$ make  //执行makefile
    出现如下错误:
   make[1]: Leaving directory `/home/liuyang/Documents/emd/emd/common/lib'
cd emdesktopclient/ && /usr/bin/qmake /home/liuyang/Documents/emd/emd/emdesktopclient/emdesktopclient.pro -unix -o Makefile
cd emdesktopclient/ && make -f Makefile
make[1]: Entering directory `/home/liuyang/Documents/emd/emd/emdesktopclient'
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -o emdesktopclient.o emdesktopclient.cpp
In file included from emdesktopclient.cpp:1:
emdesktopclient.h: In constructor ‘Container::Container(QWidget*)’:
emdesktopclient.h:42: error: ‘QCopChannel’ was not declared in this scope
emdesktopclient.h:42: error: ‘channel’ was not declared in this scope
emdesktopclient.h:42: error: expected type-specifier before ‘QCopChannel’
emdesktopclient.h:42: error: expected ‘;’ before ‘QCopChannel’
make[1]: *** [emdesktopclient.o] Error 1
make[1]: Leaving directory `/home/liuyang/Documents/emd/emd/emdesktopclient'
make: *** [sub-emdesktopclient-make_default-ordered] Error 2
根据出错信息是由于没有使用  :/usr/local/Trolltech/Qt-4.5.2 这里面的头文件以及库。

9 liuyang@liuyang-laptop:~/Documents/emd/emd$ vi ./emdesktopclient/Makefile
11 CC            = gcc
12 CXX           = g++
13 DEFINES       = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
14 CFLAGS        = -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
15 CXXFLAGS      = -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
16 INCPATH       = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I.
17 LINK          = g++
18 LFLAGS        = -Wl,-O1 -shared -Wl,-soname,libemdesktopclient.so.1
19 LIBS          = $(SUBLIBS)  -L/usr/lib -lQtGui -lQtCore -lpthread
发现  INCPATH 变量值没有改变。 修改Makefile 相关地方。 Makefile文件多,改动也大。
不过也最后出现这样的错误:
g++ -Wl,-O1 -o emd emdecoration.o emdecorationplugin.o emdesktopclient.o abstractsettingwidget.o applicationsmanager.o applink.o backgroundsettingwidget.o categorytabwidget.o colorselectdialog.o datetimedisplaywidget.o datetimelabel.o documentlistwidget.o emdesktop.o launcherwindow.o main.o mimetype.o qtcolortriangle.o runningappsbar.o screensaver.o settingwindow.o taskbar.o timesettingwidget.o main.o main.o main.o main.o fileselectdialog.o fileselectlistwidget.o Config.o PinyinEngine.o PinyinFrame.o public.o testappinfo.o testapplicationsmanager.o testmimetype.o imageviewer.o imageviewerdata.o main.o main.o testimageviewerdata.o PinyinPhrase.o scim_pinyin.o moc_emdesktopclient.o moc_abstractsettingwidget.o moc_applicationsmanager.o moc_applink.o moc_backgroundsettingwidget.o moc_categorytabwidget.o moc_colorselectdialog.o moc_datetimedisplaywidget.o moc_datetimelabel.o moc_documentlistwidget.o moc_emdesktop.o moc_launcherwindow.o moc_qtcolortriangle.o moc_runningappsbar.o moc_settingwindow.o moc_taskbar.o moc_timesettingwidget.o moc_fileselectdialog.o moc_fileselectlistwidget.o moc_PinyinFrame.o moc_testappinfo.o moc_testapplicationsmanager.o moc_testmimetype.o moc_imageviewer.o moc_testimageviewerdata.o qrc_resource.o    -L/usr/local/Trolltech/Qt-4.5.2/lib -lQtTest -lQtGui -lQtCore -lpthread  -lqwt  -lpoppler  
main.o: In function `main':
main.cpp:(.text+0x0): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
main.o: In function `main':
main.cpp:(.text+0x0): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
main.o: In function `main':
main.cpp:(.text+0x0): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
main.o: In function `main':
main.cpp:(.text+0x0): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
testappinfo.o: In function `main':
testappinfo.cpp:(.text+0x0): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
testapplicationsmanager.o: In function `main':
testapplicationsmanager.cpp:(.text+0x3180): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
testmimetype.o: In function `main':
testmimetype.cpp:(.text+0x0): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
main.o: In function `main':
main.cpp:(.text+0x0): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
main.o: In function `main':
main.cpp:(.text+0x0): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
collect2: ld returned 1 exit status
make: *** [emd] Error 1

希望请你指点一下。  我到底那一个地方错了。
离线xiaozhi_su
只看该作者 47楼 发表于: 2010-07-31
楼主很强大!
昨天下载源码编译时发现了点小错误:
1、
emd/app/imageviewer/src/image 下图片命名是Symbols-Delete-32_32.png
而对应的qrc文件resource.qrc是Symbols-Delete-32*32.png,这里有点小错误
<RCC>
    <qresource prefix="/">
        <file>image/Symbols-Delete-32*32.png</file>
    </qresource>
</RCC>
2、
emd/emdesktopserver/ timesettingwidget.cpp用到了stime()函数,使用该函数时最好包含头文件time.h
#include <time.h>
和宏定义
#define _SVID_SOURCE
否则在某些编译器下会报错。

Cute Qt!
离线hangbing0203
只看该作者 48楼 发表于: 2010-07-31
上楼的 你是怎么编译的呢?
离线hangbing0203
只看该作者 49楼 发表于: 2010-07-31
export   export INCPATH=-I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.5.2/include/QtCore -I/usr/local/Trolltech/Qt-4.5.2/
    include/QtGui -I/usr/local/Trolltech/Qt-4.5.2/include/QtTest -I/usr/local/Trolltech/Qt-4.5.2/include -I. -Iemdecorationplugin -        
    Iemdesktopclient -Iemdesktopserver -Icommon/include -Iemdesktopserver/MurphyPinyin -Iemdesktopserver/MurphyPinyin/scim -              
    Iemdesktopserver/MurphyPinyin/phrase -Iapp/pdfviewer -Itests/testappinfo -Itests/testapplicationsmanager -Itests/                      
    testmimetype -Iapp/imageviewer/src -Iapp/imageviewer/tests -I.  这样有问题。

必须加“” 。
离线xiaozhi_su
只看该作者 50楼 发表于: 2010-07-31
楼主写了个install文件,你照着编译就可以了,编译前需要你make distclean 一下;
还有就是emd/emdesktopserver/emdesktopserver.pro 文件修改一下:
48 LIBS += -L/home/su/qwt-5.2.1/lib -lqwt -L../common/lib -lcommon
49 INCLUDEPATH += ../common/include /home/su/qwt-5.2.1/src
就是上面两行,修改成你的qwt路径(上面是我的qwt路径变量)。
顺便说一下,我用的是qte4.6.3,在arm板上和x86上都没问题。

Cute Qt!
离线zzz945
只看该作者 51楼 发表于: 2010-07-31
引用第47楼xiaozhi_su于2010-07-31 10:47发表的  :
楼主很强大!
昨天下载源码编译时发现了点小错误:
1、
emd/app/imageviewer/src/image 下图片命名是Symbols-Delete-32_32.png
而对应的qrc文件resource.qrc是Symbols-Delete-32*32.png,这里有点小错误
.......



1.刚查看了源码库, emd/app/imageviewer/src/image 下图片命名是Symbols-Delete-32*32.png, 不知道为什么你的是Symbols-Delete-32_32.png
2.#include <time.h>已经添加, 但宏定义_SVID_SOURCE不知道什么意思, 以及为什么要添加
离线zzz945
只看该作者 52楼 发表于: 2010-07-31
引用第49楼hangbing0203于2010-07-31 11:12发表的  :
export   export INCPATH=-I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/Qt-4.5.2/include/QtCore -I/usr/local/Trolltech/Qt-4.5.2/
    include/QtGui -I/usr/local/Trolltech/Qt-4.5.2/include/QtTest -I/usr/local/Trolltech/Qt-4.5.2/include -I. -Iemdecorationplugin -        
    Iemdesktopclient -Iemdesktopserver -Icommon/include -Iemdesktopserver/MurphyPinyin -Iemdesktopserver/MurphyPinyin/scim -              
    Iemdesktopserver/MurphyPinyin/phrase -Iapp/pdfviewer -Itests/testappinfo -Itests/testapplicationsmanager -Itests/                      
    testmimetype -Iapp/imageviewer/src -Iapp/imageviewer/tests -I.  这样有问题。
.......


这样修改Makefile是肯定不行的, 因为编译的结果并不是得到单一的应用程序, 你这样会造成程序连接的时候会找到N多main函数而不知道要连接哪个。
至于怎么办, 我建议不要修改Makefile,  而是通过别的方式比如环境变量或者在qtcreator里面设置qt路径的方法指定你想要用的qt版本, 至于环境变量怎样设请参考网上其他资料, 我是在qtcreator里面弄的。
离线xiaozhi_su
只看该作者 53楼 发表于: 2010-07-31
回 51楼(zzz945) 的帖子
SVID就是SystemV的接口描述,GNU C函数库定义了大多数由SVID指定

而为被ISO C和POSIX标准指定的函数。如果你使用的是glib2的话,必须

先定义这个宏_SVID_SOURCE才能使用stime()函数。不过这可能是我

多虑,加上time.h头文件就够了,现在编译Qte4一般都用gcc4.x的版本。
至于文件名不匹配,我说不上为什么,源码没错就好。我的源码是从

SourceForge上下的,用opera浏览器下的,下完后编译发现出错的。
Cute Qt!
离线hangbing0203
只看该作者 54楼 发表于: 2010-07-31
现在终于遍通了运行的时候出现错误:
./emdesktop :error  while loading shared libaries:liwqwt.so.5  cannot open shared
  我就把qwt库全部复制到 emd/comon/lib目录下。
   但还是出现找不到库。
emd/emdesktop-runing-environment/app里面有生成文件,make intall应该是没有问题的。

请问怎么搞定定呢。
离线xiaozhi_su
只看该作者 55楼 发表于: 2010-07-31
回 54楼(hangbing0203) 的帖子
你还是没读懂楼主的install文件。
你应该把qwt的lib文件拷贝到你的$QTEDIR/lib目录下,而你放在emd/comon/lib目录下怎么会对呢。
Cute Qt!
离线zzz945
只看该作者 56楼 发表于: 2010-07-31
引用第54楼hangbing0203于2010-07-31 16:56发表的  :
现在终于遍通了运行的时候出现错误:
./emdesktop :error  while loading shared libaries:liwqwt.so.5  cannot open shared
  我就把qwt库全部复制到 emd/comon/lib目录下。
   但还是出现找不到库。
emd/emdesktop-runing-environment/app里面有生成文件,make intall应该是没有问题的。
.......


楼上正解
离线hangbing0203
只看该作者 57楼 发表于: 2010-07-31
但是 ./emdesktop :error  while loading shared libaries:liwqwt.so.5  cannot open shared
找不到库呢。
请问我要把这个库放在那里呢。

今天郁闷得很:
ubuntu10.04 始终出现QCopChannel没有定义。 最后只有修改Makefile  让他去找QtE-4.5.2
换成ubuntu8.04  就没有出现上面的问题。其实也出现了一点小问题,比如说moc***.cpp
QT版本不匹配,修改 Makefile指向QtE-4.5.2。
编译通过后 但是找不到库。
静态编译,发现必须把qtE-4.5.2静态编译,麻烦啊

明天 从头来过。看看我到底那里出错。
离线xiaozhi_su
只看该作者 58楼 发表于: 2010-07-31
回 57楼(hangbing0203) 的帖子
学习本来就是一个循序渐进的过程,有什么郁闷的。
你应该编译X86版本的吧。
要是x86版本的话,你的Qte安装到什么目录了。例如我的默认会安装的/usr/local/Trolltech/QtEmbedded-4.6.3目录下,你的QtE4.5.2要是编译时没指定安装路径的话应该安装到/usr/local/Trolltech/QtEmbedded-4.5.2目录下。这就是楼主说的$QTEDIR,也是通用的叫法。
你把自己编译好的qwt的库拷到/usr/local/Trolltech/QtEmbedded-4.5.2/lib这个目录下就可以了。
Cute Qt!
离线zzz945
只看该作者 59楼 发表于: 2010-07-31
引用第57楼hangbing0203于2010-07-31 18:23发表的  :
但是 ./emdesktop :error  while loading shared libaries:liwqwt.so.5  cannot open shared
找不到库呢。
请问我要把这个库放在那里呢。
今天郁闷得很:
.......


放在哪上面已经说了, 假如你的qt的安装目录是qt-embedded-4.6.3-x86, 那你就放在qt-embedded-4.6.3-x86/lib里面, 还有就是和你用什么系统编译是没有关系的, ubuntu也好, fedora也好, 关键就是指定使用正确的qt embedded版本进行编译, 而不是系统里面带的qt for x11.  而且这是不用修改Makefile的。可能你还差点运气, 加油
离线xiaozhi_su
只看该作者 60楼 发表于: 2010-07-31
回 57楼(hangbing0203) 的帖子
要是QCopChannel没定义的话,你要确定你是不是使用嵌入式版本的Qt(如x86版本的或是arm版本的)进行编译,仔细看了你的过程,感觉你是使用X11版本的Qt环境进行编译。
remember this:QCopChannel is only available in Qt for Embedded Linux。
Cute Qt!
离线hangbing0203
只看该作者 61楼 发表于: 2010-08-02
我下的是QtEmbedded-4.5.2,安装在默认目录。环境变量export QTEDIR=/usr/local/Trolltech/QtEmbedded-4.5.2

现在我有些地方不明白:
1  当我把执行qmake的时候,查看顶层的Makefile  
9 first: make_default
10 MAKEFILE      = Makefile
11 QMAKE         = /usr/bin/qmake
12 DEL_FILE      = rm -f
13 CHK_DIR_EXISTS= test -d
14 MKDIR         = mkdir -p
15 COPY          = cp -f
16 COPY_FILE     = $(COPY)
17 COPY_DIR      = $(COPY) -r
18 INSTALL_FILE  = install -m 644 -p
19 INSTALL_PROGRAM = install -m 755 -p
20 INSTALL_DIR   = $(COPY_DIR)
21 DEL_FILE      = rm -f
22 SYMLINK       = ln -sf
23 DEL_DIR       = rmdir
24 MOVE          = mv -f
25 CHK_DIR_EXISTS= test -d
26 MKDIR         = mkdir -p
27 SUBTARGETS    =  \
28         sub-common-lib \
29         sub-emdesktopclient \
30         sub-app \
31         sub-emdecorationplugin \
32         sub-emdesktopserver \
33         sub-tests
34
35 common/lib//$(MAKEFILE):
36     @$(CHK_DIR_EXISTS) common/lib/ || $(MKDIR) common/lib/
37     cd common/lib/ && $(QMAKE) lib.pro -unix -o $(MAKEFILE)
38 sub-common-lib-qmake_all:  FORCE
39     @$(CHK_DIR_EXISTS) common/lib/ || $(MKDIR) common/lib/
40     cd common/lib/ && $(QMAKE) lib.pro -unix -o $(MAKEFILE)
41 sub-common-lib: common/lib//$(MAKEFILE) FORCE
42     cd common/lib/ && $(MAKE) -f $(MAKEFILE)
43 sub-common-lib-make_default-ordered: common/lib//$(MAKEFILE) FORCE
44     cd common/lib/ && $(MAKE) -f $(MAKEFILE)
45 sub-common-lib-make_default: common/lib//$(MAKEFILE) FORCE
46     cd common/lib/ && $(MAKE) -f $(MAKEFILE)
47 sub-common-lib-make_first-ordered: common/lib//$(MAKEFILE) FORCE
48     cd common/lib/ && $(MAKE) -f $(MAKEFILE) first
49 sub-common-lib-make_first: common/lib//$(MAKEFILE) FORCE
50     cd common/lib/ && $(MAKE) -f $(MAKEFILE) first
51 sub-common-lib-all-ordered: common/lib//$(MAKEFILE) FORCE
52     cd common/lib/ && $(MAKE) -f $(MAKEFILE) all
53 sub-common-lib-all: common/lib//$(MAKEFILE) FORCE
54     cd common/lib/ && $(MAKE) -f $(MAKEFILE) all
55 sub-common-lib-clean-ordered: common/lib//$(MAKEFILE) FORCE
56     cd common/lib/ && $(MAKE) -f $(MAKEFILE) clean
57 sub-common-lib-clean: common/lib//$(MAKEFILE) FORCE
58     cd common/lib/ && $(MAKE) -f $(MAKEFILE) clean
59 sub-common-lib-distclean-ordered: common/lib//$(MAKEFILE) FORCE
60     cd common/lib/ && $(MAKE) -f $(MAKEFILE) distclean
61 sub-common-lib-distclean: common/lib//$(MAKEFILE) FORCE
62     cd common/lib/ && $(MAKE) -f $(MAKEFILE) distclean
63 sub-common-lib-install_subtargets-ordered: common/lib//$(MAKEFILE) FORCE
64     cd common/lib/ && $(MAKE) -f $(MAKEFILE) install
......................................................
  255         /usr/share/qt4/mkspecs/qconfig.pri \
256         /usr/share/qt4/mkspecs/features/qt_functions.prf \
257         /usr/share/qt4/mkspecs/features/qt_config.prf \
258         /usr/share/qt4/mkspecs/features/exclusive_builds.prf \
259         /usr/share/qt4/mkspecs/features/default_pre.prf \
260         /usr/share/qt4/mkspecs/features/release.prf \
261         /usr/share/qt4/mkspecs/features/default_post.prf \
262         /usr/share/qt4/mkspecs/features/warn_on.prf \
263         /usr/share/qt4/mkspecs/features/qt.prf \
264         /usr/share/qt4/mkspecs/features/unix/thread.prf \
265         /usr/share/qt4/mkspecs/features/moc.prf \
266         /usr/share/qt4/mkspecs/features/resources.prf \
267         /usr/share/qt4/mkspecs/features/uic.prf \
268         /usr/share/qt4/mkspecs/features/yacc.prf \
269         /usr/share/qt4/mkspecs/features/lex.prf
270     $(QMAKE) -unix -o Makefile emd.pro
271 /usr/share/qt4/mkspecs/common/g++.conf:
272 /usr/share/qt4/mkspecs/common/unix.conf:
273 /usr/share/qt4/mkspecs/common/linux.conf:
274 /usr/share/qt4/mkspecs/qconfig.pri:
275 /usr/share/qt4/mkspecs/features/qt_functions.prf:
276 /usr/share/qt4/mkspecs/features/qt_config.prf:
277 /usr/share/qt4/mkspecs/features/exclusive_builds.prf:
278 /usr/share/qt4/mkspecs/features/default_pre.prf:
279 /usr/share/qt4/mkspecs/features/release.prf:
280 /usr/share/qt4/mkspecs/features/default_post.prf:
281 /usr/share/qt4/mkspecs/features/warn_on.prf:
282 /usr/share/qt4/mkspecs/features/qt.prf:
283 /usr/share/qt4/mkspecs/features/unix/thread.prf:
284 /usr/share/qt4/mkspecs/features/moc.prf:
285 /usr/share/qt4/mkspecs/features/resources.prf:
286 /usr/share/qt4/mkspecs/features/uic.prf:
287 /usr/share/qt4/mkspecs/features/yacc.prf:
288 /usr/share/qt4/mkspecs/features/lex.prf:
289 qmake: qmake_all FORCE
290     @$(QMAKE) -unix -o Makefile emd.pro    

很明显 产生出来的Makefile 是有问题的:
错误 1: 11 QMAKE         = /usr/bin/qmake  应该是:QMAKE=/usr/local/Trolltech/QtEmbedded-4.5.2
错误2: 288 /usr/share/qt4/mkspecs/features/lex.pr应该是:/usr/local/Trolltech/QtEmbedded-4.5.2/mkspecs

在看其它的Makefile:
vi emdesktopclient/Makefile

1 #############################################################################
  2 # Makefile for building: libemdesktopclient.so.1.0.0
  3 # Generated by qmake (2.01a) (Qt 4.4.0) on: Sun Aug 1 17:55:27 2010
  4 # Project:  emdesktopclient.pro
  5 # Template: lib
  6 # Command: /usr/bin/qmake -unix -o Makefile emdesktopclient.pro
  7 #############################################################################
  8
  9 ####### Compiler, tools and options
10
11 CC            = gcc
12 CXX           = g++
13 DEFINES       = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
14 CFLAGS        = -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
15 CXXFLAGS      = -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
16 INCPATH       = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/
    qt4 -I. -I.
17 LINK          = g++
18 LFLAGS        = -Wl,--no-undefined -shared -Wl,-soname,libemdesktopclient.so.1
19 LIBS          = $(SUBLIBS)  -L/usr/lib -lQtGui -lQtCore -lpthread
20 AR            = ar cqs
21 RANLIB        =
22 QMAKE         = /usr/bin/qmake
23 TAR           = tar -cf
24 COMPRESS      = gzip -9f
25 COPY          = cp -f
26 SED           = sed
27 COPY_FILE     = $(COPY)
28 COPY_DIR      = $(COPY) -r
29 INSTALL_FILE  = install -m 644 -p
30 INSTALL_DIR   = $(COPY_DIR)
31 INSTALL_PROGRAM = install -m 755 -p
32 DEL_FILE      = rm -f
33 SYMLINK       = ln -sf
34 DEL_DIR       = rmdir
35 MOVE          = mv -f
36 CHK_DIR_EXISTS= test -d
37 MKDIR         = mkdir -p
38
39 ####### Output directory
40
41 OBJECTS_DIR   = ./
42
43 ####### Files
44
45 SOURCES       = emdesktopclient.cpp moc_emdesktopclient.cpp
46 OBJECTS       = emdesktopclient.o \
47         moc_emdesktopclient.o
48 DIST          = /usr/share/qt4/mkspecs/common/g++.conf \
49         /usr/share/qt4/mkspecs/common/unix.conf \
50         /usr/share/qt4/mkspecs/common/linux.conf \
51         /usr/share/qt4/mkspecs/qconfig.pri \

很明显Makefile  错误:
其中很关键的:
16 INCPATH       = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/
应该INCPATH       = -Iusr/local/Trolltech/QtEmbedded-4.5.2/mkspecs/linux-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.5.2/QtCore -I/usr/local/Trolltech/QtEmbedded-4.5.2/QtCore -I/usr/local/Trolltech/QtEmbedded-4.5.2QtGui -I/usr/local/Trolltech/QtEmbedded-4.5.2/QtGui -I/usr/local/Trolltech/QtEmbedded-4.5.2/include


编译过程是:
liuyang@liuyang-desktop:~/emd/emd$ make
cd common/lib/ && make -f Makefile
make[1]: Entering directory `/home/liuyang/emd/emd/common/lib'
make[1]: Nothing to be done for `first'.
make[1]: Leaving directory `/home/liuyang/emd/emd/common/lib'
cd emdesktopclient/ && make -f Makefile
make[1]: Entering directory `/home/liuyang/emd/emd/emdesktopclient'
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o emdesktopclient.o emdesktopclient.cpp

很明显也是错的。

我就搞不懂了哈, 环境变量设置正确了的,为什么编译过程过程中没有改变呢。
难道我的环境变量设置有问题吗?

希望编译通过的师兄告诉我一下,你们的环境变量怎么设置的呢?

离线xiaozhi_su
只看该作者 62楼 发表于: 2010-08-02
你有没有设置环境变量PATH?
感觉你仅仅设置了QTEDIR,而没有设置PATH。你在终端下执行如下语句试试:
export QTEDIR=/usr/local/Trolltech/QtEmbedded-4.5.2
export  PATH=$QTEDIR/bin:$PATH
Cute Qt!
离线zzz945
只看该作者 63楼 发表于: 2010-08-05
经过几天的努力, EMD的灵活性大大提高, 下面是个简单介绍, 教你创建EMD构件
附件: 教你创建emd构件.pdf.tar.gz (382 K) 下载次数:50
离线xiaozhi_su
只看该作者 64楼 发表于: 2010-08-06
赞楼主!
Cute Qt!
离线hugerat
只看该作者 65楼 发表于: 2010-08-22
楼主的东西真是太棒了,可是我编译时遇到问题。

我下的是楼主最新的版本。也已经安装了qwt5.2.1。

也在emd.pro中,按说明添加了INCLUDEPATH变量,指了qwt的include目录所在地。可以看到,这个变量应该是起作了。在代码中会自动补全qwt的头文件名了,但是,在make时,总是汇报找不到头文件,请楼主帮帮我。
离线xiaozhi_su
只看该作者 66楼 发表于: 2010-08-22
回 65楼(hugerat) 的帖子
你贴出详细错误信息才能帮你的!
Cute Qt!
离线hugerat
只看该作者 67楼 发表于: 2010-08-23
问题解决了,其实是我没看仔细,应该是在emdesktopserver.pro中修改才对。这个软件最的真是太好了。
离线yinsun_01
只看该作者 68楼 发表于: 2010-08-23
你好!是否可以移植一个手写体输入法在EMD中? 应该怎样做呢?多谢!

离线zzz945
只看该作者 69楼 发表于: 2010-08-23
引用第68楼yinsun_01于2010-08-23 16:38发表的  :
你好!是否可以移植一个手写体输入法在EMD中? 应该怎样做呢?多谢!



手写输入法我也没做过, 所以目前给不出什么建议, 不过我会努力尝试, 欢迎提出意见和参与和讨论
离线hugerat
只看该作者 70楼 发表于: 2010-08-27
再次感谢楼主的共享,还想麻烦楼主能不能大致说明一下代码结构呢?方便我学习。谢谢了。
离线zzz945
只看该作者 71楼 发表于: 2010-08-27
现在正在弄个简单的手写输入法,  基于zinnia,按正确的笔画顺序一笔一笔的写识别率还蛮高, 但连笔和倒下笔就识别不出了。  过两天我会整理出代码结构的文档, 请稍候
离线zzz945
只看该作者 72楼 发表于: 2010-09-03
changes:
添加了手写输入法和输入法管理器

下面一个文档希望对感兴趣的朋友有帮助
附件: EMD架构介绍.pdf.tar.gz (420 K) 下载次数:45
离线xiaozhi_su
只看该作者 73楼 发表于: 2010-09-05
楼主,我今天下了源码,发现handwriting目录下没有handwritinginputmethod.cpp和handwritinginputmethod.h这两个文件。
但是handwriting.pri是这样写的
SOURCES +=     handwriting/tablet.cpp    \
                handwriting/resultchooser.cpp   \
                handwriting/handwritinginputmethod.cpp
HEADERS +=     handwriting/tablet.h    \
                handwriting/resultchooser.h    \
                handwriting/handwritinginputmethod.h
Cute Qt!
离线zzz945
只看该作者 74楼 发表于: 2010-09-06
谢谢你指出这个疏忽, 现在已经添加进去了
离线喃喃
只看该作者 75楼 发表于: 2010-09-06
mark,20100906
离线watery920
只看该作者 76楼 发表于: 2010-09-28
楼主 您好 我放到板子上去运行!!
testedit程序!! 按下ctrl+space 没输入法出现
也没出现什么软键盘 请问该怎办
离线zzz945
只看该作者 77楼 发表于: 2010-09-30
现在应该是当可以接受键盘输入的控件获得焦点之后软件盘会自动出现, 你点击任务栏上的输入法图标试一下
离线watery920
只看该作者 78楼 发表于: 2010-10-01
是点击左下那个图,会出现PINYIN吧?但是点击下去却没出现任何事件!!
其实主要是我需要用到软键盘与输入法!!请问楼主,我要如何单独把这2个应用程序单独取出?如果可以的话!!也希望可以留下MAIL,感谢!!
离线zzz945
只看该作者 79楼 发表于: 2010-10-05
代码在murphypinyin目录下,  pinyininputmethod.h中有PinyinInputMethod类继承了AbstractInputMethod, 是输入法对外的接口, AbstractInputMethod类可以在guibase.h中找到定义。另外要根据你的情况修改下pinyininputmethod.cpp中输入法数据库的位置
我的qq: 642010820, 邮件就是qq邮箱
快速回复
限100 字节
 
上一个 下一个