代码之家  ›  专栏  ›  技术社区  ›  user177800

如何让xcode3.2.3正确包含SpiderMonkey jsapi.h文件?

  •  1
  • user177800  · 技术社区  · 14 年前

    我在xcode3.2.3中创建了一个C命令行应用程序。我已经从命令行编译了SpiderMonkey,并使其正常工作,这是针对couchdb0.11的。js解释器可以工作,所有文件也可以工作 /usr/local/spidermonkey/include /usr/local/spidermonkey/lib . 我补充说 /usr/local/spidermonkey/lib 去我的图书馆。

    每次我从 /usr/local/spidermonkey/include 并在我的主.c文件compliation breaks中引用它。为什么下面的代码不能编译?

    #include "jsapi.h"
    
    int main (int argc, const char * argv[]) 
    {
        return 0;
    }
    
    1 回复  |  直到 10 年前
        1
  •  2
  •   user177800 user177800    14 年前

    #define XP_UNIX 在你之前 #include "jsapi.h" . 这是没有任何教程或例子或任何我可以在谷歌上找到,但现在有! How to include SpiderMonkey in your XCode 3.2.3 project.

    #define XP_UNIX
    #include "jsapi.h"
    
    int main (int argc, const char* argv[]) 
    {
        return 0;
    }
    
    推荐文章