简体   繁体   English

Premake无法在Linux上使用g ++?

[英]Premake not working with g++ on Linux?

Premake Version: 4.3 (downloaded here ) 预制版本:4.3( 在此处下载)

When running make on Linux, I get the following error: "g++: x86_64: No such file or directory." 在Linux上运行make时,出现以下错误:“ g ++:x86_64:没有这样的文件或目录。” Upon removing the $(ARCH) from CFLAGS, make works fine. 从CFLAGS中删除$(ARCH)后,可以正常使用。

Red Hat: 红色的帽子:

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

Ubuntu: Ubuntu:

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

I've also run the same program successfully on Mac. 我也已经在Mac上成功运行了相同的程序。

Mac: 苹果电脑:

  • System Version: OS X 10.10 (14A389) 系统版本:OS X 10.10(14A389)
  • Kernel Version: Darwin 14.0.0 内核版本:达尔文14.0.0
  • "uname -p": i386 “ uname -p”:i386
  • "uname -m": x86_64 “ uname -m”:x86_64
  • C++ compiler: clang C ++编译器:clang

premake4.lua 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 is the standard hello world program. hello.cpp是标准的hello world程序。

Is there a reason for the $(ARCH)? $(ARCH)是否有原因? From looking at the documentation for both clang and g++, it does not seem like providing just the architecture type without a flag is a compiler option. 通过查看有关clang和g ++的文档,似乎不提供仅提供带有标志的体系结构类型就是编译器选项。 Am I missing something? 我想念什么吗?

That $(ARCH) variable has been in the generated makefiles for quite some time, but it appears it has outlived its usefulness. 该$(ARCH)变量已经存在于生成的makefile中很长时间了,但是看起来它的作用已经超过了它的用处。 I have removed it for now ; 我现在删除了 ; if there is still a need to inject flags into the build we can find a safer name. 如果仍然需要在构建中注入标志,我们可以找到一个更安全的名称。

You can get a fixed version from the Premake 4.x BitBucket repository . 您可以从Premake 4.x BitBucket存储库中获得固定版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM