c++ - 如何在 Linux 上编译 ASL(基于 Adob​​e C++ 的图形用户界面库)?

标签 c++ linux boost adobe asl

简介

因此,我们在 CloudObserver 与包括我在内的 2 个人组成的所有团队一起度过了几天(这意味着我们的努力不如您的专业)试图用 ASL 来解决这个问题.

我们发现了how to compile ASL on windows and Mac OS.

我们创建了一些视觉/图形 GUI simple tutorials在与 Mac OS X 和 Windows 完美配合的 ASL 上,因此我们已经看到 Adob​​e 源库可用于创建至少简单的 UI 和对话框。

然后我们开始尝试让它在 linux 上运行。

肉类

我们已经开始在 Linux 上编译 ASL,首先修复了过时的问题 asl_1.0.43_net_setup.sh .我们的代码很简单:

#!/bin/bash

ASL_DISTRO_NAME=asl_1.0.43.tgz
ASL_NAME=source_release
APL_DISTRO_NAME=apl_1.0.43.tgz
APL_VERSION=1.0.43
APL_NAME=platform_release
ASL_DISTRO_SITE=surfnet.dl.sourceforge.net
BOOST_NAME=boost_1_44_0
BOOST_VERSION=1.44.0
BOOST_DISTRO_NAME="$BOOST_NAME".tar.gz
#-L protects against redirects
CURL_CMD=curl\ -L 
INTEL_TBB_NAME=tbb30_018oss
INTEL_TBB_DISTRO_NAME="$INTEL_TBB_NAME"_src.tgz

# Run a command, and echo before doing so. Also checks the exit
# status and quits if there was an error.
#
# WARNING : Does *not* work when the command uses the redirection operator (>)
#
echo_run ()
{
    echo "$@"
    "$@"
    r=$?
    if test $r -ne 0 ; then
        exit $r
    fi
}

test_path()
{
    hash $1 1>/dev/null 2>/dev/null
}

WD=`pwd`
MACHINE=`uname`
HERE=`dirname $0`

cd $HERE

if [ "$1" != "" ]; then
    ASL_DISTRO_SITE="$1"
fi
#http://surfnet.dl.sourceforge.net/project/adobe-source/adobe-source/1.0.43/asl_1.0.43.tgz
if [ ! -e $ASL_DISTRO_NAME ]; then
   echo_run ${CURL_CMD} http://$ASL_DISTRO_SITE/project/adobe-source/adobe-source/$APL_VERSION/$ASL_DISTRO_NAME -o $ASL_DISTRO_NAME
fi

if [ ! -e $APL_DISTRO_NAME ]; then
   echo_run ${CURL_CMD} http://$ASL_DISTRO_SITE/project/adobe-source/adobe-source/$APL_VERSION/$APL_DISTRO_NAME -o $APL_DISTRO_NAME
fi

if [ ! -e $BOOST_DISTRO_NAME ]; then
    echo_run ${CURL_CMD} http://$ASL_DISTRO_SITE/project/boost/boost/$BOOST_VERSION/$BOOST_DISTRO_NAME -o $BOOST_DISTRO_NAME
fi

if [ ! -e $INTEL_TBB_DISTRO_NAME ]; then
    echo_run ${CURL_CMD} http://www.threadingbuildingblocks.org/uploads/78/154/3.0/$INTEL_TBB_DISTRO_NAME -o $INTEL_TBB_DISTRO_NAME
fi

if [ ! -d adobe_root ]; then
    echo_run mkdir adobe_root
fi

if [ ! -d adobe_root/adobe_source_libraries ]; then
   echo_run tar -xzf $ASL_DISTRO_NAME
   echo_run mv $ASL_NAME adobe_root/adobe_source_libraries
fi

if [ ! -d adobe_root/adobe_platform_libraries ]; then
   echo_run tar -xzf $APL_DISTRO_NAME
   echo_run mv $APL_NAME adobe_root/adobe_platform_libraries
fi

if [ ! -e adobe_root/boost_libraries/INSTALL ]; then
    # move the boost distro into place
    echo_run tar -xzf $BOOST_DISTRO_NAME
    echo_run rm -rf adobe_root/boost_libraries
    echo_run mv $BOOST_NAME adobe_root/boost_libraries
fi

if [ ! -e adobe_root/intel_tbb_libraries/README ]; then
    # move the intel_tbb distro into place
    echo_run tar -xzf $INTEL_TBB_DISTRO_NAME
    echo_run rm -rf adobe_root/intel_tbb_libraries
    echo_run mv $INTEL_TBB_NAME adobe_root/intel_tbb_libraries
fi

cd $HERE
echo_run adobe_root/adobe_source_libraries/tools/patch_boost.sh

if [[ $MACHINE == "Darwin" ]]
then
    cd adobe_root/adobe_platform_libraries
else
    cd adobe_root/adobe_source_libraries
fi

echo_run ../adobe_source_libraries/tools/build.sh

echo Done!

exit 0

所以我们编译了 libasl_dev.a。可惜只有它。这对我们来说毫无用处,因为我们想要 have a GUI ,不仅仅是亚当读者。

因此我们需要一些类似于 Windows 上的 libasl_widgets.dll 的东西 - libasl_widgets_dev.a。我引用 ASL/platform_release/jamroot.jam

APL doesn't support gcc cygwin, though ASL does. Only supported toolsets for APL are msvc and darwin

所以 adobe 告诉我们它确实支持 Linux。那只是悲伤!方式 2 悲伤!所以我们找到了missioncode project .

它的日期是 2006 年和 boost 1.33.1,所以很遗憾。也很伤心here

External libraries which are used by mission are kept in here.

This keeps them in our build, and means we don't have to have any magical build scripts/rules to get the prereqs installed.

这意味着他们没有任何单独的库构建文件——库被合并到项目中。但是所有项目都是通过 bjam 编译的,在项目内部 Boost、ASL 和其他库都是 subdivided into projects .这意味着每个子项目都按顺序编译成可执行文件或 lib。

但我们真正需要的是 ASL 的简单 GUI,以满足不以 GUI 为中心的小型跨平台开源项目的简单需求。我们所需要的只是一个按钮、一个刻度(又名 slider 、又名轨迹栏)和一个文本输入框。以及 future 发展的一些规模选择。所以我们想 - 让我们尽可能地从任务代码项目中强制执行 ASL。

我们首先尝试了一些现代的 Ubuntu 11 和 11 以及我们每天使用的 OpenSuse(来自 here 的 VMware 版本的 Mono)。但它经常因大量错误而失败。所以我们认为 - 让我们更早地编译它,更适合项目时代的操作系统。我们从 Ubuntu 4 开始,一个版本一个版本地升级。它在 6.10 上编译,有一些小的修复,比如

diff -crB original/external/adobe/adobe/basic_sheet.hpp modified/external/adobe/adobe/basic_sheet.hpp
*** original/external/adobe/adobe/basic_sheet.hpp   2011-06-25 08:21:48.000000000 +0400
--- modified/external/adobe/adobe/basic_sheet.hpp   2011-06-25 08:24:33.000000000 +0400
***************
*** 13,18 ****
--- 13,19 ----

  #include <deque>
  #include <map>
+ #include <vector>

  #include <adobe/name.hpp>
  #include <adobe/any_regular.hpp>
diff -crB original/external/adobe/source/xstring.cpp modified/external/adobe/source/xstring.cpp
*** original/external/adobe/source/xstring.cpp  2011-06-25 08:21:46.000000000 +0400
--- modified/external/adobe/source/xstring.cpp  2011-06-25 08:24:10.000000000 +0400
***************
*** 331,337 ****
  {
      typedef std::iterator_traits<store_iterator>::difference_type   difference_type;

!     difference_type range_size(boost::size(range));

      if (!range_size) return glossary_m.end();

--- 331,337 ----
  {
      typedef std::iterator_traits<store_iterator>::difference_type   difference_type;

!     difference_type range_size(boost::distance(range));

      if (!range_size) return glossary_m.end();

我们让 Missioncode 使用 Widgets 编译 ASL。小部件完全由任务代码作者创建,因此如果它们有效则没有任何保证......但我们编译了完整的任务代码主干(还有一个名为 missionPhoto 的应用程序)并且应用程序运行良好。

我们试图用完整的 ASL 编译我们的代码,但看起来我们在窗口上的 ASL api 不能在我们在 Windows 上的 ASL 上工作......或多或少。=(

不是结束

但仍然希望你们中任何一位拥有丰富经验的亲爱的 SO 用户能够查看 MissionCode 和当前 ASL 中的 ASL,并为我们所有人提供适用于 Linux 的 ASL 1.0.43。

最佳答案


似乎当前版本的 apl 不支持为 linux 构建。它在文档中说明:http://stlab.adobe.com/asl_readme.html#Building_for_Mac.2C_.2ANIX .您也可以在 apl 目录结构中看到它。有 $APL_ROOT/windows 和 $APL_ROOT/macintosh 目录,但没有任何与 linux 相关的目录(比如 gtk、qt 等)
关于“任务代码”项目:他们使用一些旧版本的 adobe 库(它没有分离 asl 和 apl 等)。可能以前版本的 adobe libs 支持为 linux 构建(或者任务代码程序员自己为 gtk 添加了 spport)。
从理论上讲,可以通过实现与 win 和 macos 类似的功能来添加对新平台的支持(在当前版本中,每个代码大约有 6...8k 行),但我认为这项工作不会太容易了。
无论如何,祝你好运! :)

关于c++ - 如何在 Linux 上编译 ASL(基于 Adob​​e C++ 的图形用户界面库)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6461621/

相关文章:

c++ - 为什么我可以更新 boost::fibonacci_heap 中弹出的元素?

c++ - 在即将到来的 c++0x 标准下,我们可以通过这种语法将数组作为参数传递给函数吗?

c++ - 用于 STL 兼容容器的样板类型定义

c++ - 仅从 Qt 编译特定库

c - 如何修复 mupdf 中的 "cannot find ExtGState dictionary"?

c++ - 在 Ubuntu 14.04 LTS 上安装 Qt Creator 3.1.2

c - 从文件读取 IP 地址的最有效方法

c++ - boost::hash<double> 在 RHEL 5.4 64 位上的奇怪行为

c++ - 等待线程直到条件发生

c++ - 在 Eclipse 中编译 Cygwin 项目