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

Can't compile on MacOS Sierra 10.12.6 #428

Open
d3v-null opened this issue Oct 9, 2017 · 6 comments
Open

Can't compile on MacOS Sierra 10.12.6 #428

d3v-null opened this issue Oct 9, 2017 · 6 comments

Comments

@d3v-null
Copy link

d3v-null commented Oct 9, 2017

Hi There, here are the steps I've used to try to compile Heimdall on my system from the latest unmodified version on GitHub as per the instructions in appendix B

With additional tips mentioned here when the vanilla instructions didn't work.

$ pwd
/Users/derwent/GitHub/Heimdall/build
$ brew install libusb qt5 cmake
Warning: libusb 1.0.21 is already installed
Warning: qt 5.9.1 is already installed
Warning: cmake 3.9.4 is already installed
$ cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DQt5Widgets_DIR=/usr/local/opt/qt5/lib/cmake/Qt5Widgets -DDISABLE_FRONTEND=ON ..

-- The C compiler identification is AppleClang 9.0.0.9000037
-- The CXX compiler identification is AppleClang 9.0.0.9000037
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found libusb: /usr/local/lib/libusb-1.0.a
-- Checking if large (64-bit) file support is available...
-- Checking if large (64-bit) file support is available - yes
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    Qt5Widgets_DIR


-- Build files have been written to: /Users/derwent/GitHub/Heimdall/build
$ LIBRARY_PATH=/usr/local/lib make
[ 12%] Built target pit
[ 18%] Linking CXX executable ../bin/heimdall
Undefined symbols for architecture x86_64:
  "_CFDataGetBytes", referenced from:
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFDataGetLength", referenced from:
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFDataGetTypeID", referenced from:
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFGetTypeID", referenced from:
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _get_ioregistry_value_number in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFNumberGetTypeID", referenced from:
      _get_ioregistry_value_number in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFNumberGetValue", referenced from:
      _get_ioregistry_value_number in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRelease", referenced from:
      _darwin_close in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_release_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_kernel_driver_active in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _get_ioregistry_value_number in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRetain", referenced from:
      _darwin_open in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRunLoopAddSource", referenced from:
      _darwin_open in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_claim_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRunLoopGetCurrent", referenced from:
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRunLoopRemoveSource", referenced from:
      _darwin_close in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_release_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRunLoopRun", referenced from:
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRunLoopSourceCreate", referenced from:
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRunLoopSourceSignal", referenced from:
      _darwin_exit in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRunLoopStop", referenced from:
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRunLoopWakeUp", referenced from:
      _darwin_exit in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFUUIDGetConstantUUIDWithBytes", referenced from:
      _darwin_claim_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFUUIDGetUUIDBytes", referenced from:
      _darwin_claim_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IOCreatePlugInInterfaceForService", referenced from:
      _darwin_claim_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IOIteratorNext", referenced from:
      _darwin_init in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_devices_detached in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_devices_attached in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_clear_iterator in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_get_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IOKitWaitQuiet", referenced from:
      _darwin_hotplug_poll in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IONotificationPortCreate", referenced from:
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IONotificationPortDestroy", referenced from:
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IONotificationPortGetRunLoopSource", referenced from:
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IOObjectRelease", referenced from:
      _darwin_init in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_claim_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_kernel_driver_active in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_devices_detached in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_devices_attached in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      ...
  "_IORegistryEntryCreateCFProperty", referenced from:
      _darwin_kernel_driver_active in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _get_ioregistry_value_number in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IORegistryEntryGetParentEntry", referenced from:
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IOServiceAddMatchingNotification", referenced from:
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IOServiceGetMatchingServices", referenced from:
      _darwin_init in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IOServiceMatching", referenced from:
      _darwin_init in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "___CFConstantStringClassReference", referenced from:
      CFString in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      CFString in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      CFString in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      CFString in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      CFString in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_kCFAllocatorDefault", referenced from:
      _darwin_kernel_driver_active in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _get_ioregistry_value_number in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_kCFAllocatorSystemDefault", referenced from:
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_kCFRunLoopCommonModes", referenced from:
      _darwin_open in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_kCFRunLoopDefaultMode", referenced from:
      _darwin_close in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_claim_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_release_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_kIOMasterPortDefault", referenced from:
      _darwin_init in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_hotplug_poll in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/heimdall] Error 1
make[1]: *** [heimdall/CMakeFiles/heimdall.dir/all] Error 2
make: *** [all] Error 2

From this it looks like something is going wrong in the linking stage when trying to find libusb, but I certainly have libusb installed

$ pkg-config --list-all | grep libusb
libusb-1.0                          libusb-1.0 - C API for USB device access from Linux, Mac OS X, Windows, OpenBSD/NetBSD and Solaris userspace
libusb                              libusb - USB access library (libusb-1.0 compat wrapper)

some libusb information:

$ brew ls libusb; ls -la /usr/local/lib | grep usb
/usr/local/Cellar/libusb/1.0.21/include/libusb-1.0/libusb.h
/usr/local/Cellar/libusb/1.0.21/lib/libusb-1.0.0.dylib
/usr/local/Cellar/libusb/1.0.21/lib/pkgconfig/libusb-1.0.pc
/usr/local/Cellar/libusb/1.0.21/lib/ (2 other files)
/usr/local/Cellar/libusb/1.0.21/share/libusb/ (16 files)
lrwxr-xr-x   54 derwent  9 Oct 14:15 libusb-0.1.4.dylib -> ../Cellar/libusb-compat/0.1.5_1/lib/libusb-0.1.4.dylib
lrwxr-xr-x   46 derwent  9 Oct 14:15 libusb-1.0.0.dylib -> ../Cellar/libusb/1.0.21/lib/libusb-1.0.0.dylib
lrwxr-xr-x   40 derwent  9 Oct 14:15 libusb-1.0.a -> ../Cellar/libusb/1.0.21/lib/libusb-1.0.a
lrwxr-xr-x   44 derwent  9 Oct 14:15 libusb-1.0.dylib -> ../Cellar/libusb/1.0.21/lib/libusb-1.0.dylib
lrwxr-xr-x   44 derwent  9 Oct 14:15 libusb.a -> ../Cellar/libusb-compat/0.1.5_1/lib/libusb.a
lrwxr-xr-x   48 derwent  9 Oct 14:15 libusb.dylib -> ../Cellar/libusb-compat/0.1.5_1/lib/libusb.dylib

Nothing interesting in my brew doctor

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
  /Users/derwent/.pyenv/shims/python-config
  /Users/derwent/.pyenv/shims/python2-config
  /Users/derwent/.pyenv/shims/python2.6-config
  /Users/derwent/.pyenv/shims/python2.7-config
  /Users/derwent/.pyenv/shims/python3-config
  /Users/derwent/.pyenv/shims/python3.2-config
  /Users/derwent/.pyenv/shims/python3.2m-config
  /Users/derwent/.pyenv/shims/python3.3-config
  /Users/derwent/.pyenv/shims/python3.3m-config
  /Users/derwent/.pyenv/shims/python3.4-config
  /Users/derwent/.pyenv/shims/python3.4m-config
  /Users/derwent/.pyenv/shims/python3.6-config
  /Users/derwent/.pyenv/shims/python3.6m-config

Warning: You have a curlrc file
If you have trouble downloading packages with Homebrew, then maybe this
is the problem? If the following command doesn't work, then try removing
your curlrc:
  curl https://github.com

And some info about my system:

Distro: OS X 10.12.6
Shell: /bin/zsh
CPU: Intel Core i7-4960HQ CPU @ 2.60GHz
Memory: 16 GB
Disk: 91%

When I install using the installer, it works fine but I'm trying to install from source because I'm having issues with my Samsung Galaxy S5 klte not downloading the pit file on my windows or mac machines.

Thanks.

@johnny13
Copy link

@derwentx I dont think you are using the latest release. Check the releases tab and download 1.4.2.
Im running Sierra 10.12.6 also and had the same error until I used the latest release.

cd ~/Downloads/Heimdall-1.4.2/
mkdir build
cd build

Then running this command cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DQt5Widgets_DIR=/usr/local/opt/qt5/lib/cmake/Qt5Widgets .. gave me this output...

-- The C compiler identification is AppleClang 9.0.0.9000037
-- The CXX compiler identification is AppleClang 9.0.0.9000037
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found libusb: /usr/local/lib/libusb-1.0.a  
-- Checking if large (64-bit) file support is available...
-- Checking if large (64-bit) file support is available - yes
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.8") 
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/derekscott/Downloads/Heimdall-1.4.2/build

Then running make gave me this...

Scanning dependencies of target pit
[  3%] Building CXX object libpit/CMakeFiles/pit.dir/source/libpit.cpp.o
[  6%] Linking CXX static library libpit.a
[  6%] Built target pit
Scanning dependencies of target heimdall
[  9%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/Arguments.cpp.o
[ 12%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/BridgeManager.cpp.o
[ 15%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/ClosePcScreenAction.cpp.o
[ 18%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/DetectAction.cpp.o
[ 21%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/DownloadPitAction.cpp.o
[ 24%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/FlashAction.cpp.o
[ 27%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/HelpAction.cpp.o
[ 30%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/InfoAction.cpp.o
[ 33%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/Interface.cpp.o
[ 36%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/main.cpp.o
[ 39%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/PrintPitAction.cpp.o
[ 42%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/Utility.cpp.o
[ 45%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/VersionAction.cpp.o
[ 48%] Linking CXX executable ../bin/heimdall
[ 48%] Built target heimdall
Scanning dependencies of target heimdall-frontend_autogen
[ 51%] Generating qrc_mainwindow.cpp
RCC: Warning: No resources in '/Users/derekscott/Downloads/Heimdall-1.4.2/heimdall-frontend/mainwindow.qrc'.
[ 54%] Generating ui_mainwindow.h
[ 57%] Generating ui_aboutform.h
[ 60%] Automatic MOC for target heimdall-frontend
Generating MOC source CAWN4ZDDTK/moc_aboutform.cpp
Generating MOC source CAWN4ZDDTK/moc_mainwindow.cpp
Generating MOC compilation mocs_compilation.cpp
[ 60%] Built target heimdall-frontend_autogen
Scanning dependencies of target heimdall-frontend
[ 63%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/aboutform.cpp.o
[ 66%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/Alerts.cpp.o
[ 69%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/FirmwareInfo.cpp.o
[ 72%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/main.cpp.o
[ 75%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/mainwindow.cpp.o
[ 78%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/PackageData.cpp.o
[ 81%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/Packaging.cpp.o
[ 84%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/qrc_mainwindow.cpp.o
[ 87%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/heimdall-frontend_autogen/mocs_compilation.cpp.o
[ 90%] Linking CXX executable ../bin/heimdall-frontend.app/Contents/MacOS/heimdall-frontend
[100%] Built target heimdall-frontend

@1ultimat3
Copy link

Doesn't work for me either...

@d3v-null
Copy link
Author

d3v-null commented Oct 26, 2017

Hey @johnny13 ,
Looks like my repo was indeed on the very latest version in GitHub, it's just a more recent commit than yours:

git show
commit 9bcc42da350bd2e1766980bcb77d806a82d56a1d (HEAD -> master, origin/master, origin/HEAD)
Merge: 3b4f34e cc44b34
Author: Benjamin Dobell <[email protected]>
Date:   Wed Sep 20 12:05:45 2017 +1000

    Merge pull request #408 from grayed/master

    Use library found instead of hardcoding compiler flag.

cat heimdall/source/Interface.cpp | grep 'version ='
const char *version = "v1.4.2";
cat heimdall-frontend/aboutform.ui| grep Version
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Version 1.4.2&lt;/p&gt;

The only difference between between our cmake outputs is that yours said -- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.8") so i ran brew install zlib and tried your make command:

cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DQt5Widgets_DIR=/usr/local/opt/qt5/lib/cmake/Qt5Widgets ..
-- The C compiler identification is AppleClang 9.0.0.9000037
-- The CXX compiler identification is AppleClang 9.0.0.9000037
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found libusb: /usr/local/lib/libusb-1.0.a
-- Checking if large (64-bit) file support is available...
-- Checking if large (64-bit) file support is available - yes
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.11")
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/derwent/GitHub/Heimdall/build

The only difference now is that mine says found version "1.2.11" instead of 1.2.8.
However make still fails:

Scanning dependencies of target pit
[  3%] Building CXX object libpit/CMakeFiles/pit.dir/source/libpit.cpp.o
[  6%] Linking CXX static library libpit.a
[  6%] Built target pit
Scanning dependencies of target heimdall
[  9%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/Arguments.cpp.o
[ 12%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/BridgeManager.cpp.o
[ 15%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/ClosePcScreenAction.cpp.o
[ 18%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/DetectAction.cpp.o
[ 21%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/DownloadPitAction.cpp.o
[ 24%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/FlashAction.cpp.o
[ 27%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/HelpAction.cpp.o
[ 30%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/InfoAction.cpp.o
[ 33%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/Interface.cpp.o
[ 36%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/main.cpp.o
[ 39%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/PrintPitAction.cpp.o
[ 42%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/Utility.cpp.o
[ 45%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/VersionAction.cpp.o
[ 48%] Linking CXX executable ../bin/heimdall
Undefined symbols for architecture x86_64:
  "_CFDataGetBytes", referenced from:
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFDataGetLength", referenced from:
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFDataGetTypeID", referenced from:
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFGetTypeID", referenced from:
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _get_ioregistry_value_number in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFNumberGetTypeID", referenced from:
      _get_ioregistry_value_number in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFNumberGetValue", referenced from:
      _get_ioregistry_value_number in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRelease", referenced from:
      _darwin_close in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_release_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_kernel_driver_active in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _get_ioregistry_value_number in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRetain", referenced from:
      _darwin_open in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRunLoopAddSource", referenced from:
      _darwin_open in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_claim_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRunLoopGetCurrent", referenced from:
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRunLoopRemoveSource", referenced from:
      _darwin_close in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_release_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRunLoopRun", referenced from:
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRunLoopSourceCreate", referenced from:
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRunLoopSourceSignal", referenced from:
      _darwin_exit in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRunLoopStop", referenced from:
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFRunLoopWakeUp", referenced from:
      _darwin_exit in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFUUIDGetConstantUUIDWithBytes", referenced from:
      _darwin_claim_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_CFUUIDGetUUIDBytes", referenced from:
      _darwin_claim_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IOCreatePlugInInterfaceForService", referenced from:
      _darwin_claim_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IOIteratorNext", referenced from:
      _darwin_init in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_devices_detached in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_devices_attached in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_clear_iterator in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_get_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IOKitWaitQuiet", referenced from:
      _darwin_hotplug_poll in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IONotificationPortCreate", referenced from:
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IONotificationPortDestroy", referenced from:
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IONotificationPortGetRunLoopSource", referenced from:
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IOObjectRelease", referenced from:
      _darwin_init in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_claim_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_kernel_driver_active in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_devices_detached in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_devices_attached in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      ...
  "_IORegistryEntryCreateCFProperty", referenced from:
      _darwin_kernel_driver_active in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _get_ioregistry_value_number in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IORegistryEntryGetParentEntry", referenced from:
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IOServiceAddMatchingNotification", referenced from:
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IOServiceGetMatchingServices", referenced from:
      _darwin_init in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_IOServiceMatching", referenced from:
      _darwin_init in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "___CFConstantStringClassReference", referenced from:
      CFString in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      CFString in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      CFString in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      CFString in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      CFString in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_kCFAllocatorDefault", referenced from:
      _darwin_kernel_driver_active in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _get_ioregistry_value_number in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_kCFAllocatorSystemDefault", referenced from:
      _process_new_device in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_kCFRunLoopCommonModes", referenced from:
      _darwin_open in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_kCFRunLoopDefaultMode", referenced from:
      _darwin_close in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_claim_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_release_interface in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
  "_kIOMasterPortDefault", referenced from:
      _darwin_init in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_hotplug_poll in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
      _darwin_event_thread_main in libusb-1.0.a(libusb_1_0_la-darwin_usb.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/heimdall] Error 1
make[1]: *** [heimdall/CMakeFiles/heimdall.dir/all] Error 2
make: *** [all] Error 2

So I pulled the exact revision that was released as v1.4.2, and got a bit further than previously:

git checkout 699549e3c661e868656147cdad35189469198f4d
git show
commit 699549e3c661e868656147cdad35189469198f4d (HEAD, tag: v1.4.2)
Author: Benjamin Dobell <[email protected]>
Date:   Fri May 12 02:54:43 2017 +1000

    Bumped version to 1.4.2

Cleared build and re-ran the cmake and make commands

rm -rf build
mkcd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DQt5Widgets_DIR=/usr/local/opt/qt5/lib/cmake/Qt5Widgets ..
-- The C compiler identification is AppleClang 9.0.0.9000037
-- The CXX compiler identification is AppleClang 9.0.0.9000037
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found libusb: /usr/local/lib/libusb-1.0.a
-- Checking if large (64-bit) file support is available...
-- Checking if large (64-bit) file support is available - yes
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.11")
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/derwent/GitHub/Heimdall/build
LIBRARY_PATH=/usr/local/lib make
Scanning dependencies of target pit
[  3%] Building CXX object libpit/CMakeFiles/pit.dir/source/libpit.cpp.o
[  6%] Linking CXX static library libpit.a
[  6%] Built target pit
Scanning dependencies of target heimdall
[  9%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/Arguments.cpp.o
[ 12%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/BridgeManager.cpp.o
[ 15%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/ClosePcScreenAction.cpp.o
[ 18%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/DetectAction.cpp.o
[ 21%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/DownloadPitAction.cpp.o
[ 24%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/FlashAction.cpp.o
[ 27%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/HelpAction.cpp.o
[ 30%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/InfoAction.cpp.o
[ 33%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/Interface.cpp.o
[ 36%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/main.cpp.o
[ 39%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/PrintPitAction.cpp.o
[ 42%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/Utility.cpp.o
[ 45%] Building CXX object heimdall/CMakeFiles/heimdall.dir/source/VersionAction.cpp.o
[ 48%] Linking CXX executable ../bin/heimdall
[ 48%] Built target heimdall
Scanning dependencies of target heimdall-frontend_autogen
[ 51%] Generating qrc_mainwindow.cpp
RCC: Warning: No resources in '/Users/derwent/GitHub/Heimdall/heimdall-frontend/mainwindow.qrc'.
[ 54%] Generating ui_mainwindow.h
[ 57%] Generating ui_aboutform.h
[ 60%] Automatic MOC for target heimdall-frontend
Generating MOC source CAWN4ZDDTK/moc_aboutform.cpp
Generating MOC source CAWN4ZDDTK/moc_mainwindow.cpp
Generating MOC compilation mocs_compilation.cpp
[ 60%] Built target heimdall-frontend_autogen
Scanning dependencies of target heimdall-frontend
[ 63%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/aboutform.cpp.o
[ 66%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/Alerts.cpp.o
[ 69%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/FirmwareInfo.cpp.o
[ 72%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/main.cpp.o
[ 75%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/mainwindow.cpp.o
[ 78%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/PackageData.cpp.o
[ 81%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/source/Packaging.cpp.o
[ 84%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/qrc_mainwindow.cpp.o
[ 87%] Building CXX object heimdall-frontend/CMakeFiles/heimdall-frontend.dir/heimdall-frontend_autogen/mocs_compilation.cpp.o
In file included from /Users/derwent/GitHub/Heimdall/build/heimdall-frontend/heimdall-frontend_autogen/mocs_compilation.cpp:2:
/Users/derwent/GitHub/Heimdall/build/heimdall-frontend/heimdall-frontend_autogen/CAWN4ZDDTK/moc_aboutform.cpp:9:10: fatal error:
      '../../../../../../Documents/GitHub/Heimdall/heimdall-frontend/source/aboutform.h' file not found
#include "../../../../../../Documents/GitHub/Heimdall/heimdall-frontend/source/aboutform.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [heimdall-frontend/CMakeFiles/heimdall-frontend.dir/heimdall-frontend_autogen/mocs_compilation.cpp.o] Error 1
make[1]: *** [heimdall-frontend/CMakeFiles/heimdall-frontend.dir/all] Error 2
make: *** [all] Error 2

However I am able to make with -DDISABLE_FRONTEND=ON on this version.

It seems like commit cc44b34 #408 breaks the linking stage for my system, any thoughts @Benjamin-Dobell @grayed ?

Thanks.

TL;DR: If you are on the latest commit of heimdall and your cmake output looks like this, checkout a previous version of heimdall and try building that.

git checkout 699549e3c661e868656147cdad35189469198f4d

@mateuszk87

@Fimagena
Copy link

Fimagena commented Nov 5, 2017

Had the same issue. The problem is not libusb itself but that it requires the CoreFoundation and IOKit frameworks that are not explicitly linked in.

There might be better ways to fix this (I'm not a Mac expert) but adding the below to the heimdall/CMakeLists.txt file worked for me

find_library(CF CoreFoundation)
find_library(IOK IOKit)
target_link_libraries(heimdall ${CF} ${IOK})

@gaellalire
Copy link

Same problem.
Solved by adding the below in heimdall/CMakeLists.txt

set(CMAKE_EXE_LINKER_FLAGS "-lobjc -framework IOKit -framework CoreFoundation")

Same solution as the @Fimagena one except I don't see how it can found -lobjc

@etweek
Copy link

etweek commented Mar 15, 2023

For anyone coming from Mojave, you now need to add Security too:
Near the top of heimdall/CMakeLists.txt:

find_package(libusb REQUIRED)
find_library(CF CoreFoundation)
find_library(IOK IOKit)
find_library(Security Security)

(i.e. add three lines to the existing libusb)
and near the bottom:

target_link_libraries(heimdall PRIVATE pit)
target_link_libraries(heimdall PRIVATE ${LIBUSB_LIBRARY})
target_link_libraries(heimdall objc ${CF} ${IOK} ${Security})

(last line new)

and then it compiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants