meganz / MEGAsync

Easy automated syncing between your computers and your MEGA Cloud Drive
Other
1.64k stars 281 forks source link

Steps for compiling on Linux do not work #4

Open dzielin opened 8 years ago

dzielin commented 8 years ago

I have found that simply following the steps in the readme causes the configure script to break for a few different reasons. The first reason is that it doesn't reference bringing the SDK into the MEGAsync project directory (either by cloning or linking). It also references the root directory by the name MEGASync (which doesn't even match the repository name MEGAsync). Because the default configure script refers to SDK files using the path ./MEGASync/mega/[...], the configure script cannot be run from within ./src/ like the instructions describe. In fact, the script must be run from immediately outside the root of the git repository. The readme also refers to a desktop.git that does not appear to exist. Finally, libssl-dev appears to be required but is not listed in the dependencies.

If you're going to assume the SDK is installed and exists in a specific location in the configure script, there should probably be a note of this on the readme page.

My compilation steps looked like this so far:

sudo apt-get install build-essential autoconf automake m4 libtool qt4-qmake make libqt4-dev libcrypto++-dev libsqlite3-dev libc-ares-dev
sudo apt-get install libnautilus-extension-dev
sudo apt-get install ssl-dev
git clone https://github.com/meganz/MEGAsync.git ./MEGASync
git clone https://github.com/meganz/sdk.git ./MEGASync/mega
./MEGASync/src/configure

That gets the configure script to stop complaining about missing files (see https://github.com/meganz/MEGAsync/blob/master/src/configure#L47, for example). I continue with:

cd ./MEGASync/src/
qmake MEGA.pro
lrelease MEGASync/MEGASync.pro

This all works fine, but when I try to run "make," I am hit with another error effectively indicating that the SDK is not installed despite the end of the configure script appearing to complete this step. So, I go back to attempt the SDK install manually.

So I continue with:

cd ../mega/
sudo apt-get install libcurl4-openssl-dev libc-ares-dev libssl-dev libcrypto++-dev zlib1g-dev libsqlite3-dev libfreeimage-dev libreadline-dev
sh autogen.sh
./configure
make
sudo make install

Great! At this point, it appears the SDK is installed properly. The MEGASync/src make still doesn't work, though. So I tried re-running the configuration script, qmake, and lrelease. No help. There's still appears to be some dependencies that were overlooked or something.

cd MEGASync/ && make -f Makefile
make[1]: Entering directory `/tmp/mega2/MEGASync/src/MEGASync'
g++ -c -m64 -pipe -g -O2 -Wall -W -D_REENTRANT -DQT_DISABLE_DEPRECATED_BEFORE=0x000000 -DUSE_DBUS -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtDBus -I/usr/include/qt4 -Igui -Igui/linux -Icontrol -Iplatform -Igoogle_breakpad -Iqtlockedfile -I. -I. -I. -o SettingsDialog.o gui/SettingsDialog.cpp
In file included from ./MegaApplication.h:16:0,
                 from gui/SettingsDialog.cpp:13:
./gui/NodeSelector.h:10:35: fatal error: QTMegaRequestListener.h: No such file or directory
 #include "QTMegaRequestListener.h"
                                   ^
compilation terminated.
make[1]: *** [SettingsDialog.o] Error 1
make[1]: Leaving directory `/tmp/mega2/MEGASync/src/MEGASync'
make: *** [sub-MEGASync-make_default] Error 2

QTMegaRequestListener.h is referenced but does not appear to exist in the repository. I do see ./MEGASync/mega/bindings/qt/QTMegaRequestListener.cpp, but no corresponding header file. I can see that the file existed previously here: https://github.com/meganz/MEGAsync/blob/a35f2d1db37308d03988ef3999a8d767fd34c85f/Source/MEGASync/sdk/qt/QTMegaRequestListener.h

pepa65 commented 8 years ago

Excellent report! Hope this gets fixed and properly documented. Thanks for going through the steps so other people know it isn't working as is.

ghost commented 8 years ago

Hi! I have added the missing header but the compiler is still complaining about missing references. Is there a workaround to overcome the issues mentioned by @dzielin and build the project? If so, would you share the procedure? Thank you!

ghost commented 8 years ago

Here more details about my attempt to compile MEGASync. Following @dzielin steps, I get to this point:

> make
cd MEGASync/ && /usr/lib/x86_64-linux-gnu/qt4/bin/qmake /tmp/MEGASync/src/MEGASync/MEGASync.pro -o Makefile
WARNING: /tmp/MEGASync/src/MEGASync/MEGASync.pro:50: Unable to find file for inclusion mega/bindings/qt/sdk.pri
Project MESSAGE: Installing desktop files.
cd MEGASync/ && make -f Makefile 
make[1]: Entering directory `/tmp/MEGASync/src/MEGASync'
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/ActiveTransfer.ui -o ui_ActiveTransfer.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/InfoDialog.ui -o ui_InfoDialog.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/RecentFile.ui -o ui_RecentFile.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/TransferProgressBar.ui -o ui_TransferProgressBar.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/UsageProgressBar.ui -o ui_UsageProgressBar.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/NodeSelector.ui -o ui_NodeSelector.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/FolderBinder.ui -o ui_FolderBinder.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/BindFolderDialog.ui -o ui_BindFolderDialog.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/UploadToMegaDialog.ui -o ui_UploadToMegaDialog.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/PasteMegaLinksDialog.ui -o ui_PasteMegaLinksDialog.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/ImportMegaLinksDialog.ui -o ui_ImportMegaLinksDialog.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/ImportListWidgetItem.ui -o ui_ImportListWidgetItem.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/CrashReportDialog.ui -o ui_CrashReportDialog.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/SetupWizard.ui -o ui_SetupWizard.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/SettingsDialog.ui -o ui_SettingsDialog.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/AccountDetailsDialog.ui -o ui_AccountDetailsDialog.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/DownloadFromMegaDialog.ui -o ui_DownloadFromMegaDialog.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/SizeLimitDialog.ui -o ui_SizeLimitDialog.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/MessageBox.ui -o ui_MessageBox.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/InfoOverQuotaDialog.ui -o ui_InfoOverQuotaDialog.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/ChangeLogDialog.ui -o ui_ChangeLogDialog.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/GuestWidget.ui -o ui_GuestWidget.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/StreamingFromMegaDialog.ui -o ui_StreamingFromMegaDialog.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/PermissionsDialog.ui -o ui_PermissionsDialog.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/PermissionsWidget.ui -o ui_PermissionsWidget.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic gui/linux/ConfirmSSLexception.ui -o ui_ConfirmSSLexception.h
g++ -c -m64 -pipe -g -O2 -Wall -W -D_REENTRANT -DQT_DISABLE_DEPRECATED_BEFORE=0x000000 -DUSE_DBUS -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtDBus -I/usr/include/qt4 -Igui -Igui/linux -Icontrol -Iplatform -Igoogle_breakpad -Iqtlockedfile -I. -I. -I. -o SettingsDialog.o gui/SettingsDialog.cpp
In file included from ./MegaApplication.h:16:0,
                 from gui/SettingsDialog.cpp:13:
./gui/NodeSelector.h:10:35: fatal error: QTMegaRequestListener.h: No such file or directory
 #include "QTMegaRequestListener.h"
                                   ^
compilation terminated.
make[1]: *** [SettingsDialog.o] Error 1
make[1]: Leaving directory `/tmp/MEGASync/src/MEGASync'
make: *** [sub-MEGASync-make_default] Error 2

I found that the missing header QTMegaRequestListener.h is actually in /tmp/MEGASync/mega/bindings/qt, so I add the include directory to the Makefile. Running make again:

> make
cd MEGASync/ && make -f Makefile 
make[1]: Entering directory `/tmp/MEGASync/src/MEGASync'
g++ -c -m64 -pipe -g -O2 -Wall -W -D_REENTRANT -DQT_DISABLE_DEPRECATED_BEFORE=0x000000 -DUSE_DBUS -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtDBus -I/usr/include/qt4 -Igui -Igui/linux -Icontrol -Iplatform -Igoogle_breakpad -Iqtlockedfile -I. -I. -I. -I/tmp/MEGASync/mega/bindings/qt -o SettingsDialog.o gui/SettingsDialog.cpp
gui/SettingsDialog.cpp: In member function ‘bool SettingsDialog::saveSettings()’:
gui/SettingsDialog.cpp:1090:38: error: ‘class mega::MegaApi’ has no member named ‘removeSync’
                             megaApi->removeSync(node);
                                      ^
gui/SettingsDialog.cpp:1105:34: error: ‘class mega::MegaApi’ has no member named ‘removeSync’
                         megaApi->removeSync(node);
                                  ^
gui/SettingsDialog.cpp:1158:38: error: ‘class mega::MegaApi’ has no member named ‘syncFolder’
                             megaApi->syncFolder(localFolderPath.toUtf8().constData(), node);
                                      ^
gui/SettingsDialog.cpp:1176:34: error: ‘class mega::MegaApi’ has no member named ‘syncFolder’
                         megaApi->syncFolder(localFolderPath.toUtf8().constData(), node);
                                  ^
gui/SettingsDialog.cpp:1235:22: error: ‘class mega::MegaApi’ has no member named ‘setExcludedNames’
             megaApi->setExcludedNames(&vExclusions);
                      ^
gui/SettingsDialog.cpp:1242:63: warning: statement has no effect [-Wunused-value]
             QT_TR_NOOP("Do you want to restart MEGAsync now?");
                                                               ^
gui/SettingsDialog.cpp:1256:26: error: ‘class mega::MegaApi’ has no member named ‘setExclusionLowerSizeLimit’
                 megaApi->setExclusionLowerSizeLimit(preferences->lowerSizeLimitValue() * pow((float)1024, preferences->lowerSizeLimitUnit()));
                          ^
gui/SettingsDialog.cpp:1260:26: error: ‘class mega::MegaApi’ has no member named ‘setExclusionLowerSizeLimit’
                 megaApi->setExclusionLowerSizeLimit(0);
                          ^
gui/SettingsDialog.cpp:1265:26: error: ‘class mega::MegaApi’ has no member named ‘setExclusionUpperSizeLimit’
                 megaApi->setExclusionUpperSizeLimit(preferences->upperSizeLimitValue() * pow((float)1024, preferences->upperSizeLimitUnit()));
                          ^
gui/SettingsDialog.cpp:1269:26: error: ‘class mega::MegaApi’ has no member named ‘setExclusionUpperSizeLimit’
                 megaApi->setExclusionUpperSizeLimit(0);
                          ^
make[1]: *** [SettingsDialog.o] Error 1
make[1]: Leaving directory `/tmp/MEGASync/src/MEGASync'
make: *** [sub-MEGASync-make_default] Error 2

The problem is that some constants are not defined, in particular ENABLE_SYNC and HAVE_LIBUV. I add them to the Makefile and run make again, but I get a lot of linker errors about missing references. Adding -lmega to the Makefile reduces the errors, but I still get some:

> make                 
cd MEGASync/ && make -f Makefile 
make[1]: Entering directory `/tmp/MEGASync/src/MEGASync'
g++ -m64 -Wl,-O1 -o megasync SettingsDialog.o ActiveTransfer.o InfoDialog.o RecentFile.o TransferProgressBar.o UsageProgressBar.o SetupWizard.o NodeSelector.o FolderBinder.o BindFolderDialog.o UploadToMegaDialog.o PasteMegaLinksDialog.o ImportMegaLinksDialog.o ImportListWidgetItem.o CrashReportDialog.o MultiQFileDialog.o MegaProxyStyle.o AccountDetailsDialog.o DownloadFromMegaDialog.o SizeLimitDialog.o UsageWidget.o MessageBox.o InfoOverQuotaDialog.o QMegaModel.o MegaItem.o ChangeLogDialog.o GuestWidget.o StreamingFromMegaDialog.o ConfirmSSLexception.o PermissionsDialog.o PermissionsWidget.o HTTPServer.o Preferences.o LinkProcessor.o MegaUploader.o UpdateTask.o EncryptedSettings.o CrashHandler.o ExportProcessor.o Utilities.o MegaDownloader.o MegaSyncLogger.o ConnectivityChecker.o notificator.o LinuxPlatform.o ExtServer.o NotifyServer.o crash_generation_client.o exception_handler.o minidump_descriptor.o minidump_writer.o linux_dumper.o linux_ptrace_dumper.o log.o minidump_file_writer.o linux_libc_support.o file_id.o memory_mapped_file.o safe_readlink.o guid_creator.o elfutils.o string_conversion.o convert_UTF.o qtlockedfile.o qtlockedfile_unix.o MegaApplication.o moc_SettingsDialog.o moc_ActiveTransfer.o moc_InfoDialog.o moc_RecentFile.o moc_TransferProgressBar.o moc_UsageProgressBar.o moc_SetupWizard.o moc_NodeSelector.o moc_FolderBinder.o moc_BindFolderDialog.o moc_UploadToMegaDialog.o moc_PasteMegaLinksDialog.o moc_ImportMegaLinksDialog.o moc_ImportListWidgetItem.o moc_CrashReportDialog.o moc_MultiQFileDialog.o moc_MegaProxyStyle.o moc_AccountDetailsDialog.o moc_DownloadFromMegaDialog.o moc_SizeLimitDialog.o moc_UsageWidget.o moc_MessageBox.o moc_InfoOverQuotaDialog.o moc_QMegaModel.o moc_ChangeLogDialog.o moc_GuestWidget.o moc_StreamingFromMegaDialog.o moc_ConfirmSSLexception.o moc_PermissionsDialog.o moc_PermissionsWidget.o moc_HTTPServer.o moc_Preferences.o moc_LinkProcessor.o moc_MegaUploader.o moc_UpdateTask.o moc_EncryptedSettings.o moc_CrashHandler.o moc_ExportProcessor.o moc_MegaDownloader.o moc_MegaSyncLogger.o moc_ConnectivityChecker.o moc_notificator.o moc_ExtServer.o moc_NotifyServer.o moc_MegaApplication.o qrc_Resources_linux.o    -L/usr/lib/x86_64-linux-gnu -L/usr/local/lib -lmega -lssl -lcrypto -lQtDBus -lQtGui -lQtNetwork -lQtCore -lpthread 
SetupWizard.o: In function `SetupWizard::SetupWizard(MegaApplication*, QWidget*)':
/tmp/MEGASync/src/MEGASync/gui/SetupWizard.cpp:29: undefined reference to `mega::QTMegaRequestListener::QTMegaRequestListener(mega::MegaApi*, mega::MegaRequestListener*)'
NodeSelector.o: In function `NodeSelector::NodeSelector(mega::MegaApi*, int, QWidget*)':
/tmp/MEGASync/src/MEGASync/gui/NodeSelector.cpp:22: undefined reference to `mega::QTMegaRequestListener::QTMegaRequestListener(mega::MegaApi*, mega::MegaRequestListener*)'
UploadToMegaDialog.o: In function `UploadToMegaDialog::UploadToMegaDialog(mega::MegaApi*, QWidget*)':
/tmp/MEGASync/src/MEGASync/gui/UploadToMegaDialog.cpp:16: undefined reference to `mega::QTMegaRequestListener::QTMegaRequestListener(mega::MegaApi*, mega::MegaRequestListener*)'
StreamingFromMegaDialog.o: In function `StreamingFromMegaDialog::StreamingFromMegaDialog(mega::MegaApi*, QWidget*)':
/tmp/MEGASync/src/MEGASync/gui/StreamingFromMegaDialog.cpp:28: undefined reference to `mega::MegaApi::httpServerStart(bool, int)'
/tmp/MEGASync/src/MEGASync/gui/StreamingFromMegaDialog.cpp:33: undefined reference to `mega::QTMegaRequestListener::QTMegaRequestListener(mega::MegaApi*, mega::MegaRequestListener*)'
StreamingFromMegaDialog.o: In function `StreamingFromMegaDialog::~StreamingFromMegaDialog()':
/tmp/MEGASync/src/MEGASync/gui/StreamingFromMegaDialog.cpp:38: undefined reference to `mega::MegaApi::httpServerStop()'
StreamingFromMegaDialog.o: In function `StreamingFromMegaDialog::generateStreamURL()':
/tmp/MEGASync/src/MEGASync/gui/StreamingFromMegaDialog.cpp:225: undefined reference to `mega::MegaApi::httpServerGetLocalLink(mega::MegaNode*)'
LinkProcessor.o: In function `LinkProcessor::LinkProcessor(mega::MegaApi*, mega::MegaApi*, QStringList)':
/tmp/MEGASync/src/MEGASync/control/LinkProcessor.cpp:25: undefined reference to `mega::QTMegaRequestListener::QTMegaRequestListener(mega::MegaApi*, mega::MegaRequestListener*)'
MegaUploader.o: In function `MegaUploader::MegaUploader(mega::MegaApi*)':
/tmp/MEGASync/src/MEGASync/control/MegaUploader.cpp:18: undefined reference to `mega::QTMegaRequestListener::QTMegaRequestListener(mega::MegaApi*, mega::MegaRequestListener*)'
ExportProcessor.o: In function `ExportProcessor::ExportProcessor(mega::MegaApi*, QStringList)':
/tmp/MEGASync/src/MEGASync/control/ExportProcessor.cpp:16: undefined reference to `mega::QTMegaRequestListener::QTMegaRequestListener(mega::MegaApi*, mega::MegaRequestListener*)'
LinuxPlatform.o: In function `LinuxPlatform::getDefaultOpenApp(QString)':
/tmp/MEGASync/src/MEGASync/platform/linux/LinuxPlatform.cpp:156: undefined reference to `mega::MegaApi::getMimeType(char const*)'
MegaApplication.o: In function `MEGASyncDelegateListener::MEGASyncDelegateListener(mega::MegaApi*, mega::MegaListener*)':
/tmp/MEGASync/src/MEGASync/MegaApplication.cpp:5002: undefined reference to `mega::QTMegaListener::QTMegaListener(mega::MegaApi*, mega::MegaListener*)'
MegaApplication.o: In function `MEGASyncDelegateListener':
/tmp/MEGASync/src/MEGASync/MegaApplication.cpp:5002: undefined reference to `mega::QTMegaListener::QTMegaListener(mega::MegaApi*, mega::MegaListener*)'
/tmp/MEGASync/src/MEGASync/MegaApplication.cpp:5002: undefined reference to `mega::QTMegaListener::QTMegaListener(mega::MegaApi*, mega::MegaListener*)'
MegaApplication.o: In function `MEGASyncDelegateListener::onRequestFinish(mega::MegaApi*, mega::MegaRequest*, mega::MegaError*)':
/tmp/MEGASync/src/MEGASync/MegaApplication.cpp:5007: undefined reference to `mega::QTMegaListener::onRequestFinish(mega::MegaApi*, mega::MegaRequest*, mega::MegaError*)'
MegaApplication.o: In function `MEGASyncDelegateListener::~MEGASyncDelegateListener()':
/tmp/MEGASync/src/MEGASync/MegaApplication.h:287: undefined reference to `mega::QTMegaListener::~QTMegaListener()'
MegaApplication.o: In function `~MEGASyncDelegateListener':
/tmp/MEGASync/src/MEGASync/MegaApplication.h:287: undefined reference to `mega::QTMegaListener::~QTMegaListener()'
MegaApplication.o:(.rodata._ZTI24MEGASyncDelegateListener[_ZTI24MEGASyncDelegateListener]+0x10): undefined reference to `typeinfo for mega::QTMegaListener'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x10): undefined reference to `mega::QTMegaListener::metaObject() const'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x18): undefined reference to `mega::QTMegaListener::qt_metacast(char const*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x20): undefined reference to `mega::QTMegaListener::qt_metacall(QMetaObject::Call, int, void**)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x58): undefined reference to `mega::QTMegaListener::customEvent(QEvent*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x70): undefined reference to `mega::QTMegaListener::onRequestStart(mega::MegaApi*, mega::MegaRequest*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x80): undefined reference to `mega::QTMegaListener::onRequestUpdate(mega::MegaApi*, mega::MegaRequest*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x88): undefined reference to `mega::QTMegaListener::onRequestTemporaryError(mega::MegaApi*, mega::MegaRequest*, mega::MegaError*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x90): undefined reference to `mega::QTMegaListener::onTransferStart(mega::MegaApi*, mega::MegaTransfer*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x98): undefined reference to `mega::QTMegaListener::onTransferFinish(mega::MegaApi*, mega::MegaTransfer*, mega::MegaError*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0xa0): undefined reference to `mega::QTMegaListener::onTransferUpdate(mega::MegaApi*, mega::MegaTransfer*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0xa8): undefined reference to `mega::QTMegaListener::onTransferTemporaryError(mega::MegaApi*, mega::MegaTransfer*, mega::MegaError*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0xb0): undefined reference to `mega::QTMegaListener::onUsersUpdate(mega::MegaApi*, mega::MegaUserList*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0xb8): undefined reference to `mega::QTMegaListener::onNodesUpdate(mega::MegaApi*, mega::MegaNodeList*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0xc0): undefined reference to `mega::QTMegaListener::onAccountUpdate(mega::MegaApi*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0xc8): undefined reference to `mega::QTMegaListener::onReloadNeeded(mega::MegaApi*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0xd0): undefined reference to `mega::QTMegaListener::onSyncStateChanged(mega::MegaApi*, mega::MegaSync*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0xd8): undefined reference to `mega::QTMegaListener::onSyncFileStateChanged(mega::MegaApi*, mega::MegaSync*, char const*, int)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0xe0): undefined reference to `mega::QTMegaListener::onGlobalSyncStateChanged(mega::MegaApi*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0xf8): undefined reference to `non-virtual thunk to mega::QTMegaListener::onRequestStart(mega::MegaApi*, mega::MegaRequest*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x108): undefined reference to `non-virtual thunk to mega::QTMegaListener::onRequestUpdate(mega::MegaApi*, mega::MegaRequest*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x110): undefined reference to `non-virtual thunk to mega::QTMegaListener::onRequestTemporaryError(mega::MegaApi*, mega::MegaRequest*, mega::MegaError*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x118): undefined reference to `non-virtual thunk to mega::QTMegaListener::onTransferStart(mega::MegaApi*, mega::MegaTransfer*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x120): undefined reference to `non-virtual thunk to mega::QTMegaListener::onTransferFinish(mega::MegaApi*, mega::MegaTransfer*, mega::MegaError*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x128): undefined reference to `non-virtual thunk to mega::QTMegaListener::onTransferUpdate(mega::MegaApi*, mega::MegaTransfer*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x130): undefined reference to `non-virtual thunk to mega::QTMegaListener::onTransferTemporaryError(mega::MegaApi*, mega::MegaTransfer*, mega::MegaError*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x138): undefined reference to `non-virtual thunk to mega::QTMegaListener::onUsersUpdate(mega::MegaApi*, mega::MegaUserList*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x140): undefined reference to `non-virtual thunk to mega::QTMegaListener::onNodesUpdate(mega::MegaApi*, mega::MegaNodeList*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x148): undefined reference to `non-virtual thunk to mega::QTMegaListener::onAccountUpdate(mega::MegaApi*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x158): undefined reference to `non-virtual thunk to mega::QTMegaListener::onReloadNeeded(mega::MegaApi*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x160): undefined reference to `non-virtual thunk to mega::QTMegaListener::onSyncFileStateChanged(mega::MegaApi*, mega::MegaSync*, char const*, int)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x170): undefined reference to `non-virtual thunk to mega::QTMegaListener::onSyncStateChanged(mega::MegaApi*, mega::MegaSync*)'
MegaApplication.o:(.rodata._ZTV24MEGASyncDelegateListener[_ZTV24MEGASyncDelegateListener]+0x178): undefined reference to `non-virtual thunk to mega::QTMegaListener::onGlobalSyncStateChanged(mega::MegaApi*)'
collect2: error: ld returned 1 exit status
make[1]: *** [megasync] Error 1
make[1]: Leaving directory `/tmp/MEGASync/src/MEGASync'
make: *** [sub-MEGASync-make_default] Error 2

Ideas? Thank you.

javiserrano commented 8 years ago

Hi, MEGAsync uses the MEGA C++ SDK as a submodule (a Git repository inside the git repository of MEGAsync). To download all the code needed to build MEGAsync, after cloning the repository: git clone https://github.com/meganz/MEGAsync.git

It is needed to enter the folder of the repo: cd MEGAsync

and type: git submodule update --init --recursive

After that, all the code would be downloaded and the compilation of MEGAsync should success. I hope this helps.

dzielin commented 8 years ago

Tried that in my initial run-through. No luck, hence building the SDK independently.

Cloning into 'src/MEGASync/mega'...
The authenticity of host 'github.com (192.30.252.131)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.252.131' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Clone of 'git@github.com:meganz/sdk.git' into submodule path 'src/MEGASync/mega' failed

.gitmodules needs to be updated from:

[submodule "src/MEGASync/mega"]
        path = src/MEGASync/mega
        url = git@github.com:meganz/sdk.git
        branch = master

to

[submodule "src/MEGASync/mega"]
        path = src/MEGASync/mega
        url = https://github.com/meganz/sdk.git
        branch = master

Looks like I should have put it in ./MEGAsync/src/MEGASync/mega/ instead of ./MEGAsync/mega/ when I cloned it. With that small change to the gitmodules file, though, fetching the SDK independently isn't required and things seem to build successfully.

ghost commented 8 years ago

OK, I did it! I just followed last @dzielin commend and added -ldl to the Makefile libs. Thank you very much!

ghost commented 8 years ago

@dzielin @evils0ul You can follow Arch Linux PKGBUILD instructions from here as an example.

themighty1 commented 8 years ago

Compile steps worked for me on Ubuntu 14.04 out of the box (per the README file)

codingtony commented 7 years ago

I've created a recipe to compile megasync for Ubuntu 16.10 using Docker. It might interest some, might not be perfect so comments and improvement are accepted

https://github.com/codingtony/megasync-docker-compile

rlperez commented 10 months ago

The instructions are missing a few things to get running on Fedora 39 (probably others) as well I think. Some of them are named differently but running configure shows there are additional I had to install.

I think I have these right. This is in retrospect after getting configure to work so I may have a mistake. These are what I installed that satisfied the dependencies.

These I think aren't in the dependencies listed for Ubuntu but don't seem to be there on a workstation Fedora install.

After that...

MEGAsync/src on  master
❯ qmake-qt5 MEGASync/MEGASync.pro
Project MESSAGE: THIRDPARTY_VCPKG_BASE_PATH: ~/Projects/MEGAsync/src/MEGASync/../../../3rdParty_desktop
Project MESSAGE: VCPKG_TRIPLET: x64-linux
Project MESSAGE: vcpkg not used
Project MESSAGE: Installing desktop files.

Not sure if it would be desired but I could try a PR to fill out some of the build documentation on Fedora if I get some time to do so.

The reason I went through trying to build this is due to errors using the flatpak build on Fedora / Gnome. It wants to do a systray icon which is a thing but that's not why it's broken for me. Anytime I want to select a new sync directory it opens a system dialog, you select it then it opens a QT file dialog that can't see any of my directories. Not sure if the build solves my issue but at least I can build it with these dependencies. Haven't tried my local build to sort it out but I have it building!