• Mac中编译安装Qt 4.4


    解压下载到的.gz源码:
    gunzip xxx.tar.gz
    tar xvf xxx.tar, 其实在Mac中可以直接双击解压的.
    然后定位到解压后的目录下:
    ./configure
    make
    sudo make install
    这样Qt就会被安装到/usr/local/Trolltech/qt-4.4.0 了
    这样, 就可以用qmake了.
    /usr/local/Trolltech/Qt-4.4.0/bin/qmake -project
    /usr/local/Trolltech/Qt-4.4.0/bin/qmake 
    make -f Makefile
    open ./Qt01.app

    In order to use Qt, some environment variables need to be extended.

                PATH               - to locate qmake, moc and other Qt tools
    This is done like this:
    In .profile (if your shell is bash), add the following lines:

    PATH=/usr/local/Trolltech/Qt-4.3.4/bin:$PATH
    export PATH


    In .login (in case your shell is csh or tcsh), add the following line:
            setenv PATH /usr/local/Trolltech/Qt-4.3.4/bin:$PATH

    If you use a different shell, please modify your environment variables accordingly.

    更详细的说明见:http://doc.trolltech.com/4.3/install-mac.html


    1. 添加 PATH:在终端下敲 vim ~/.profile
    不知道你会用 vim 不会,不会的话搜索一下网络;然后添加 export PATH="/usr/local/Trolltech/Qt-4.4.0/bin:$PATH"
    保存、退出 vim,最后重新启动终端,新路径就有了:可以用 echo $PATH 看看。

    2. 打开 *.app 文件:你可以直接在 Finder 中双击打开啊(要转到/usr/local/Trolltech/Qt-4.4.0/bin 目录,在 Finder 菜单中有的)
    或者在终端中使用 open *.app 这样就可以了。

    3. 发布 qt 程序,和 Win 上一样,也是找到需要的 dylib 等资源,然后打包一起发布。
    XCode 中也有相关工具的,见 /Developer/Applications,具体我没有尝试过,以后大家一起探索看看...

    http://www.cppblog.com/biao/archive/2008/05/09/49271.html

  • 相关阅读:
    UVALive 6584 Escape (Regionals 2013 >> Europe
    莫比乌斯反演
    POJ 3986 Math teacher's homework
    ACM一些题目
    重探 DFT
    GDSOI2015 task4 ACU
    GDSOI2015 task2 覆盖半径
    USACO 2005 January Gold The Wedding Juicer
    CQOI2015 选数
    计算圆的包含(两两圆不相交)
  • 原文地址:https://www.cnblogs.com/findumars/p/5979160.html
Copyright © 2020-2023  润新知