【发布时间】:2015-01-12 10:02:37
【问题描述】:
我是 libtasn1 的新用户(尝试将此库与 google 的 protobuf 进行基准测试)....实际上是在尝试成为新用户....
我无法让这个库在 Windows 下编译(使用 Visual Studio 2010)。
从这里下载最新版本(4.2):http://ftp.gnu.org/gnu/libtasn1/
然后,我从 Visual Studio 2010 命令提示符运行 configure(必须先安装 Cygwin 才能拥有 sh.exe、ar.exe....)。这显然有效并输出:
version: 4.2 shared 9:2:3
Host type: i686-pc-cygwin
Install prefix: /usr/local
Compiler: gcc -std=gnu99
Warning flags: errors: warnings:
Library types: Shared=yes, Static=yes
Valgrind:
Version script: yes
现在,我无法继续构建。这是我尝试过的:
打开 zip 中提供的 libtasn1.sln。第一个错误报告 config.h 未找到(+ 其他头文件)。更新包含路径后,我在编译 ASN1.c 时在一些头文件语句中出现了更多重大错误,例如 inline static 上的 C2054(这是 C 和 inline static 在 C 中无效......)。
我放弃了这里并尝试通过键入“nmake”直接从 Visual 命令提示符进行编译。很短,马上就出错了:
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. Tous droits réservés.
makefile(269) : fatal error U1001: erreur de syntaxe : caractère non conforme '{' dans la macro
Stop.
最后,我尝试使用 MinGW 进行编译(使用 mingw32-make.exe)。同样的事情,马上就出错了:
process_begin: CreateProcess(NULL, /usr/bin/sed -n s/^\(sc_[a-zA-Z0-9_-]*\):.*/\
1/p ./maint.mk ./cfg.mk, ...) failed.
'test' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
make all-recursive
process_begin: CreateProcess(NULL, make all-recursive, ...) failed.
make (e=2): Le fichier spécifié est introuvable.
Makefile:928: recipe for target 'all' failed
mingw32-make.exe: *** [all] Error 2
libtasn1 网站说:
该代码应适用于所有 Unix 操作系统和 Windows。
好的,但是如何构建它?我在网站上找不到任何信息,在 INSTALL 文件中也找不到...
【问题讨论】:
标签: c++ c visual-studio-2010 compilation asn.1