Compiler error in mingw-w64: 'undefined reference to `__getreent.'
Asked Answered
A

1

5

I'm currently in the (nightmare) task of trying to compile cImg and libjpeg in Windows. After many hours, I was finally able to build libjpeg and I've included it within the build process (cImg needs libjpeg to work with jpegs).

When I try to compile with 'g++ image.cpp libjpeg.a -lgdi32' I get the following error:

'jerror.c:112: undefined reference to `__getreent. The system cannot find the path specified.'

I've had a look on google but there doesn't seem to be many people with the same issue (and fewer still with answers).

I'm compiling in windows using mingw-w64.

Actually answered 4/1, 2018 at 19:18 Comment(0)
A
7

I've solved this. For anyone who has the same problem:

  • Make sure that you are compiling libjpeg.a and cImg with the same compiler (i.e. gcc or mingw-w64)

  • Due to difficulties compiling libjpeg with mingw-w64 i used the gcc compiler but if you are using this library you need to compile cImg with gcc as well (which causes other issues...)

  • I eventually managed to compile libjpeg with mingw-w64 in MSYS2 by changing the Path. To do this you need to inherit the Windows Path - edit 'msys2_shell.cmd' and remove 'rem' from 'set MSYS2_PATH_TYPE=inherit'

Actually answered 5/1, 2018 at 22:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.