C 预处理器(MinGW 的 cpp.exe)不产生任何输出
The C preprocessor (MinGW's cpp.exe) produces no output
我正在尝试 运行 C:\MinGW\bin\cpp.exe -v -o main.txt test.c
test.c:
#ifdef HELLO
HELLO!
#else
BYE!
#endif
但只得到以下输出,没有明显的错误,也没有写入 main.txt
(也没有任何其他文件):
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\cpp.exe
Target: mingw32
Configured with: ../src/gcc-8.2.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --target=mingw32 --prefix=/mingw --disable-win32-registry --with-arch=i586 --with-tune=generic --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-pkgversion='MinGW.org GCC-8.2.0-5' --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --with-isl=/mingw --enable-libgomp --disable-libvtv --enable-nls --disable-build-format-warnings
Thread model: win32
gcc version 8.2.0 (MinGW.org GCC-8.2.0-5)
COLLECT_GCC_OPTIONS='-E' '-v' '-o' 'main.txt' '-mtune=generic' '-march=i586'
c:/mingw/bin/../libexec/gcc/mingw32/8.2.0/cc1.exe -E -quiet -v -iprefix c:\mingw\bin\../lib/gcc/mingw32/8.2.0/ test.c -o main.txt -mtune=generic -march=i586
我找到了 Denis Auroux / Tristan Miller 的 GPP and a windows build which works as expected (gpp.exe -o main.txt test.c
- actually, you'll want the -C
option, see the docs),但我仍然对我使用 cpp 的问题很感兴趣。
我在文件管理器的命令提示符 "spawned" 中 运行 这个。
运行 cmd.exe
直接显示如下错误信息对话框:
---------------------------
cc1.exe - System Error
---------------------------
The code execution cannot proceed because libgmp-10.dll was not found. Reinstalling the program may fix this problem.
---------------------------
OK
---------------------------
Process Monitor 显示最终的 Exit Status: 1
,但在过滤进程名称 cpp.exe
时我没有看到上面的 DLL,尽管 [=] 有一些 BUFFER OVERFLOW
结果15=] 还有。
有问题的 DLL 存在于我的 C:\MinGW\bin
中,因此将此路径添加到 环境变量 不仅解决了问题“libgmp-10.dll is missing”,但也使 cpp.exe
已知,因此在 运行 时不需要路径。
我正在尝试 运行 C:\MinGW\bin\cpp.exe -v -o main.txt test.c
test.c:
#ifdef HELLO
HELLO!
#else
BYE!
#endif
但只得到以下输出,没有明显的错误,也没有写入 main.txt
(也没有任何其他文件):
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\cpp.exe
Target: mingw32
Configured with: ../src/gcc-8.2.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --target=mingw32 --prefix=/mingw --disable-win32-registry --with-arch=i586 --with-tune=generic --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-pkgversion='MinGW.org GCC-8.2.0-5' --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --with-isl=/mingw --enable-libgomp --disable-libvtv --enable-nls --disable-build-format-warnings
Thread model: win32
gcc version 8.2.0 (MinGW.org GCC-8.2.0-5)
COLLECT_GCC_OPTIONS='-E' '-v' '-o' 'main.txt' '-mtune=generic' '-march=i586'
c:/mingw/bin/../libexec/gcc/mingw32/8.2.0/cc1.exe -E -quiet -v -iprefix c:\mingw\bin\../lib/gcc/mingw32/8.2.0/ test.c -o main.txt -mtune=generic -march=i586
我找到了 Denis Auroux / Tristan Miller 的 GPP and a windows build which works as expected (
gpp.exe -o main.txt test.c
- actually, you'll want the -C
option, see the docs),但我仍然对我使用 cpp 的问题很感兴趣。
我在文件管理器的命令提示符 "spawned" 中 运行 这个。
运行 cmd.exe
直接显示如下错误信息对话框:
---------------------------
cc1.exe - System Error
---------------------------
The code execution cannot proceed because libgmp-10.dll was not found. Reinstalling the program may fix this problem.
---------------------------
OK
---------------------------
Process Monitor 显示最终的 Exit Status: 1
,但在过滤进程名称 cpp.exe
时我没有看到上面的 DLL,尽管 [=] 有一些 BUFFER OVERFLOW
结果15=] 还有。
有问题的 DLL 存在于我的 C:\MinGW\bin
中,因此将此路径添加到 环境变量 不仅解决了问题“libgmp-10.dll is missing”,但也使 cpp.exe
已知,因此在 运行 时不需要路径。