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

Symbol not found: _iconv #28

Closed
aberenyi opened this issue Dec 5, 2019 · 43 comments
Closed

Symbol not found: _iconv #28

aberenyi opened this issue Dec 5, 2019 · 43 comments
Assignees
Labels

Comments

@aberenyi
Copy link

aberenyi commented Dec 5, 2019

Hi there,

This is a gentle reminder that some of us are still waiting for a fix re qgis/QGIS#31576

Cheers

@PeterPetrik PeterPetrik added bug Something isn't working LTR NIGHTLY PR labels Dec 5, 2019
@Spartacus1
Copy link

Hi Peter. The bug is still present in version 3.10.1. This makes this version completely unusable under MacOS for Raster analysis (a simple hillshade will not succeed).
This bug should be a "very high priority" for MacOS QGIS version.

@PeterPetrik
Copy link
Contributor

PeterPetrik commented Dec 12, 2019

homebrew's iconv is build with different prefix that system one. Problem is that we are bundling homebrew iconv but some libraries are build with system one. We need to use one or other consistently (probably system one).

peter@pp-mb:~/Projects/bundle/QGIS-Mac-Packager$ nm -gU /usr/lib/libiconv.dylib 
00000000000f2710 D __libiconv_version
0000000000002408 T _iconv
0000000000002727 T _iconv_canonicalize
000000000000242a T _iconv_close
0000000000001129 T _iconv_open
0000000000002437 T _iconvctl
0000000000002530 T _iconvlist
0000000000013f8c T _libiconv_set_relocation_prefix
peter@pp-mb:~/Projects/bundle/QGIS-Mac-Packager$ nm -gU /usr/local/Cellar/libiconv/1.16/lib/libiconv.dylib 
00000000000f67c0 D __libiconv_version
00000000000039c8 T _iconv_canonicalize
00000000000031ea T _libiconv
000000000000320c T _libiconv_close
0000000000001d60 T _libiconv_open
0000000000003219 T _libiconv_open_into
0000000000016ab3 T _libiconv_set_relocation_prefix
00000000000036cb T _libiconvctl
00000000000037cc T _libiconvlist

@PeterPetrik PeterPetrik self-assigned this Dec 12, 2019
@Spartacus1
Copy link

Spartacus1 commented Dec 12, 2019 via email

@aberenyi
Copy link
Author

Hi @PeterPetrik,

I can confirm that High Sierra is also affected by this.

Cheers

@PeterPetrik
Copy link
Contributor

can you make a try?

rename
/Applications/QGIS3.8.app/Contents/MacOS/lib/libiconv.2.dylib to /Applications/QGIS3.8.app/Contents/MacOS/lib/libiconv.2.dylib_old and

and copy

/usr/lib/libiconv.2.dylib to /Applications/QGIS3.8.app/Contents/MacOS/lib/libiconv.2.dylib.

run QGIS and see if it solves the problem?

@Spartacus1
Copy link

Spartacus1 commented Dec 12, 2019 via email

@PeterPetrik
Copy link
Contributor

it is not proper solution, but I can try to use system iconv if it works for building all of the stuff

@Spartacus1
Copy link

Spartacus1 commented Dec 12, 2019 via email

@aberenyi
Copy link
Author

The workaround didn't work for me (QGIS 3.10.0, macOS 10.13.6).

Will try to update QGIS to the latest version - see if that helps.

@Spartacus1
Copy link

In my case worked. So far so good. Check if you download the latest version available. The name of the image is the same as the previous one "qgis-macos-pr.dmg" but it was compiled in December 6.

@aberenyi
Copy link
Author

aberenyi commented Dec 17, 2019

Same result with 3.10.1, however, according to dyld my libiconv.2.dylib is way too old (on macOS 10.13.6).

$ ./QGIS
dyld: Library not loaded: @executable_path/lib/libiconv.2.dylib
  Referenced from: /Applications/QGIS3.10.app/Contents/MacOS/./lib/libgdal.20.dylib
  Reason: Incompatible library version: libgdal.20.dylib requires version 9.0.0 or later, but libiconv.2.dylib provides version 7.0.0

@aberenyi
Copy link
Author

I can confirm that the workaround resolves the issue on macOS 10.15.1 (QGIS 3.10.1).

@PeterPetrik
Copy link
Contributor

i think the problem is that https://github.com/OSGeo/homebrew-osgeo4mac/blob/master/Formula/osgeo-gdal-python.rb uses system's iconv instead of brew's iconv

@PeterPetrik
Copy link
Contributor

unfortunately we need to wait for next GDAL release planned 17th January. homebrew dependencies are already updated to not-production ready GDAL version, so I cannot run update on build machine. and without the update it is hard to fix the dependencies ...

@aberenyi
Copy link
Author

aberenyi commented Jan 3, 2020

@PeterPetrik thanks for the heads up, keep up the good work.

@andrensc
Copy link

Thank you everybody for the amazing work trying to figure this one out.

I'm not sure if I'm running into the same problem you guys were experiencing but I tried @PeterPetrik solution.
Unfortunately this workaround does not solve it for me: after copying libiconv.2.dylib from /usr/lib/ onto QGIS3.4.app/Contents/MacOS/lib/ QGIS crashes immediately after I open a project. When I return the original libiconv.2.dylib QGIS works again but I can't still perform GDAL ops like "Clip Raster by Mask Layer" and returns the same mistake as before:

dyld: Symbol not found: _iconv

Referenced from: /usr/lib/libarchive.2.dylib

Expected in: /Applications/QGIS3.4.app/Contents/MacOS/lib/libiconv.2.dylib

in /usr/lib/libarchive.2.dylib

I'm going to try installing a previous build of QGIS to see what happens. I'll let you know.

@Spartacus1
Copy link

Hi andrensc

The problem you describe will occur in projects where you were able to generate raster images with the same extension but without this problem, for instance using previous WK compilations. If you start a new project, you will be able to generate layers successfully and the project will open after. It's a very awkward problem.

@andrensc
Copy link

Thanks @Spartacus1 , awkward indeed!!

Actually I didn't mention it before but after I copied the system libiconv.2.dylib to the QGIS3.4 library and noticed that QGIS crashed when opening a project, I tried starting a new project: QGIS crashed as soon as I expanded an item on the browser panel. When putting the original libiconv files back, I could handle the browser panel without an issue. However, I could not run GDAL ops.

@Spartacus1
Copy link

Spartacus1 commented Feb 26, 2020

This problem is still present in version 3.12. The workaround is not the best solution but still works:

rename
/Applications/QGIS3.8.app/Contents/MacOS/lib/libiconv.2.dylib to /Applications/QGIS3.8.app/Contents/MacOS/lib/libiconv.2.dylib_old and

and copy

/usr/lib/libiconv.2.dylib
to
/Applications/QGIS3.8.app/Contents/MacOS/lib/libiconv.2.dylib.

Best regards

@PeterPetrik
Copy link
Contributor

@gioman
Copy link

gioman commented Feb 27, 2020

This problem is still present in version 3.12.

@aberenyi @PeterPetrik I'm not an advanced mac user, but now I have a mac with Catalina that I can use for tests. On a clean install of the OS I downloaded the 3.12 installer, installed and everything seems to work (well, expected GRASS in processing but I think is expected). So it this not about the installer in the qgis.org download page?

1 similar comment
@gioman
Copy link

gioman commented Feb 27, 2020

This problem is still present in version 3.12.

@aberenyi @PeterPetrik I'm not an advanced mac user, but now I have a mac with Catalina that I can use for tests. On a clean install of the OS I downloaded the 3.12 installer, installed and everything seems to work (well, expected GRASS in processing but I think is expected). So it this not about the installer in the qgis.org download page?

@aberenyi
Copy link
Author

@PeterPetrik thanks for the heads up.

Regarding the solutions outlined in your mail - it'd be absolutely brilliant to integrate the QGIS package more closely w/ homebrew as it will also resolve the never ending saga of different python environments.

@aberenyi
Copy link
Author

@gioman interesting... I've just installed QGIS 3.12 and can also confirm that the issue still exists.

@gioman
Copy link

gioman commented Feb 27, 2020

and can also confirm that the issue still exists.

@aberenyi weird, here is all ok (unless I'm missing where should I see any trouble).

@aberenyi
Copy link
Author

@gioman it's quite easy to test. Try to generate contour lines with GDAL using any raster source.

Also, have you installed homebrew before QGIS?

@gioman
Copy link

gioman commented Feb 27, 2020

@gioman it's quite easy to test. Try to generate contour lines with GDAL using any raster source.

@aberenyi it works

Also, have you installed homebrew before QGIS?

no. Clean Catalina install.

@aberenyi
Copy link
Author

@gioman

no. Clean Catalina install.

that could be the reason why it's working for you - see @PeterPetrik's comment.

@pedarius
Copy link

pedarius commented Apr 7, 2020

macOS 10.13.2
QGIS 3.12.1

copied the libiconv.2.dylib like PeterPetrik suggested but:

Dyld Error Message:
Library not loaded: @executable_path/lib/libiconv.2.dylib
Referenced from: /Applications/QGIS3.12.app/Contents/MacOS/lib/libgdal.20.dylib
Reason: Incompatible library version: libgdal.20.dylib requires version 9.0.0 or later, but libiconv.2.dylib provides version 7.0.0

@PeterPetrik
Copy link
Contributor

PeterPetrik commented Apr 7, 2020

I work on the new dependencies build system (outside homebrew), new automatic CI for qgis on Mac and new bundler with GDAL3/PROJ6 that will be ready for 3.14 release at least. I hope the new system will land in nightlies this month. I will keep you informed

@microcebus
Copy link

I work on the new dependencies build system (outside homebrew), new automatic CI for qgis on Mac and new bundler with GDAL3/PROJ6 that will be ready for 3.14 release at least. I hope the new system will land in nightlies this month. I will keep you informed

Thanks for the update and your solution Peter. It worked for me.
QGIS 3.12.2, OSX.14.6 (Mojave), hackintosh, installed via Homebrew/Cask

@epurpur
Copy link

epurpur commented Jun 1, 2020

This problem is still present in version 3.12. The workaround is not the best solution but still works:

rename
/Applications/QGIS3.8.app/Contents/MacOS/lib/libiconv.2.dylib to /Applications/QGIS3.8.app/Contents/MacOS/lib/libiconv.2.dylib_old and

and copy

/usr/lib/libiconv.2.dylib
to
/Applications/QGIS3.8.app/Contents/MacOS/lib/libiconv.2.dylib.

Best regards

I tried the following (and other solutions referenced in this thread) and it did not work. But glad the issue has been addressed and I am looking forward to a solution!

@PeterPetrik
Copy link
Contributor

@microcebus
Copy link

can anyone test with https://qgis.org/downloads/macos/nightly2/qgis_nightly2_master_20200723_032054.dmg ?

Seems to work okay, but got the following error at start up. Possibly user error?

=====
Couldn't load plugin 'qgis_resource_sharing' due to an error when calling its classFactory() method

ImportError: cannot import name 'QtWebKitWidgets' from 'PyQt5' (/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/PyQt5/init.py)
Traceback (most recent call last):
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 334, in _startPlugin
plugins[packageName] = package.classFactory(iface)
File "/Users/lukek/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/qgis_resource_sharing/init.py", line 55, in classFactory
from resource_sharing.plugin import Plugin
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 743, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/lukek/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/qgis_resource_sharing/resource_sharing/plugin.py", line 31, in
from .gui.resource_sharing_dialog import ResourceSharingDialog
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 743, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/lukek/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/qgis_resource_sharing/resource_sharing/gui/resource_sharing_dialog.py", line 83, in
FORM_CLASS, _ = uic.loadUiType(ui_path('resource_sharing_dialog_base.ui'))
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/PyQt/uic/init.py", line 36, in __loadUiType
return __PyQtLoadUiType(*args, **kwargs)
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/PyQt5/uic/init.py", line 203, in loadUiType
exec(code_string.getvalue(), ui_globals)
File "", line 284, in
ImportError: cannot import name 'QtWebKitWidgets' from 'PyQt5' (/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/PyQt5/init.py)

Python version: 3.7.7 (default, Jul 15 2020, 17:09:38) [Clang 11.0.3 (clang-1103.0.32.62)]
QGIS version: 3.15.0-Master Master, 7565a647e7

Python Path:
/Users//Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/contour
/Applications/QGIS.app/Contents/MacOS/../Resources/python
/Users/
/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users//Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/netCDF4-1.5.3-py3.7-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/GDAL-3.1.2-py3.7-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python37.zip
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/pyproj-2.6.0-py3.7-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.7
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/lib-dynload
/Applications/QGIS.app/Contents/MacOS/lib/python3.7/site-packages/cftime-1.2.0-py3.7-macosx-10.13.0-x86_64.egg
/Users/
/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/~/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/qgis_resource_sharing/ext_libs

@gioman
Copy link

gioman commented Jul 23, 2020

Seems to work okay, but got the following error at start up. Possibly user error?

@microcebus the error comes from a 3rd party plugin. Remove it and see if the error goes away.

qgis_resource_sharing

@PeterPetrik
Copy link
Contributor

This is separate issue with half-baked new installer. Please report to QGIS-Mac-Packager as separate issue.

@microcebus
Copy link

microcebus commented Jul 23, 2020

Thanks Gioman, that worked. The only other gotcha appears to be it doesn't seem to recognise kml, kmz or gpx files either in existing project files or adding them to new project files.
2020-07-24T00:51:51 CRITICAL Invalid Data Source : /Users/~/test.kmz is not a valid or recognized data source.

@PeterPetrik
Copy link
Contributor

@microcebus that is covered in #48

@microcebus
Copy link

Good to know. Thanks Peter for your efforts on this.

@Lesanse
Copy link

Lesanse commented Jul 23, 2020

I'm sorry to bother you all guys because I am no developer but where am I to find /usr/lib/libiconv.2.dylib ???

I really need this fixed and I can't find it in code files on here nor on my Mac folders...

Thanks in advance!

@aberenyi
Copy link
Author

@PeterPetrik many thanks for your continued effort in fixing this.

I can confirm that the half-baked version looks okay, however, couldn't really test the original issue as GDAL is not included yet.

@epurpur
Copy link

epurpur commented Aug 6, 2020

Sorry if this is out of date now but the new dev version that @PeterPetrik provided a link to does not appear to include any GDAL tools? Though I did notice the version was 3.1.2.

Thank you for your continued work on this.

@PeterPetrik
Copy link
Contributor

@epurpur I have created the issue #66

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants