Jinmo / ifred

IDA command palette & more (Ctrl+Shift+P, Ctrl+P)
141 stars 14 forks source link

Symbol not found #19

Open nyx0 opened 3 years ago

nyx0 commented 3 years ago

In IDA I got this behaviour (same for 32bits)

dlopen(/Users/user/.idapro/plugins/ida_palette64.dylib): dlopen(/Users/user/.idapro/plugins/ida_palette64.dylib, 2): Symbol not found: __ZN2QT17QAbstractItemView11eventFilterEPNS_7QObjectEPNS_6QEventE

when I compile it this warning shows up:

[...]
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: palette/libpalette.a(action.cpp.o) has no symbols
[...]

it seems that line could be the issue: https://github.com/Jinmo/ifred/blob/8e9ef6319c019c3985c27098bf04c0c3ac98e468/palette/include/palette/widgets/palette_items.h#L20

Any ideas? Thanks

Jinmo commented 3 years ago

Hello, it seems like QAbstractItemView is reimplemented in Qt 5.10. Try using a Qt distribution of version 5.6.3 (or 5.6.x; I remember 5.6.12 also worked) from their website: https://download.qt.io/new_archive/qt/5.6/5.6.3/

nyx0 commented 3 years ago

Oh I see. I'm sorry I tried with 5.6.3 but it looks like I have the similar issue...

[...]
[14/19] Linking CXX static library palette/libpalette.a
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: palette/libpalette.a(action.cpp.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: palette/libpalette.a(action.cpp.o) has no symbols
[19/19] Linking CXX shared library palette/src/ida/ida_palette.dylib

$ otool -L build/palette/src/ida/ida_palette.dylib
build/palette/src/ida/ida_palette.dylib:
    @rpath/ida_palette.dylib (compatibility version 0.0.0, current version 0.0.0)
    @executable_path/libida.dylib (compatibility version 1.0.0, current version 1.0.0)
    @executable_path/plugins/idapython3.dylib (compatibility version 1.0.0, current version 1.0.0)
    @rpath/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.6.0, current version 5.6.3)
    @rpath/QtGui.framework/Versions/5/QtGui (compatibility version 5.6.0, current version 5.6.3)
    @rpath/QtCore.framework/Versions/5/QtCore (compatibility version 5.6.0, current version 5.6.3)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 905.6.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5)

ida's output:

dlopen(/Users/user/.idapro/plugins/ida_palette.dylib): dlopen(/Users/user/.idapro/plugins/ida_palette.dylib, 2): Symbol not found: __ZN2QT17QAbstractItemView11eventFilterEPNS_7QObjectEPNS_6QEventE
  Referenced from: /Users/user/.idapro/plugins/ida_palette.dylib
  Expected in: flat namespace
 in /Users/user/.idapro/plugins/ida_palette.dylib
/Users/user/.idapro/plugins/ida_palette.dylib: can't load file

Did you manage to compile it on Windows?

Jinmo commented 3 years ago

Yes. I usually set CMAKE_PREFIX_PATH to contain the path of Qt framework (5.6.3) to ensure that it uses the headers with the right version. If the build refers a wrong version of QAbstractItemView definition, it'll refer this non-existing symbol.

EDIT: I remember using it like -DCMAKE_PREFIX_PATH <QT_INSTALLATION_PATH> e.g. C:\Qt\Qt5.6.3\5.6.3\msvc2015_64. I've added a version check for ida-cmake so it'll raise an error if a wrong version is being used.