Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined reference to `g_str_to_ascii' #1117

Closed
daveharris opened this issue Oct 1, 2018 · 5 comments
Closed

undefined reference to `g_str_to_ascii' #1117

daveharris opened this issue Oct 1, 2018 · 5 comments

Comments

@daveharris
Copy link

Hi,

I am trying install v8.7.0 on an Amazon Linux instance. v8.6.5 installs perfectly, but I get the below error for v8.7.0. Not too sure what the error is, but seems to be something code-related, not environmental?

I am using this bash script for installation, but just doing all the normal stuff.

I have attached the whole log if you need more information.

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../.. -I../../libvips/include -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -pthread -fopenmp -I/usr/lib64/glib-2.0/include -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/include/ImageMagick -g -O2 -MT exif.lo -MD -MP -MF .deps/exif.Tpo -c exif.c  -fPIC -DPIC -o .libs/exif.o
exif.c: In function ‘vips_exif_set_string_encoding’:
exif.c:842:10: warning: implicit declaration of function ‘g_str_to_ascii’; did you mean ‘__toascii’? [-Wimplicit-function-declaration]
  ascii = g_str_to_ascii( str, NULL );
          ^~~~~~~~~~~~~~
          __toascii
exif.c:842:8: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  ascii = g_str_to_ascii( str, NULL );
        ^
exif.c: In function ‘vips_exif_set_string_ascii’:
exif.c:868:8: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
  ascii = g_str_to_ascii( str, NULL );
        ^
depbase=`echo gifload.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\

It keeps going at this point. However it fails near the end somewhere:

libtool: link: gcc -g -O2 -o .libs/vips vips.o -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -pthread -fopenmp -I/usr/lib64/glib-2.0/include -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/include/ImageMagick -Wl,--export-dynamic -pthread  ../libvips/.libs/libvips.so -lz -lMagickCore -lpng12 -ltiff -ljpeg -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 /usr/lib64/libexpat.so -llcms2 -lwebp -lexif -lm -fopenmp -pthread -Wl,-rpath -Wl,/usr/lib64
../libvips/.libs/libvips.so: undefined reference to `g_str_to_ascii'
collect2: error: ld returned 1 exit status
make[2]: *** [vips] Error 1
make[2]: Leaving directory `/home/ec2-user/vips-8.7.0/tools'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/ec2-user/vips-8.7.0'
make: *** [all] Error 2
Making install in libvips

Thanks for the awesome project. My image resize times has dropped from 10 seconds to 1 second!!!!

Dave

@lovell
Copy link
Member

lovell commented Oct 1, 2018

Hello, the g_str_to_ascii function was added to glib in v2.40 about 5 years ago so I suspect the version provided by Amazon Linux is older than this.

libvips is using it to workaround libexif's inability to deal with non-ASCII encoding - see kleisauke/net-vips#10

I guess we can either make glib v2.40 the minimum required by libvips v8.7.0+ or we can detect the glib version at configure time and conditionally ignore non-ASCII EXIF values.

@lovell lovell added the question label Oct 1, 2018
@jcupitt
Copy link
Member

jcupitt commented Oct 1, 2018

Yes, you're right @lovell, I must have forgotten to check when g_str_to_ascii() was added, sorry.

The current min glib version is 2.6, so bumping it to 2.40 would be a large change. Your suggestion of adding a test to configure and HAVE_G_STR_TO_ASCII sounds better.

@jcupitt
Copy link
Member

jcupitt commented Oct 1, 2018

I had a quick go at a PR for this.

@daveharris
Copy link
Author

daveharris commented Oct 1, 2018 via email

@jcupitt
Copy link
Member

jcupitt commented Oct 1, 2018

Oh, nice. I'm glad it's useful!

Merged, and it'll be in 8.7.1.

@jcupitt jcupitt closed this as completed Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants