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

macOS catalina won't build #11425

Open
StrayDawg opened this issue Oct 30, 2019 · 7 comments
Labels

Comments

@StrayDawg
Copy link

@StrayDawg StrayDawg commented Oct 30, 2019

masOS Catalina 10.15.1 clean install
per mac os compilation page did the following...
installed xCode 11 from app store
ran

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer\
(cd /Applications/Xcode.app/Contents/Developer/usr/bin; sudo ln -s xcodebuild xcrun)

from terminal

installed homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

which installed the command line tools
then

brew install pkg-config autoconf automake libtool openssl boost
brew install libtorrent-rasterbar
brew install qt
brew link --force qt
git clone https://github.com/qbittorrent/qBittorrent.git
export QT_QMAKE=/usr/local/opt/qt5/bin
cd qBittorrent
echo export OPENSSL_ROOT_DIR=\"/usr/local/opt/openssl\" >> ~/.zshrc\
source ~/.zshrc
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"\
 export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
./configure
make -j2

received this error every time I tried to build

Undefined symbols for architecture x86_64:
  "libtorrent::entry::entry(std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, libtorrent::entry, libtorrent::aux::strview_less, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, libtorrent::entry> > >)", referenced from:
      BitTorrent::Tracker::processRequest(Http::Request const&, Http::Environment const&) in libqbt_base.a(tracker.cpp.o)
      BitTorrent::Tracker::prepareAnnounceResponse(BitTorrent::Tracker::TrackerAnnounceRequest const&) in libqbt_base.a(tracker.cpp.o)
      void std::__1::allocator<libtorrent::entry>::construct<libtorrent::entry, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, libtorrent::entry, libtorrent::aux::strview_less, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, libtorrent::entry> > >&>(libtorrent::entry*, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, libtorrent::entry, libtorrent::aux::strview_less, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, libtorrent::entry> > >&) in libqbt_base.a(tracker.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
@Kolcha

This comment has been minimized.

Copy link
Contributor

@Kolcha Kolcha commented Oct 30, 2019

according to libtorrent code and your error output, looks like something (very likely libtorrent, because qBittorrent forces C++11) was compiled without C++11
homebrew' formulae says nothing about C++11, only some test application is compiled with -std=c++11 option...
I have no deep knowledge about Homebrew, but if you find any compiler options used during libtorrent build this will be very helpful

@Kolcha

This comment has been minimized.

Copy link
Contributor

@Kolcha Kolcha commented Oct 30, 2019

BTW, it is not so hard to build qBittorrent on macOS without these "Linux-like" environments such Homebrew. Just look my script, it is pretty big, but this just an automation, nothing more. it completely stand-alone (i.e. downloads everything required by itself), just try it if you want

@StrayDawg

This comment has been minimized.

Copy link
Author

@StrayDawg StrayDawg commented Oct 30, 2019

Thanks for the script... looking at the configure output closer I see

checking if compiler defaults to C++14 or later mode... no
checking if compiler supports C++14... yes
checking if C++14 is disabled by the set compiler flags... no
***configure: WARNING: C++14 mode is now force enabled. The C++ mode should
match the mode that other libraries were built with, otherwise you'll
likely get linking errors.***
*checking that generated files are newer than configure... done*
configure: creating ./config.status

and

**Project WARNING: Qt has only been tested with version 10.14 of the platform
SDK, you're using 10.15.
Project WARNING: This is an unsupported configuration. You may experience
build issues, and by using
Project WARNING: the 10.15 SDK you are opting in to new features that Qt
has not been prepared for.
Project WARNING: Please downgrade the SDK you use to build your app to
version 10.14, or configure
Project WARNING: with CONFIG+=sdk_no_version_check when running qmake to
silence this warning.**

So it's probably time I wait for the others to catch up

@Kolcha

This comment has been minimized.

Copy link
Contributor

@Kolcha Kolcha commented Oct 30, 2019

is the first output (from configure) from libtorrent? it is pretty strange that something enables C++14 and show warning... never saw that... but very likely that can be reason of your build issue. you can try to build qBittorrent with C++14 instead of C++11 (just specify CXXFLAGS="-std=c++14" after all configure arguments), maybe that help.
what about warning from Qt, don't worry about it. it is just a notice that Qt is not tested with new macOS SDK, and has no benefits from it. similar warning I saw when macOS 10.12 was released.
Qt warning is not critical at least for qBittorrent and my own software.
moreover, even Qt dev branch produces that warning, so there is no any Qt version without that warning
P.S> if you want to try qBittorrent from master branch, you can download my build, I built it this weekend

@sledgehammer999

This comment has been minimized.

Copy link
Contributor

@sledgehammer999 sledgehammer999 commented Nov 2, 2019

The warning is from qBittorrent. It seems that you're building the master branch which requires at least c++14. The branch v4_1_x requires at least c++11 and isn't compatible with libtorrent 1.2.x. If libtorrent was build eg with c++17 and qbt with c++14 then there may be a problem with that.
However on High Sierra I seem to custom build both fine. Look at this edited libtorrent formula on how I enable c++14 for libtorrent 1.2.x series. And here is the 1.1.x series.
Basically args << "CXXFLAGS=-std=c++14" or args << "CXXFLAGS=-std=c++11"

@xavier2k6

This comment has been minimized.

Copy link

@xavier2k6 xavier2k6 commented Nov 6, 2019

BTW, it is not so hard to build qBittorrent on macOS without these "Linux-like" environments such Homebrew. Just look my script, it is pretty big, but this just an automation, nothing more. it completely stand-alone (i.e. downloads everything required by itself), just try it if you want

@Kolcha Do you have an automated script for windows 10 64bit?

@Kolcha

This comment has been minimized.

Copy link
Contributor

@Kolcha Kolcha commented Nov 6, 2019

@xavier2k6 Actually yes, but such script actually under development. even more:

  • script builds qBittorrent in completely different way rather than official, but it produces much better results for HiDPI screens, see this my post for details #11445 (comment)
  • there is no installer (planned, but require a lot of work)
  • script in not so "standalone" as macOS build script. it expects few tools installed an available in PATH, required tools are listed in first few lines
  • it is very slow comparing to macOS script on the same hardware... OpenSSL is build using only one CPU core... Qt build also take much more time, even if all cores are used. libtorrent build produces strange warnings, which make me think about few awful things, and much more. have no idea what to do right now. I'm not Win developer, even not Win user and a lot of things in Win world are pretty strange to me.
  • script is written in Windows Batch language, I know PowerShell is there, but I think it is not worth to me to learn it, because it is almost programming language (not just simple script language like Bash) and I'm not even Win user
  • script will work only in Windows 10! It requires some utilities usually available in any unix-like environment and became available in Win10 too
    try it if you want (link will be valid only few days), when it will be finished I'll publish it as I already did for macOS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.