skift-org / skift

🥑 A modern delightful operating system
https://skiftos.org/
GNU Lesser General Public License v3.0
2.33k stars 128 forks source link

Invalid order of dependencies #400

Closed simonjriddix closed 1 year ago

simonjriddix commented 1 year ago

clang++-14 -o .cutekit/build/host-x86_64-2d6f32c7/hello-world/bin/hello-world.out .cutekit/build/host-x86_64-2d6f32c7/hello-world/obj/main.cpp.o .cutekit/build/host-x86_64-2d6f32c7/karm-main/lib/karm-main.a .cutekit/build/host-x86_64-2d6f32c7/karm-cli/lib/karm-cli.a .cutekit/build/host-x86_64-2d6f32c7/karm-sys/lib/karm-sys.a .cutekit/build/host-x86_64-2d6f32c7/impl-posix/lib/impl-posix.a .cutekit/build/host-x86_64-2d6f32c7/karm-fmt/lib/karm-fmt.a .cutekit/build/host-x86_64-2d6f32c7/karm-text/lib/karm-text.a .cutekit/build/host-x86_64-2d6f32c7/karm-io/lib/karm-io.a .cutekit/build/host-x86_64-2d6f32c7/karm-base/lib/karm-base.a .cutekit/build/host-x86_64-2d6f32c7/impl-posix/lib/impl-posix.a .cutekit/build/host-x86_64-2d6f32c7/karm-meta/lib/karm-meta.a .cutekit/build/host-x86_64-2d6f32c7/stdc-math-host/lib/stdc-math-host.a .cutekit/build/host-x86_64-2d6f32c7/stdc-ansi-host/lib/stdc-ansi-host.a .cutekit/build/host-x86_64-2d6f32c7/stdcpp-host/lib/stdcpp-host.a .cutekit/build/host-x86_64-2d6f32c7/stdc-ansi-host/lib/stdc-ansi-host.a -lSDL2 /usr/bin/ld: .cutekit/build/host-x86_64-2d6f32c7/impl-posix/lib/impl-posix.a(sys.cpp.o): in functionKarm::Sys::_Embed::resolve(Karm::Sys::Url)': sys.cpp:(.text+0x22b): undefined reference to Karm::Sys::Path::parse(Karm::_Str<Karm::Utf8, char>, bool)' /usr/bin/ld: sys.cpp:(.text+0x263): undefined reference toKarm::Sys::Path::join(Karm::_Str<Karm::Utf8, char>) const' /usr/bin/ld: sys.cpp:(.text+0x297): undefined reference to Karm::Sys::Path::join(Karm::_Str<Karm::Utf8, char>) const' /usr/bin/ld: sys.cpp:(.text+0x2b1): undefined reference toKarm::Sys::Path::join(Karm::Sys::Path const&) const' /usr/bin/ld: .cutekit/build/host-x86_64-2d6f32c7/impl-posix/lib/impl-posix.a(sys.cpp.o): in function Karm::Sys::_Embed::openFile(Karm::Sys::Url)': sys.cpp:(.text+0x6cf): undefined reference toKarm::Sys::Path::str() const' /usr/bin/ld: .cutekit/build/host-x86_64-2d6f32c7/impl-posix/lib/impl-posix.a(sys.cpp.o): in function Karm::Sys::_Embed::readDir(Karm::Sys::Url)': sys.cpp:(.text+0xd8b): undefined reference toKarm::Sys::Path::str() const' /usr/bin/ld: .cutekit/build/host-x86_64-2d6f32c7/impl-posix/lib/impl-posix.a(sys.cpp.o): in function Karm::Sys::_Embed::createFile(Karm::Sys::Url)': sys.cpp:(.text+0x170f): undefined reference toKarm::Sys::Path::str() const' /usr/bin/ld: .cutekit/build/host-x86_64-2d6f32c7/impl-posix/lib/impl-posix.a(sys.cpp.o): in function Karm::Sys::_Embed::populate(Karm::Sys::UserInfo&)': sys.cpp:(.text+0x33f9): undefined reference toKarm::Sys::Path::parse(Karm::_Str<Karm::Utf8, char>, bool)' /usr/bin/ld: sys.cpp:(.text+0x3484): undefined reference to Karm::Sys::Path::parse(Karm::_Str<Karm::Utf8, char>, bool)' clang: error: linker command failed with exit code 1 (use -v to see invocation)

There seems to be a dependency problem, the impl-posix.a library should be called before karm-sys.a

simonjriddix commented 1 year ago

I fixed it by uninstalling clang 14 and older, reinstalled clang-15 and its dependencies, cleaned and recompiled and woilà! For Ubuntu 22.04 users remove all old packages and issue the following command:

sudo apt install clang-15 llvm-15 llvm-15-dev llvm-15-linker-tools llvm-15-tools libc++abi1-15 libc++abi-15-dev libc++1-15 lld-15 libstdc++-12-dev

then inside the project root folder give cute kit clean cutekit build -all cutekit start

I hope it can help you too :-D