Error compiling with Cygwin

Hi support,

I have been trying to compile the libraw 2021-10 master using cygwin on windows 10.

I perform autoreconf --install, no errors are produced.
then I perform ./configure which completes without issues.
Finally i run make and I keep getting the following error:

libtool: compile: g++ -DPACKAGE_NAME=\"LibRaw\" -DPACKAGE_TARNAME=\"libraw\" -DPACKAGE_VERSION=\"0.21.0-Snapshot202110\" "-DPACKAGE_STRING=\"LibRaw 0.21.0-Snapshot202110\"" -DPACKAGE_BUGREPORT=\"info@libraw.org\" -DPACKAGE_URL=\"http://www.libraw.org\" -DSTDC_HEADERS=1 -DHAV
E_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_JPEGLIB_H=1 -DHAVE_JASPER_JASPER_H=1 -I. -DUSE_JPEG -DUSE_JPEG8
-DUSE_JASPER -DUSE_ZLIB -DUSE_LCMS2 -g -O2 -fopenmp -MT src/decoders/fp_dng.lo -MD -MP -MF src/decoders/.deps/fp_dng.Tpo -c src/decoders/fp_dng.cpp -DDLL_EXPORT -DPIC -o src/decoders/.libs/fp_dng.o
src/decoders/fp_dng.cpp: In member function ‘void LibRaw::uncompressed_fp_dng_load_raw()’:
src/decoders/fp_dng.cpp:640:21: error: ‘swab’ was not declared in this scope
640 | swab((char *)dst, (char *)dst, fullrowbytes);
| ^~~~
make: *** [src/decoders/fp_dng.lo] Error 1

The weird thing is that swab is availlable because ./configure shows:

checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes

Anything you can suggest to solve this?

I am using autoconf 2.69, with a newer version autoreconf -install complains about obsolote macros.

Thank you in advance,
Mabula

Forums: 

Hi support,

Hi support,
More details, I am using the GNU compiler Collection c++ gcc-g++ version 11.2.0-1.
Whatever i try, the swab function causes the problem: not declared in this scope.
Thanks,
Mabula

Mabula Haverkamp
Owner of Aries Productions
Main developer of Astro Pixel Processer - Deep Sky Image Processing Software

According to quick googling,

According to quick googling, swab function is present in cygwin C runtime.

Sorry, do not have cygwin installed, so no additional help (e.g. what include file should be added)

-- Alex Tutubalin @LibRaw LLC

I think this comes from here:

I think this comes from here: https://github.com/LibRaw/LibRaw/blob/b31fa58eea272c4ba67ccdbd527f329a5a...

_WIN32 is defined even on Cygwin, but I guess one shouldn't set LIBRAW_WIN32_CALLS on Cygwin; as a consequence, unistd.h is not included from internal/defines.h: https://github.com/LibRaw/LibRaw/blob/master/internal/defines.h#L50-L65

Any reason you're building for Cygwin, and not native MinGW instead?

Hi kmilos,

Hi kmilos,

Using MingW was what I did before, but was wondering if I could get things to work using Cygwin.

With MingW on Windows I am having serious character encoding issues since the new Libraw versions related to :

https://www.libraw.org/node/2692

and thus

https://github.com/LibRaw/LibRaw/commit/30595a731f3bea78f0410426b73ef3af...

I was able now to turn on unicode in MingW using: https://sourceforge.net/p/mingw-w64/wiki2/Unicode%20apps/

Needed to alter libraw.h and now I can use wchar_t but still not working with asian characters...

So still trying. Do you have any suggestions how to make it work with MingW and wchar_t file path?

Mabula Haverkamp
Owner of Aries Productions
Main developer of Astro Pixel Processer - Deep Sky Image Processing Software

Okay, yes, thanks... for now,

Okay, yes, thanks... for now, I will not try more on Cygwin... building is completely broken it seems in that environment with the GNU compiler. (With the MingGW compiler on Cywgwin and the mingw makefile it does work but does not solve my character encoding issues.)

Mabula Haverkamp
Owner of Aries Productions
Main developer of Astro Pixel Processer - Deep Sky Image Processing Software

Hi Alex,

Hi Alex,

Thank you, I was able to fix the swab issue, but much more compile errors after that... so it seams it is rather nasty to compile with Cygwin. I tried different compilers and versions but have not been very succesfull...

Mabula

Mabula Haverkamp
Owner of Aries Productions
Main developer of Astro Pixel Processer - Deep Sky Image Processing Software

Hi support,

Hi support,

Just wanted you to know that this topic is solved as far as I am concerned. Cygwin building did not work though whatever I tried.

I tried Cygwin because my MingW solution broke correct character encoding with your change of file loading on the windows platform in

LibRaw 0.20.1 changes

Windows support/Windows unicode (wchar_t*) filenames support

I have everything working now with full unicode support using the Microsoft Visual Studio compiler.

Thank you very much for your great work on Libraw ;-)

Mabula

Mabula Haverkamp
Owner of Aries Productions
Main developer of Astro Pixel Processer - Deep Sky Image Processing Software