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

[BUG] dyld[12869]: Symbol not found #11

Closed
FelixKLG opened this issue Dec 1, 2022 · 16 comments
Closed

[BUG] dyld[12869]: Symbol not found #11

FelixKLG opened this issue Dec 1, 2022 · 16 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@FelixKLG
Copy link

FelixKLG commented Dec 1, 2022

# System Information

  • OS: MacOS Ventura 13.0.1 (22A400)
  • Version: 3.3.5
  • Shell (Windows-Only): N/A

# Bug Description

Expectation:
Application to run

Occured:
Symbol not found error

Terminal Output:
https://app.warp.dev/block/gWnBoFiwufKHpgeHIxsPOB

# Reproduction Steps

Download latest release on MacOS (M1 Max)
Unzip and run executable
Oberseve Error

I feel this error is likely caused by the new Apple M1 Arm64 architecture.

@FelixKLG FelixKLG added the bug Something isn't working label Dec 1, 2022
@radj307
Copy link
Owner

radj307 commented Dec 2, 2022

Looking into this.

Edit:

It doesn't seem like its currently possible to compile for ARM64 with github actions: actions/runner-images#5631
Unfortunately that means I don't actually have any way to (legally) compile & distribute for MacOS ARM64 architecture since I don't have access to a machine with that architecture. You can compile it yourself on that machine, however.

related: https://www.pantsbuild.org/v2.12/docs/ci-for-macos-on-arm64

@radj307 radj307 removed their assignment Dec 2, 2022
@FelixKLG
Copy link
Author

FelixKLG commented Dec 2, 2022

I have cloned the repo locally however, I am not too familiar with C++ (and GCC/make) which means I have no real idea how to work around this error.

https://app.warp.dev/block/EgkrtquOeZicqYPl7R1eaO

I CD'd into the repo, and ran make.

@radj307
Copy link
Owner

radj307 commented Dec 2, 2022

The log that you posted mentioned a failure to resolve a symbol from /usr/lib/libstdc++.6.dylib; that likely means that you're missing the libstdc++6 library. Do you have that installed and in the correct location?

Assuming that your device's commandline is similar to debian linux, run this command (or some variation of it) sudo apt-get install libstdc++6 -y from a terminal and try it again.

@radj307
Copy link
Owner

radj307 commented Dec 2, 2022

I have cloned the repo locally however, I am not too familiar with C++ (and GCC/make) which means I have no real idea how to work around this error.

https://app.warp.dev/block/EgkrtquOeZicqYPl7R1eaO

I CD'd into the repo, and ran make.

Follow this guide to build from source: https://github.com/radj307/ARRCON/wiki/Building-from-Source
Judging by the rest of your log though, I'm going to fix the noted compilation errors in case that doesn't work.

@radj307 radj307 closed this as completed in d6e9473 Dec 2, 2022
@radj307 radj307 reopened this Dec 2, 2022
radj307 added a commit to radj307/307lib that referenced this issue Dec 2, 2022
@radj307

This comment was marked as outdated.

@FelixKLG
Copy link
Author

FelixKLG commented Dec 2, 2022

running make spits out the following errors:
https://app.warp.dev/block/8overa0nrOVmK8YxpMzW4Y

I deleted my local clone and re-cloned it so this is on the latest commit.

@radj307
Copy link
Owner

radj307 commented Dec 2, 2022

I've implemented a fix for those errors as well in efe4feb; sorry for the delay.

Let me know if any more issues spring up.

@FelixKLG
Copy link
Author

FelixKLG commented Dec 3, 2022

Compilation went further than last time however, I still ran into the same issue and then some other ones.
https://app.warp.dev/block/HudSsAadAIN7cGeOqS3N9H

@radj307
Copy link
Owner

radj307 commented Dec 3, 2022

What version of gcc do you have? (Run gcc --version)

@radj307
Copy link
Owner

radj307 commented Dec 3, 2022

Also, can you confirm that the original bug still occurs when libstdc++6 is installed?

@FelixKLG
Copy link
Author

FelixKLG commented Dec 3, 2022

GCC/G++:
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I also somewhat under the belief that libstdc++6 is installed. (Due to my XCode install)

@radj307
Copy link
Owner

radj307 commented Dec 3, 2022

You aren't actually using GCC, you're using Apple clang (it doesn't have all of the features from C++20 implemented yet).
ARRCON is written using C++20, so you'll need a compiler that supports that (gcc version 10 or newer).

Here's a guide on installing gcc/g++ with xcode: https://www.cyberciti.biz/faq/howto-apple-mac-os-x-install-gcc-compiler/
That guide is for OS X Mountain Lion but hopefully it'll be transferable.


Regarding libstdc++; Apple clang's implementation uses the libc++ standard library instead of the usual libstdc++ provided by gcc.

Installing gcc 10 or newer should fix the problem.
I'm sorry I can't be of more help since I don't own a mac to test this on.

@radj307
Copy link
Owner

radj307 commented Dec 3, 2022

I'm unfamiliar with apple's implementation of make, but that isn't the process that I use to build ARRCON in my build script so I figured I would elaborate on exactly what commands to run:

All of these commands are pulled directly from the CI script that compiles & creates github releases:
https://github.com/radj307/ARRCON/blob/main/.github/workflows/GenerateRelease.yml
The parts that are important for macOS can be summarized as follows:
(Requires cmake v3.22 or newer, ninja, & gcc-10 or newer)

git clone https://github.com/radj307/ARRCON && cd ARRCON
git submodule update --init --recursive
cmake -B "build" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++ -G Ninja
cmake --build "build" ---config Release

The executable is then retrieved from build/ARRCON/ARRCON

@FelixKLG
Copy link
Author

FelixKLG commented Dec 4, 2022

I am able to report after installing and linking GCC and G++ manually I was able to compile the code successfully.
image

A little run-down on the steps I had to take incase anyone else has similar issues:

  • Install XCode build tools (xcode-select --install)
  • Install Homebrew
  • Install gcc via homebrew (brew install gcc)
  • Link gcc and g++ to /usr/local/bin/ or add the install path to the PATH env var (If using Apple Silicon link the aarch64 versions)
  • Install ninja using brew (brew install ninja)
  • Install cmake using brew (brew install cmake)
  • Clone repo and run git submodules commands
  • Run above cmake commands
  • Now it works

@FelixKLG FelixKLG closed this as completed Dec 4, 2022
@radj307 radj307 added the good first issue Good for newcomers label Dec 4, 2022
@radj307
Copy link
Owner

radj307 commented Dec 4, 2022

Glad to hear that you got it working, and many thanks for the step-by-step guide!

@radj307
Copy link
Owner

radj307 commented Dec 4, 2022

The issue of required libraries not being included on new versions of macOS has been continued here: #12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants