linux - 使用 makefile.in 将 linux 源代码编译为 windows 7

标签 linux windows compiler-construction mingw cross-compiling

我有一个基于 linux 的程序的源代码,但试图在 Win7 环境中运行。我找到了名为“mingw32”和 msys 的软件,它们可以使用 makefile.in(包含在源代码中)将 linux 源代码编译为 win7。但是我收到错误消息“'makefile.in' 无事可做”

来源可在此处获得:http://sourceforge.net/projects/libots/files/libots/ots-0.5.0/ots-0.5.0.tar.gz/download

Makefile.in 在下面

# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am

# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

[...]
POPT_LIBS = @POPT_LIBS@
POPT_REQUIRED = @POPT_REQUIRED@
RANLIB = @RANLIB@
RC = @RC@
STRIP = @STRIP@
VERSION = @VERSION@
VERSION_INFO = @VERSION_INFO@

[...]    
lib_LTLIBRARIES = libots-1.la

[...]
libots-1.la: $(libots_1_la_OBJECTS) $(libots_1_la_DEPENDENCIES)
    $(LINK) -rpath $(libdir) $(libots_1_la_LDFLAGS) $(libots_1_la_OBJECTS) $(libots_1_la_LIBADD) $(LIBS)

[...]    
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

最佳答案

你需要msys来运行./configure

  • 调用msys.bat
  • cd 到你的例子c:\msys\1.0\src\ots-0.5.0 文件夹
  • 运行./configure

您还需要 popt-1.5 。因此,如果您没有它,则必须先下载并构建它。

使用 mingw 构建起来并不容易。

我建议首先下载适用于 Windows 的二进制版本。如果它在您的系统上运行没有问题,您可以尝试自己构建它。 Ots-0.4.2-Win32-binary.zip

我怀疑这个二进制版本是否可以正常工作。

有空的话(3天不够)
你可以下载popt-1.8-1-src.zip .

但是你一定也看到了这一行:configure:20043: checking for glib-2.0 >= 2.0 libxml-2.0 >= 2.4.23
等等。

关于linux - 使用 makefile.in 将 linux 源代码编译为 windows 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18233275/

相关文章:

gcc - Windows中嵌入式平台的交叉编译器

Eclipse 编译正确,但在 'Problems' View 中显示错误

python - ImportError : No module named geoip2. 数据库

linux - 无法找到 JAVA_HOME

c++ - Windows 可执行文件的映射文件是否可写?

linux - 适用于 Windows 的 C++ linux 接口(interface)?

linux - 监控僵尸进程

linux - 解析 "control"文件的脚本出现问题

Windows 资源管理器 - 删除上下文菜单中的条目

algorithm - 为什么我们必须对解析树使用深度优先遍历?