- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
在尝试构建 lunatic-python 时,我对来 self 尝试过的多个编译器的错误深感困惑。 Mingw是我用的最远的编译器,目前我收到的垃圾邮件 block 包含
luainpython.o:luainpython.c:(.text+0x1b): undefined reference to `lua_type'
luainpython.o:luainpython.c:(.text+0x32): undefined reference to `_imp___Py_None
Struct'
luainpython.o:luainpython.c:(.text+0x3c): undefined reference to `_imp___Py_None
Struct'
luainpython.o:luainpython.c:(.text+0x43): undefined reference to `_imp___Py_None
Struct'
luainpython.o:luainpython.c:(.text+0x65): undefined reference to `lua_tolstring'
luainpython.o:luainpython.c:(.text+0x7a): undefined reference to `lua_objlen'
luainpython.o:luainpython.c:(.text+0x8f): undefined reference to `_imp__PyUnicod
eUCS2_FromStringAndSize'
luainpython.o:luainpython.c:(.text+0xab): undefined reference to `lua_tonumber'
luainpython.o:luainpython.c:(.text+0xf3): undefined reference to `_imp__PyFloat_
FromDouble'
luainpython.o:luainpython.c:(.text+0x114): undefined reference to `_imp__PyLong_
FromLong'
luainpython.o:luainpython.c:(.text+0x12d): undefined reference to `lua_toboolean
'
luainpython.o:luainpython.c:(.text+0x136): undefined reference to `_imp___Py_Tru
eStruct'
luainpython.o:luainpython.c:(.text+0x140): undefined reference to `_imp___Py_Tru
eStruct'
luainpython.o:luainpython.c:(.text+0x14a): undefined reference to `_imp___Py_Zer
oStruct'
luainpython.o:luainpython.c:(.text+0x154): undefined reference to `_imp___Py_Zer
oStruct'
luainpython.o:luainpython.c:(.text+0x16b): undefined reference to `luaPy_to_pobj
ect'
luainpython.o:luainpython.c:(.text+0x1c0): undefined reference to `_imp__PyExc_T
ypeError'
luainpython.o:luainpython.c:(.text+0x1d2): undefined reference to `_imp__PyErr_S
etString'
luainpython.o:luainpython.c:(.text+0x1e7): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0x1fc): undefined reference to `_imp__PyTuple
_Size'
luainpython.o:luainpython.c:(.text+0x21f): undefined reference to `_imp__PyTuple
_GetItem'
luainpython.o:luainpython.c:(.text+0x22f): undefined reference to `_imp__PyExc_T
ypeError'
luainpython.o:luainpython.c:(.text+0x248): undefined reference to `_imp__PyErr_F
ormat'
luainpython.o:luainpython.c:(.text+0x25d): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0x281): undefined reference to `py_convert'
luainpython.o:luainpython.c:(.text+0x28f): undefined reference to `_imp__PyExc_T
ypeError'
luainpython.o:luainpython.c:(.text+0x2a8): undefined reference to `_imp__PyErr_F
ormat'
luainpython.o:luainpython.c:(.text+0x2bd): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0x2f8): undefined reference to `lua_pcall'
luainpython.o:luainpython.c:(.text+0x317): undefined reference to `lua_tolstring
'
luainpython.o:luainpython.c:(.text+0x31d): undefined reference to `_imp__PyExc_E
xception'
luainpython.o:luainpython.c:(.text+0x333): undefined reference to `_imp__PyErr_F
ormat'
luainpython.o:luainpython.c:(.text+0x34a): undefined reference to `lua_gettop'
luainpython.o:luainpython.c:(.text+0x378): undefined reference to `_imp__PyExc_T
ypeError'
luainpython.o:luainpython.c:(.text+0x38a): undefined reference to `_imp__PyErr_S
etString'
luainpython.o:luainpython.c:(.text+0x39f): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0x3e5): undefined reference to `_imp__PyTuple
_New'
luainpython.o:luainpython.c:(.text+0x3f5): undefined reference to `_imp__PyExc_R
untimeError'
luainpython.o:luainpython.c:(.text+0x407): undefined reference to `_imp__PyErr_S
etString'
luainpython.o:luainpython.c:(.text+0x41c): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0x453): undefined reference to `_imp__PyExc_T
ypeError'
luainpython.o:luainpython.c:(.text+0x46c): undefined reference to `_imp__PyErr_F
ormat'
luainpython.o:luainpython.c:(.text+0x481): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0x4c8): undefined reference to `_imp__PyTuple
_SetItem'
luainpython.o:luainpython.c:(.text+0x4e0): undefined reference to `_imp___Py_Non
eStruct'
luainpython.o:luainpython.c:(.text+0x4ea): undefined reference to `_imp___Py_Non
eStruct'
luainpython.o:luainpython.c:(.text+0x4f1): undefined reference to `_imp___Py_Non
eStruct'
luainpython.o:luainpython.c:(.text+0x507): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0x51e): undefined reference to `_imp___PyObje
ct_New'
luainpython.o:luainpython.c:(.text+0x53d): undefined reference to `lua_pushvalue
'
luainpython.o:luainpython.c:(.text+0x552): undefined reference to `luaL_ref'
luainpython.o:luainpython.c:(.text+0x58c): undefined reference to `luaL_unref'
luainpython.o:luainpython.c:(.text+0x5b5): undefined reference to `luaL_unref'
luainpython.o:luainpython.c:(.text+0x5f0): undefined reference to `lua_rawgeti'
luainpython.o:luainpython.c:(.text+0x605): undefined reference to `lua_type'
luainpython.o:luainpython.c:(.text+0x61e): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0x623): undefined reference to `_imp__PyExc_R
untimeError'
luainpython.o:luainpython.c:(.text+0x635): undefined reference to `_imp__PyErr_S
etString'
luainpython.o:luainpython.c:(.text+0x656): undefined reference to `lua_isstring'
luainpython.o:luainpython.c:(.text+0x66f): undefined reference to `lua_type'
luainpython.o:luainpython.c:(.text+0x689): undefined reference to `lua_isuserdat
a'
luainpython.o:luainpython.c:(.text+0x6a2): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0x6a7): undefined reference to `_imp__PyExc_R
untimeError'
luainpython.o:luainpython.c:(.text+0x6b9): undefined reference to `_imp__PyErr_S
etString'
luainpython.o:luainpython.c:(.text+0x6e8): undefined reference to `py_convert'
luainpython.o:luainpython.c:(.text+0x706): undefined reference to `lua_gettable'
luainpython.o:luainpython.c:(.text+0x725): undefined reference to `_imp__PyExc_V
alueError'
luainpython.o:luainpython.c:(.text+0x737): undefined reference to `_imp__PyErr_S
etString'
luainpython.o:luainpython.c:(.text+0x74e): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0x77f): undefined reference to `lua_rawgeti'
luainpython.o:luainpython.c:(.text+0x794): undefined reference to `lua_type'
luainpython.o:luainpython.c:(.text+0x7ad): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0x7b2): undefined reference to `_imp__PyExc_R
untimeError'
luainpython.o:luainpython.c:(.text+0x7c4): undefined reference to `_imp__PyErr_S
etString'
luainpython.o:luainpython.c:(.text+0x7e5): undefined reference to `lua_type'
luainpython.o:luainpython.c:(.text+0x7ff): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0x804): undefined reference to `_imp__PyExc_T
ypeError'
luainpython.o:luainpython.c:(.text+0x816): undefined reference to `_imp__PyErr_S
etString'
luainpython.o:luainpython.c:(.text+0x83e): undefined reference to `py_convert'
luainpython.o:luainpython.c:(.text+0x85a): undefined reference to `lua_pushnil'
luainpython.o:luainpython.c:(.text+0x87f): undefined reference to `py_convert'
luainpython.o:luainpython.c:(.text+0x89d): undefined reference to `lua_settable'
luainpython.o:luainpython.c:(.text+0x8ab): undefined reference to `_imp__PyExc_V
alueError'
luainpython.o:luainpython.c:(.text+0x8bd): undefined reference to `_imp__PyErr_S
etString'
luainpython.o:luainpython.c:(.text+0x8c6): undefined reference to `_imp__PyExc_V
alueError'
luainpython.o:luainpython.c:(.text+0x8d8): undefined reference to `_imp__PyErr_S
etString'
luainpython.o:luainpython.c:(.text+0x8ef): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0x921): undefined reference to `lua_rawgeti'
luainpython.o:luainpython.c:(.text+0x93e): undefined reference to `luaL_callmeta
'
luainpython.o:luainpython.c:(.text+0x95f): undefined reference to `lua_tolstring
'
luainpython.o:luainpython.c:(.text+0x977): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0x988): undefined reference to `_imp__PyUnico
deUCS2_FromString'
luainpython.o:luainpython.c:(.text+0x9ac): undefined reference to `lua_type'
luainpython.o:luainpython.c:(.text+0x9dd): undefined reference to `lua_topointer
'
luainpython.o:luainpython.c:(.text+0x9f3): undefined reference to `lua_typename'
luainpython.o:luainpython.c:(.text+0xa07): undefined reference to `_imp__PyUnico
deUCS2_FromFormat'
luainpython.o:luainpython.c:(.text+0xa26): undefined reference to `lua_touserdat
a'
luainpython.o:luainpython.c:(.text+0xa3c): undefined reference to `lua_typename'
luainpython.o:luainpython.c:(.text+0xa50): undefined reference to `_imp__PyUnico
deUCS2_FromFormat'
luainpython.o:luainpython.c:(.text+0xa6c): undefined reference to `lua_tothread'
luainpython.o:luainpython.c:(.text+0xa82): undefined reference to `lua_typename'
luainpython.o:luainpython.c:(.text+0xa96): undefined reference to `_imp__PyUnico
deUCS2_FromFormat'
luainpython.o:luainpython.c:(.text+0xab1): undefined reference to `lua_typename'
luainpython.o:luainpython.c:(.text+0xac1): undefined reference to `_imp__PyUnico
deUCS2_FromFormat'
luainpython.o:luainpython.c:(.text+0xadc): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0xb00): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0xb1f): undefined reference to `lua_rawgeti'
luainpython.o:luainpython.c:(.text+0xb61): undefined reference to `lua_rawgeti'
luainpython.o:luainpython.c:(.text+0xb78): undefined reference to `lua_pushnil'
luainpython.o:luainpython.c:(.text+0xb99): undefined reference to `lua_rawgeti'
luainpython.o:luainpython.c:(.text+0xbae): undefined reference to `lua_next'
luainpython.o:luainpython.c:(.text+0xbc7): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0xbfe): undefined reference to `luaL_ref'
luainpython.o:luainpython.c:(.text+0xc25): undefined reference to `lua_rawseti'
luainpython.o:luainpython.c:(.text+0xc50): undefined reference to `luaL_unref'
luainpython.o:luainpython.c:(.text+0xc84): undefined reference to `lua_rawgeti'
luainpython.o:luainpython.c:(.text+0xc99): undefined reference to `lua_objlen'
luainpython.o:luainpython.c:(.text+0xcb1): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0xd1f): undefined reference to `_imp__PyArg_P
arseTuple'
luainpython.o:luainpython.c:(.text+0xda5): undefined reference to `luaL_loadbuff
er'
luainpython.o:luainpython.c:(.text+0xdc6): undefined reference to `lua_tolstring
'
luainpython.o:luainpython.c:(.text+0xdcc): undefined reference to `_imp__PyExc_R
untimeError'
luainpython.o:luainpython.c:(.text+0xde2): undefined reference to `_imp__PyErr_F
ormat'
luainpython.o:luainpython.c:(.text+0xe1e): undefined reference to `lua_pcall'
luainpython.o:luainpython.c:(.text+0xe3f): undefined reference to `lua_tolstring
'
luainpython.o:luainpython.c:(.text+0xe45): undefined reference to `_imp__PyExc_R
untimeError'
luainpython.o:luainpython.c:(.text+0xe5b): undefined reference to `_imp__PyErr_F
ormat'
luainpython.o:luainpython.c:(.text+0xe91): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0xef6): undefined reference to `lua_getfield'
luainpython.o:luainpython.c:(.text+0xf0b): undefined reference to `lua_type'
luainpython.o:luainpython.c:(.text+0xf14): undefined reference to `_imp__PyExc_R
untimeError'
luainpython.o:luainpython.c:(.text+0xf26): undefined reference to `_imp__PyErr_S
etString'
luainpython.o:luainpython.c:(.text+0xf3d): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0xf67): undefined reference to `_imp__PyExc_T
ypeError'
luainpython.o:luainpython.c:(.text+0xf79): undefined reference to `_imp__PyErr_F
ormat'
luainpython.o:luainpython.c:(.text+0xf90): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0xfb8): undefined reference to `lua_getfield'
luainpython.o:luainpython.c:(.text+0xfcd): undefined reference to `lua_type'
luainpython.o:luainpython.c:(.text+0xfe6): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.text+0xfeb): undefined reference to `_imp__PyExc_R
untimeError'
luainpython.o:luainpython.c:(.text+0xffd): undefined reference to `_imp__PyErr_S
etString'
luainpython.o:luainpython.c:(.text+0x102e): undefined reference to `_imp__PyType
_Ready'
luainpython.o:luainpython.c:(.text+0x1064): undefined reference to `_imp__Py_Ini
tModule4'
luainpython.o:luainpython.c:(.text+0x1087): undefined reference to `luaL_newstat
e'
luainpython.o:luainpython.c:(.text+0x1099): undefined reference to `luaL_openlib
s'
luainpython.o:luainpython.c:(.text+0x10a6): undefined reference to `luaopen_pyth
on'
luainpython.o:luainpython.c:(.text+0x10bb): undefined reference to `lua_settop'
luainpython.o:luainpython.c:(.data+0x8c): undefined reference to `PyObject_SelfI
ter'
luainpython.o:luainpython.c:(.data+0xb8): undefined reference to `PyType_Generic
Alloc'
luainpython.o:luainpython.c:(.data+0xbc): undefined reference to `PyType_Generic
New'
luainpython.o:luainpython.c:(.data+0xc0): undefined reference to `PyObject_Free'
c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../libmingw32.a(main.o): In function
`main':
C:\MinGW\msys\1.0\src\mingwrt/../mingw/main.c:73: undefined reference to `WinMai
n@16'
collect2: ld returned 1 exit status
抱歉,我找不到缩小它的方法。
无论如何,我还安装了 make,尝试像预期的那样运行 python 文件,但两者都出现了相同的错误:
python setup.py build
Traceback (most recent call last):
File "setup.py", line 47, in <module>
lua_pkgconfig = pkgconfig('lua', 'lua' + LUAVERSION)
File "setup.py", line 32, in pkgconfig
"pkg-config --libs --cflags %s" % package
File "C:\Python27\lib\subprocess.py", line 537, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "C:\Python27\lib\subprocess.py", line 679, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 893, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
我知道我有点含糊,这是因为我是新手,所以我不知道要提供什么信息。请让我知道您需要知道的内容。
提前致谢。
~少年
最佳答案
我假设您正在使用 bastibe/lunatic-python和 Python 2。
setup.py
中使用的
commands
包仅适用于 unix。您看到的错误是由以下代码引起的:http://hg.python.org/cpython/file/3a1db0d2747e/Lib/commands.py#l59
需要替换 setup.py
中的以下部分 .. :
# ..
for package in packages:
(pcstatus, pcoutput) = commands.getstatusoutput(
"pkg-config --libs --cflags %s" % package)
if pcstatus == 0:
break
else:
sys.exit("pkg-config failed for %s; "
"most recent output was:\n%s" %
(", ".join(packages), pcoutput))
# ..
.. 与等效的 subprocess
代码:
# ..
import subprocess
pcoutput = ""
for package in packages:
# raises exception if:
# - pkg-config is not found
# - pkg-config returns some error
pcoutput += subprocess.check_output(
"pkg-config --libs --cflags %s" % package
)
# ..
现在错误信息应该变得更清楚了。
(添加#1)
上面的代码尝试运行 pkg-config
命令,结果由于某种原因它失败了。如果您打开 MSYS shell(通常位于 C:\MinGW\msys\1.0\msys.bat
并运行 pkg-config
命令,则预期输出如下:
$ pkg-config --libs --cflags lua
-IC:/MinGW/msys/1.0/include -LC:/MinGW/msys/1.0/lib -llua -lm
文章 "gcc -L / -l option flags"和 "Using pkg-config files"可能有助于破译上面的命令。
(添加#2)
要使 msys shell 可用,必须安装 MinGW 并选择 msys-base
包。关于如何安装 MinGW 的好教程:Installing Minimum GNU for Windows (MinGW)
pkg-config
必须单独安装。看看MinGW FAQ和 Ctrl+F 表示“如何安装 pkg-config?”。
总之你得下载pkg-config-lite并将 zip 文件内容解压缩到 C:\MinGW\msys\1.0
。
来自 msys
外壳:
wget http://garr.dl.sourceforge.net/project/pkgconfiglite/0.28-1/pkg-config-lite-0.28-1_bin-win32.zip
unzip pkg-config-lite-0.28-1_bin-win32.zip
cp -R pkg-config-lite-0.28-1/* /usr
然后创建pkgconfig
目录:
mkdir /usr/lib/pkgconfig
验证 pkg-config 是否正常工作(并查看试图找到配置文件的位置):
pkg-config --debug
并验证您是否安装了所有必需的依赖项:
$ which gcc g++ wget tar make unzip
/usr/bin/gcc.exe
/usr/bin/g++.exe
/usr/bin/wget.exe
/usr/bin/tar.exe
/usr/bin/make.exe
/usr/bin/unzip.exe
很可能 lua 必须从源代码构建:
wget http://www.lua.org/ftp/lua-5.2.3.tar.gz
tar -xf lua-5.2.3.tar.gz
cd lua-5.2.3
make mingw
make INSTALL_TOP=/usr install
现在您必须手动创建/usr/lib/pkgconfig/lua.pc
。或者使用在 Linux From Scratch 页面上找到的一个:http://www.linuxfromscratch.org/blfs/view/svn/general/lua.html
现在 pkg-config
应该可以像上面描述的那样工作了。
关于python - 编译 lunatic-python 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21268706/
是否有任何库或框架旨在促进从另一种成熟的编程语言中构建项目? 在 C++、java 等编程语言中指定逻辑、集合和复杂规则非常容易,但在 Makefile 中完成这些事情似乎是一场艰苦的战斗。我还没有深
我有这段代码可以用 clang 编译得很好(即使使用 -Weverything),但是 gcc 会发出错误。 #include #include #include using namespace
我有以下 block 头文件 BKE_mesh.h: /* Connectivity data */ typedef struct IndexNode { struct IndexNode *
我在我的一个项目中遇到了一个奇怪的问题。我的代码库依赖于一个外部库,其中包含一个名为 Dataset 的类. Dataset类私有(private)继承自 std::vector (其中 Sample
当使用 gcc、g++ 或 make 在终端中编译一个小型 C 或 C++ 项目时,我收到以下错误: /tmp/ccG1caGi.o: In function `main': main.c:(.tex
我正在尝试从 CVS 为 Windows 上的 Emacs 23.1.50 编译 CEDET,但在“第 6 步:打开 EDE...”时出现错误:“defvar:作为变量的符号值是无效的:cedet-m
我正在(重新)学习编程,我从 C 开始。我的 IDE(如果我可以这么说)是 Windows7 上的 cygwin(32 位)和 Visual-Studio 2010。我总是编译我用 gcc (cygw
我喜欢在模板类中使用本地类来执行类似“static if”的构造。但是我遇到了 gcc 4.8 不想编译我的代码的问题。但是 4.7 可以。 这个例子: #include #include #in
我有一个项目,必须仅使用 java 1.4 进行编译。但我计划使用mockito 编写一些单元测试。我想要一种在 pom 中指定的方法,以便 src/main/java 使用 jdk 1.4 编译,但
我想了解 PHP 编译过程是如何工作的。 假设我有一个名为funcs.php 的文件并且这个文件有三个函数,如果我include 或require 它,所有的在文件加载期间编译三个函数?或者源代码会被
编译工具链 我们写程序的时候用的都是集成开发环境 (IDE: Integrated Development Environment),集成开发环境可以极大地方便我们程序员编写程序,但是配置起来
当我编写一些 Scala 代码时,在尝试编译代码时收到一条奇怪的错误消息。我将代码分解为一个更简单的代码(从语义的角度来看这完全没有意义,但仍然显示了错误)。 scala> :paste // Ent
我正在编译一个 SCSS 文件,它似乎删除了我的评论。我可以使用什么命令来保留所有评论? >SASS input.scss output.css 我在 SCSS 中看到两种类型的注释。 // Comm
这是我的代码: #include typedef struct { const char *description; float value; int age; } swag
当您编译 grails war 时,我知道 .groovy 代码被编译为字节码类文件,但我不明白容器(例如 tomcat)如何在请求 GSP 时知道如何编译它们。容器了解 GSP 吗?安装在服务器上的
我正在努力将多个文件编译成一个通用程序。我收到一个错误: undefined reference to 'pi' 这是我的代码和 Makefile 的框架。我做错了什么?谢谢! 文件:calcPi.c
我尝试使用 LD_PRELOAD 来 Hook sprintf function ,所以我将打印到缓冲区的结果: #define _GNU_SOURCE #include #include int
我正在寻找最简单的方法来自动将 CoffeeScript 重新编译为 JS。 阅读documentation但仍然很难得到我想要的东西。 我需要它来监视文件夹 src/ 中的任何 *.coffee 文
我想使用定制waveformjs 。我发现this on SO但是,我不知道如何编译/安装波形来开始。我从 GitHub 克隆它并进行了更改,但是我不知道如何将其转换为 .js 文件。 最佳答案 为了
很难说出这里问的是什么。这个问题是含糊的、模糊的、不完整的、过于宽泛的或修辞性的,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开它,visit the help center 。 已关
我是一名优秀的程序员,十分优秀!