a-ilin / vidalia

Tor / Vidalia project, forked and revived
Other
8 stars 7 forks source link

Linker error on compile #1

Open DemonSinusa opened 6 years ago

DemonSinusa commented 6 years ago

[100%] Building CXX object src/vidalia/CMakeFiles/vidalia.dir/vidalia_autogen/GXDUDAM45N/qrc_vidalia_i18n.cpp.o [100%] Linking CXX executable vidalia CMakeFiles/vidalia.dir/Vidalia.cpp.o: In function VidaliaNativeEventFilter::VidaliaNativeEventFilter()': Vidalia.cpp:(.text._ZN24VidaliaNativeEventFilterC2Ev[_ZN24VidaliaNativeEventFilterC5Ev]+0x1b): undefined reference tovtable for VidaliaNativeEventFilter'

cmake parm: $ cmake .. -DUSE_QT5=ON -DUSE_GEOIP=1

DemonSinusa commented 6 years ago

so and crossplatform replace src/vidalia/MainWindow.cpp str 846-850 to "QThread::sleep(1);"

kayfab3 commented 2 years ago

@DemonSinusa this answer is coming three years late. Maybe it helps.

@a-ilin you might want to update two files.

After fixing these two bugs the code compiles on linux. The linker compile bug effected compiling on linux and other derivatives. Windows compiling was not effected as the MS windows check was a different function in Vidalia.cpp

It might have been better to port Vidalia 0.2.21

Vidalia 0.3.3 definitely feels alpha and some functionality is broken. Circuits do not display or refresh quickly. It is not possible to delete or close a tor circuit because the QT widgets controlling this functionality are slow to refresh and are essentially broken. They do not respond well to user input.

A QT dev with experience should be able to optimize the code and correct issues with this QT4 to QT5 port.

# # BUG FIX #1 - mainwindow.cpp # https://github.com/a-ilin/vidalia/blob/alpha-qt5/src/vidalia/MainWindow.cpp

REPLACE lines 846-850

      #if defined(Q_OS_WIN)
            Sleep(1000);
      #else
            sleep(1);
      #endif

replace with

QThread::sleep(1);


# # BUG FIX #2 - Vidalia.cpp
# https://github.com/a-ilin/vidalia/blob/alpha-qt5/src/vidalia/Vidalia.cpp

This resolves the linker error on compile

INSERT on line 242

#else
bool VidaliaNativeEventFilter::nativeEventFilter(const QByteArray& /*eventType*/, void* message, long* result)
{
    return false;
}

After insert the section of code appears as


#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
  return QApplication::winEventFilter(msg, result);
#else
  return false;
#endif
}
#else
bool VidaliaNativeEventFilter::nativeEventFilter(const QByteArray& /*eventType*/, void* message, long* result)
{
    return false;
}
#endif
DemonSinusa commented 2 years ago

@kayfab3 Thanks for the answer, but now so much has changed in the libraries ... Some of the macros and classes QT5 and CMake is deprecated. If there is a working solution, then I will be grateful and happy to use it, as well as, with permission, I will make a PKGBUILD for the AUR.

kayfab3 commented 2 years ago

@DemonSinusa

I was able to compile the repo code using the steps outlined above. I can't speak to changes or deprecated macros and classes in QT5. I know this isn't the answer you were hoping for. If someone else is going to port tor further it's not going to be me.

barracuda156 commented 6 months ago

@kayfab3 Perhaps related: https://github.com/a-ilin/vidalia/issues/2