简体   繁体   中英

Compiling libjpeg on Windows using cygwin?

Which is the best way to compile libjpeg on a Windows machine? Should I use Microsoft Visual Studio or can I use something else like Cygwin?

Note: when I use Cygwin and copy makefile.vc to Makefile , jconfig.vc to jconfig.h and run this sample code: http://www.cim.mcgill.ca/~junaed/code/libjpeg_sample.tar.gz

then the compiler produces the following errors:

$ 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

好吧,如果您只想要.dll ,则它已被编译。

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM