【问题标题】:Compiling libjpeg on Windows using cygwin?使用 cygwin 在 Windows 上编译 libjpeg?
【发布时间】:2013-04-19 21:37:00
【问题描述】:

在 Windows 机器上编译 libjpeg 的最佳方法是什么?我应该使用 Microsoft Visual Studio 还是可以使用 Cygwin 之类的其他东西?

注意:当我使用 Cygwin 并将 makefile.vc 复制到 Makefile、jconfig.vc 到 jconfig.h 并运行此示例代码时:http://www.cim.mcgill.ca/~junaed/code/libjpeg_sample.tar.gz

那么编译器会产生以下错误:

$ gcc main.c
C:\cygwin\tmp\ccwChyeY.o:main.c:(.text+0x5a): undefined reference to `jpeg_std_error'
C:\cygwin\tmp\ccwChyeY.o:main.c:(.text+0x7e): undefined reference to `jpeg_CreateDecompress'
C:\cygwin\tmp\ccwChyeY.o:main.c:(.text+0x93): undefined reference to `jpeg_stdio_src'
C:\cygwin\tmp\ccwChyeY.o:main.c:(.text+0xa9): undefined reference to `jpeg_read_header'
C:\cygwin\tmp\ccwChyeY.o:main.c:(.text+0xb7): undefined reference to `jpeg_start_decompress'
C:\cygwin\tmp\ccwChyeY.o:main.c:(.text+0x11b): undefined reference to `jpeg_read_scanlines'
C:\cygwin\tmp\ccwChyeY.o:main.c:(.text+0x178): undefined reference to `jpeg_finish_decompress'
C:\cygwin\tmp\ccwChyeY.o:main.c:(.text+0x186): undefined reference to `jpeg_destroy_decompress'
C:\cygwin\tmp\ccwChyeY.o:main.c:(.text+0x1f6): undefined reference to `jpeg_std_error'
C:\cygwin\tmp\ccwChyeY.o:main.c:(.text+0x21a): undefined reference to `jpeg_CreateCompress'
C:\cygwin\tmp\ccwChyeY.o:main.c:(.text+0x22f): undefined reference to `jpeg_stdio_dest'
C:\cygwin\tmp\ccwChyeY.o:main.c:(.text+0x269): undefined reference to `jpeg_set_defaults'
C:\cygwin\tmp\ccwChyeY.o:main.c:(.text+0x27f): undefined reference to `jpeg_start_compress'
C:\cygwin\tmp\ccwChyeY.o:main.c:(.text+0x2c7): undefined reference to `jpeg_write_scanlines'
C:\cygwin\tmp\ccwChyeY.o:main.c:(.text+0x2e5): undefined reference to `jpeg_finish_compress'
C:\cygwin\tmp\ccwChyeY.o:main.c:(.text+0x2f3): undefined reference to `jpeg_destroy_compress'
collect2.exe: error: ld returned 1 exit status

【问题讨论】:

  • 生成文件是什么样的?它有 gnu 工具不喜欢的疯狂的 VC 东西吗?
  • Makefile 因供应商而异。将makefile.vc复制到Makefile通常可以吗??
  • 使用提供的 jconfig 和 makefile 文件之一配置软件 ------------------------------ - - - - - - - - - - - - - - - - - - - - - - - - 如果你有这些系统之一,您可以只使用提供的配置文件: Makefile jconfig 文件系统和/或编译器 makefile.vc jconfig.vc Windows NT/95,MS Visual C++ 将正确的 jconfig 文件复制到 jconfig.h 并将 makefile 复制到 Makefile (或您的系统用作标准生成文件名称的任何内容)。有关详细信息,请参阅此文件末尾附近的相应系统特定提示部分。

标签: c windows cygwin libjpeg


【解决方案1】:

好吧,如果你只想要 .dll 它已经编译好了。

https://cygwin.com/cgi-bin2/package-grep.cgi?grep=libjpeg&arch=x86_64

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-01-01
    • 2017-09-19
    • 1970-01-01
    • 2013-08-13
    • 1970-01-01
    • 2014-03-19
    • 2014-03-24
    • 2011-08-11
    相关资源
    最近更新 更多