【问题标题】:Premake not working with g++ on Linux?Premake 在 Linux 上不能与 g++ 一起使用?
【发布时间】:2015-01-15 04:05:06
【问题描述】:

Premake 版本:4.3(下载here

在 Linux 上运行 make 时,我收到以下错误:“g++: x86_64: No such file or directory。”从 CFLAGS 中删除 $(ARCH) 后,make 工作正常。

红帽:

  • 系统版本(“cat /etc/redhat-release”):Red Hat Enterprise Linux Server 6.5 版(圣地亚哥)
  • 内核版本(“uname -r”):2.6.32-431.11.2.el6.x86_64
  • “uname -p”:x86_64
  • “uname -m”:x86_64
  • C++ 编译器:g++

Ubuntu:

  • 系统版本(“cat /etc/issue”):Ubuntu 12.04.5 LTS
  • 内核版本(“uname -r”):3.2.0-67-generic
  • “uname -p”:x86_64
  • “uname -m”:x86_64
  • C++ 编译器:g++

我也在 Mac 上成功运行过相同的程序。

苹果机:

  • 系统版本:OS X 10.10 (14A389)
  • 内核版本:Darwin 14.0.0
  • “uname -p”:i386
  • “uname -m”:x86_64
  • C++ 编译器:clang

premake4.lua

solution "Hello"
  configurations { "Debug", "Release" }

    configuration { "Debug" }
      defines { "_DEBUG", "DEBUG" }
      flags   { "Symbols", "ExtraWarnings" }

    configuration { "Release" }
      defines { "NDEBUG" }
      flags   { "Optimize" }

  project "hello"

    kind "ConsoleApp"
    language "C++"
    location "."

    files { "hello.cpp" }

hello.cpp 是标准的 hello world 程序。

$(ARCH) 有什么原因吗?通过查看 clang 和 g++ 的文档,似乎只提供没有标志的架构类型是编译器选项。我错过了什么吗?

【问题讨论】:

  • 这可能是一个错误。尝试在未定义 ARCH 环境变量的情况下运行 premake。
  • 谢谢@n.m.!这行得通,但它似乎是一种解决方法。我可以在我的 premake4.lua 脚本中添加一个 shell 脚本调用来取消设置,或者我可以在每次打开新 shell 时手动取消设置,但这两个选项似乎都是临时解决问题的方法。
  • 这确实是一种解决方法。向预制维护者提交错误?

标签: c++ linux redhat premake


【解决方案1】:

$(ARCH) 变量在生成的 makefile 中已经存在了很长一段时间,但它似乎已经过时了。 I have removed it for now;如果仍然需要在构建中注入标志,我们可以找到一个更安全的名称。

您可以从Premake 4.x BitBucket repository 获取固定版本。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-09-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-18
    • 2014-04-09
    • 2020-09-13
    • 1970-01-01
    相关资源
    最近更新 更多