ruben2020 / codequery

A code-understanding, code-browsing or code-search tool. This is a tool to index, then query or search C, C++, Java, Python, Ruby, Go and Javascript source code. It builds upon the databases of cscope and ctags, and provides a nice GUI tool.
https://ruben2020.github.io/codequery/
Mozilla Public License 2.0
685 stars 86 forks source link

Can't run under OSX10.10 #54

Closed fluber closed 7 years ago

fluber commented 8 years ago

I try use two methods to install codequery in OS X .

  1. brew install codequery 2.follow the "HOW TO INSTALL CODEQUERY IN LINUX" after success install codequery. I run the program, and I got the following errors.

objc[46761]: Class QCocoaPageLayoutDelegate is implemented in both /usr/local/opt/qt/lib/QtGui.framework/Versions/4/QtGui and /usr/local/opt/qt5/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport. One of the two will be used. Which one is undefined. objc[46761]: Class QCocoaPrintPanelDelegate is implemented in both /usr/local/opt/qt/lib/QtGui.framework/Versions/4/QtGui and /usr/local/opt/qt5/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport. One of the two will be used. Which one is undefined. QWidget: Must construct a QApplication before a QWidget Abort trap: 6

fluber commented 8 years ago

I try to remove qt5. My system only has qt4. I rebuild codequery and run it. I got the following error.

dyld: Library not loaded: /usr/local/opt/qt5/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport Referenced from: /usr/local/opt/qscintilla2/lib/libqscintilla2.12.dylib Reason: Incompatible library version: libqscintilla2.12.dylib requires version 5.6.0 or later, but QtPrintSupport provides version 5.3.0 Trace/BPT trap: 5

fluber commented 8 years ago

I found in the cmake process has the following line. Found QScintilla: /usr/local/lib/libqscintilla2.dylib

I think my system Scintilla Lib use qt5.

this thing make this error.

ruben2020 commented 8 years ago

Thanks. Currently we officially support only Qt4.

fluber commented 8 years ago

I finally sloe this problem. if you use the brew install codequery. now brew also install qscintilla2, but it use qt5 now. I download the QScintilla_gpl-2.9.3.tar.gz from the official site. I follow the steps in the doc/html-Qt4Qt5/index.html to install the qscintilla2. and I download the codequery source to install.

cmake -G "Unix Makefiles" ..
ccmake .
=======
QSCINTILLA_INCLUDE_DIR = /usr/local/Cellar/qt/4.8.7_2/include/Qsci
QSCINTILLA_LIBRARY=/usr/local/Cellar/qt/4.8.7_2/lib/libqscintilla2.dylib
=======
make
sudo make install 

finally

add export DYLD_LIBRARY_PATH=/usr/local/Cellar/qt/4.8.7_2/lib

then codequery

it's work for me.

ruben2020 commented 8 years ago

Let me check if Brew has qscintilla2 for qt4 under a different name e.g. qscintilla2-qt4 or something else.

ruben2020 commented 8 years ago

Looks like homebrew wants to switch permanently to qt5 with no support for qt4. I don't really have a problem with that. I've already been building codequery experimentally with qt5 before. Maybe I'll do that within a few days.

fluber commented 8 years ago

Thank for your kind heart.

rafi commented 8 years ago

I use Macports, not Homebrew. I successfully built codequery with Qt5, but unless I export DYLD_LIBRARY_PATH, I get this error running codequery:

dyld: Library not loaded: libqscintilla2.12.dylib
  Referenced from: /opt/local/bin/codequery
  Reason: image not found
Abort trap: 6

Is there anyway injecting this during build?

ruben2020 commented 8 years ago

Hi @rafi, I guess you're currently running this command for cmake: cmake -DBUILD_QT5=ON -G "Unix Makefiles" ..

You can add another argument: cmake -DBUILD_QT5=ON -DQT5QSCINTILLA_LIBRARY=/path/to/libqscintilla2.12.dylib -G "Unix Makefiles" ..

You can get some hints from the Homebrew codequery formula here.

ruben2020 commented 7 years ago

Now with CodeQuery v0.19.0, there is no more dependency on QScintilla.