Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Winapi 未能安装System.Win32.Com_Winapi_Haskell_Gcc_Com_Cabal - Fatal编程技术网

Winapi 未能安装System.Win32.Com

Winapi 未能安装System.Win32.Com,winapi,haskell,gcc,com,cabal,Winapi,Haskell,Gcc,Com,Cabal,我运行虚拟化的Windows7x64。安装包失败。如何处理这个问题 > cabal install com Resolving dependencies... Configuring com-1.2.3.1... cabal: Bad header file: include/comPrim.h The header file contains a compile error. You can re-run configure with the verbosity flag -v3 to

我运行虚拟化的Windows7x64。安装包失败。如何处理这个问题

> cabal install com
Resolving dependencies...
Configuring com-1.2.3.1...
cabal: Bad header file: include/comPrim.h
The header file contains a compile error. You can re-run configure with the
verbosity flag -v3 to see the error messages from the C compiler.
Failed to install com-1.2.3.1
cabal: Error: some packages failed to install:
com-1.2.3.1 failed during the configure step. The exception was:
ExitFailure 1
使用
-v3
选项运行会出现如下错误:

In file included from C:\Users\Leo\AppData\Local\Temp\282536868.c:3:0:
./include/comPrim.h:123:1: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'OleInitialize'
OleInitialize ( void* pvReserved );
^
./include/comPrim.h:128:1: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'OleUninitialize'
OleUninitialize ();
^
...
此外,
-v3
选项表示无法找到某些包。这可能是原因吗?我只列出了其中的几个

Searching for ghcjs-pkg in path.
Cannot find ghcjs-pkg on the path
Searching for greencard in path.
Cannot find greencard on the path
cabal
甚至不知道其中的一些(例如
hmake

编译器更新 GCC版本输出:

> gcc -v
Using built-in specs.
COLLECT_GCC=C:\Program Files\Haskell Platform\7.10.3\mingw\bin/realgcc.exe
COLLECT_LTO_WRAPPER=C:/Program\ Files/Haskell\ Platform/7.10.3/mingw/bin/../lib/gcc/x86_64-w64-mingw32/5.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-5.2.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --with-gxx-include-dir=/mingw64/include/c++/5.2.0 --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev3, Built by MSYS2 project' --with-bugurl=http://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld
Thread model: posix
gcc version 5.2.0 (Rev3, Built by MSYS2 project)

您正在使用不兼容的C编译器进行构建,例如
x86\u 64-w64-mingw32
工具链 安装了。 它会产生你所看到的错误。与一起安装的
mingw32
不会产生它们

使用32位GCC构建包意味着您可以在64位或32位Windows和 它将在64位或32位Windows上执行,但不能将32位与64位程序包库链接在一起

但是,这可能是学术性的,因为使用32位 编译器只会让您知道稍后的ghc编译错误:

[ 2 of 21] Compiling System.Win32.Com.HDirect.Pointer ( System\Win32\Com\HDirect\Pointer.hs, dist\build\System\Win32\Com\HDirect\Pointer.o )
*** Parser:
*** Renamer/typechecker:

System\Win32\Com\HDirect\Pointer.hs:102:20: Not in scope: `catch'
这是在对不推荐的命令行选项发出各种警告后发生的,例如

on the commandline: Warning:
    -fglasgow-exts is deprecated: Use individual extensions instead

on the commandline: Warning:
    The -fvia-C flag does nothing; it will be removed in a future GHC release
和预处理器指令,例如

System\Win32\Com.hs:1:12: Warning:
    -#include and INCLUDE pragmas are deprecated: They no longer have any effect

此程序包似乎维护不当。

您正在使用不兼容的C编译器进行构建,例如
x86\u 64-w64-mingw32
工具链 安装了。 它会产生你所看到的错误。与一起安装的
mingw32
不会产生它们

使用32位GCC构建包意味着您可以在64位或32位Windows和 它将在64位或32位Windows上执行,但不能将32位与64位程序包库链接在一起

但是,这可能是学术性的,因为使用32位 编译器只会让您知道稍后的ghc编译错误:

[ 2 of 21] Compiling System.Win32.Com.HDirect.Pointer ( System\Win32\Com\HDirect\Pointer.hs, dist\build\System\Win32\Com\HDirect\Pointer.o )
*** Parser:
*** Renamer/typechecker:

System\Win32\Com\HDirect\Pointer.hs:102:20: Not in scope: `catch'
这是在对不推荐的命令行选项发出各种警告后发生的,例如

on the commandline: Warning:
    -fglasgow-exts is deprecated: Use individual extensions instead

on the commandline: Warning:
    The -fvia-C flag does nothing; it will be removed in a future GHC release
和预处理器指令,例如

System\Win32\Com.hs:1:12: Warning:
    -#include and INCLUDE pragmas are deprecated: They no longer have any effect

这个软件包似乎没有得到很好的维护。

似乎
comPrim.h
中有语法错误-如果你知道C/C++你可以尝试下载源代码并自己修复-如果不知道,你可能应该让作者知道我可以回答的问题的后半部分-阴谋集团检查人们可能希望使用的很多东西,即使他们没有被要求-v3非常冗长,这说明了这一点。所以你可以忽略这一点,据我所知,在诊断近似错误方面:-)在上半部分,你需要确保你使用的是正确的c编译器——理想情况下是与ghc附带的mingw安装相关的编译器。你可以选择把它交给阴谋集团,或者只是确保你的路径配置正确…似乎
comPrim.h
中有语法错误-如果你知道C/C++你可以尝试下载源代码并自己修复-如果不知道,你可能应该让作者知道我可以回答的问题的后半部分-阴谋集团检查人们可能希望使用的很多东西,即使他们没有被要求-v3非常冗长,这说明了这一点。所以你可以忽略这一点,据我所知,在诊断近似错误方面:-)在上半部分,你需要确保你使用的是正确的c编译器——理想情况下是与ghc附带的mingw安装相关的编译器。您可以将其作为选项传递到cabal,或者只是确保您的路径配置正确……这是否意味着该库只能为32位平台构建?我在问题中添加了
gcc-v
输出。我没有预装另一个GCC版本。唯一一个是Haskell带来的Platform@Leonidas参见修改后的答案。这是否意味着该库只能为32位平台构建?我在问题中添加了
gcc-v
output。我没有预装另一个GCC版本。唯一一个是Haskell带来的Platform@Leonidas见修改后的答案。