c - fltk 提示 Windows 上的 gcc

标签 c gcc mingw msys fltk

我一直在尝试以多种不同的方式在 Windows 上构建 fltk,但我总是以:

configure: error: C compiler cannot create executable (msys fltk/configure)

Check for working C compiler: C:/MinGW/bin/gcc.exe -- broken (CMake-gui)

我用 fltk 1.3.01.3.3 试过了,我什至用了三个不同的 MinGW 发行版,GCC版本:5.1.04.9.23.4.5。然而它就是不会编译。这是 ./configure 文件生成的一些错误日志:

$ ./configure --prefix=C:/libs/fltk-1.3.3

-----------

Core tests.

-----------

configure:1336: checking build system type configure:1354: result: i686-pc-mingw32 configure:1362: checking host system type configure:1376: result: i686-pc-mingw32 configure:1439: checking for gcc configure:1455: found /c/mingw32/bin/gcc configure:1465: result: gcc configure:1709: checking for C compiler version configure:1712: gcc --version &5 gcc.exe (i686-win32-dwarf-rev2, Built by MinGW-W64 project) 4.9.2 Copyright (C) 2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:1715: $? = 0 configure:1717: gcc -v &5 Using built-in specs. COLLECT_GCC=c:\mingw32\bin\gcc.exe COLLECT_LTO_WRAPPER=c:/mingw32/bin/../libexec/gcc/i686-w64-mingw32/4.9.2/lto-wrapper.exe Target: i686-w64-mingw32 Configured with: ../../../src/gcc-4.9.2/configure --host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 --prefix=/mingw32 --with-sysroot=/c/mingw492/i686-492-win32-dwarf-rt_v4-rev2/mingw32 --with-gxx-include-dir=/mingw32/i686-w64-mingw32/include/c++ --enable-shared --enable-static --disable-multilib --enable-languages=ada,c,c++,fortran,objc,obj-c++,lto --enable-libstdcxx-time=yes --enable-threads=win32 --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-sjlj-exceptions --with-dwarf2 --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=i686 --with-tune=generic --with-libiconv --with-system-zlib --with-gmp=/c/mingw492/prerequisites/i686-w64-mingw32-static --with-mpfr=/c/mingw492/prerequisites/i686-w64-mingw32-static --with-mpc=/c/mingw492/prerequisites/i686-w64-mingw32-static --with-isl=/c/mingw492/prerequisites/i686-w64-mingw32-static --with-cloog=/c/mingw492/prerequisites/i686-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='i686-win32-dwarf-rev2, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/c/mingw492/i686-492-win32-dwarf-rt_v4-rev2/mingw32/opt/include -I/c/mingw492/prerequisites/i686-zlib-static/include -I/c/mingw492/prerequisites/i686-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/c/mingw492/i686-492-win32-dwarf-rt_v4-rev2/mingw32/opt/include -I/c/mingw492/prerequisites/i686-zlib-static/include -I/c/mingw492/prerequisites/i686-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/c/mingw492/i686-492-win32-dwarf-rt_v4-rev2/mingw32/opt/lib -L/c/mingw492/prerequisites/i686-zlib-static/lib -L/c/mingw492/prerequisites/i686-w64-mingw32-static/lib -Wl,--large-address-aware' Thread model: win32 gcc version 4.9.2 (i686-win32-dwarf-rev2, Built by MinGW-W64 project) configure:1720: $? = 0 configure:1722: gcc -V &5 gcc.exe: error: unrecognized command line option '-V' gcc.exe: fatal error: no input files compilation terminated. configure:1725: $? = 1 configure:1748: checking for C compiler default output configure:1751: gcc
conftest.c >&5 c:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/lib/../lib/libmingw32.a(lib32_libmingw32_a-crt0_c.o):crt0_c.c:(.text.startup+0x39): undefined reference to `WinMain@16' collect2.exe: error: ld returned 1 exit status configure:1754: $? = 1 configure: failed program was: |

line 1728 "configure" | /* confdefs.h. */ | | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define

PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | /* end confdefs.h. */ | | int main () | { | | ; | return 0; | } configure:1793: error: C compiler cannot create executables See `config.log' for more details.

configure: exit 77

我之前使用这些相同的工具(nana 和 SFML)编译了另外 2 个 gui 库,所以 gcc 编译器不会有任何问题。

编辑

某些东西(很可能是 cygwin)一直在破坏我的 mingw gcc 程序,每次它“损坏”时我都会得到黑色的 vcc1.exe 窗口.然后我必须替换 mingw 文件夹以使其再次工作,这主要发生在我打开 netbeans 时。我只是不知道如何解决这个问题,所以我一直在避免使用 cygwinnetbeans

最佳答案

  • 昨天我终于能够使用这个版本的 TDM-GCC 构建它(根据 gui 安装程序):
    • MinGW-w64/TDM64(32 位和 64 位)==> TDM-GCC
  • 我使用 cmake gui 而不是 .configure
    1。打开 cmake 图形用户界面。
    2.输入源代码文件夹(fltk 文件夹的根目录,即:“C:/libs/fltk-1.3.3”)。
    3. 输入构建文件夹,即:“C:/libs/fltk-1.3.3/build/”。
    4. 点击配置
    5. ** 你可以选择更改一些选项,但我没有
    6. 点击 Genertae
    7. 在 cmd 中(虽然我使用了 git bash) : cd 到构建目录并运行 make 或 mingw32-make

  • 我完全卸载了 cygwin,因为它会干扰工具链构建,即 mingw 和 tdm-gcc(仍然不确定为什么会发生这种情况)。

关于c - fltk 提示 Windows 上的 gcc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30154115/

相关文章:

c - 如何在 C 中打开 .txt 文件并连续将方程应用于每一行

java - 线程库的无锁实现

c - 如何设置我的代码/VS10 以识别 .c 文件中的 CUDA 函数调用?

c - for(int i = 0... 的形式是 gnu 扩展吗?

c - 如何提供 memcpy 的实现

c++ - 无法将 'LPCWSTR {aka const wchar_t*}' 转换为 'LPCSTR {aka const char*}

python - 使 Cython 在 Anacondas、Windows 7 64 位上与 Python 3.4 一起工作

c++ - 尝试使用 cmake 交叉编译 qt 应用程序时出现链接问题

c - 向调用 exec() 的 fork 进程发送信号

c++ - GCC avx2intrin.h(版本 X-9.2)中缺少 _mm_broadcastsd_pd