rust 铍板条箱未与项目链接,与cc链接失败

qlzsbp2j  于 2023-01-09  发布在  其他
关注(0)|答案(1)|浏览(160)

你好!
我一直在尝试编译一个OpenGL示例here,到目前为止,我一直在为最新的包版本移植示例。当我最终让编译器关闭并编译后,它...没有。

Compiling opengl v0.1.0 (/Users/bigman/Documents/opengl)
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-arch" "x86_64" "-m64" "/var/folders/_r/9h8y938x3sg8w8b166093cs80000gn/T/rustci5KJn3/symbols.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.1ye1bh57tl7zwblh.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.24ksglsqx5rix926.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.291ok3682qh06hja.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.33z1skr6iqu8mbxb.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.38g2rrnpesnwgk95.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.3dv7y4ie77c06eqw.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.3hlgmoupo7y0kfhn.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.3lecw8r4d8y9axm2.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.3mrt3h0y3kgfh006.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.3oxo7uzbm3qux25k.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.3pqmue6qalow8zr9.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.3uzvg2nicxsjyep9.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.41bs2mv4e9wtcbgo.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.43afu5uumcmka4ic.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.44mtky39l5jzsr9i.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.455c1yk83a9oeqej.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.49r8a6nlb1g6vom3.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.4ezvw5th29zf5cpw.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.4jpjakefwnichr47.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.4kjqxmdte2xy5450.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.4sgn75x4qpoaggdo.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.4ydskd6napf3o51l.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.536cy7o3hg4e6s38.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.92rmk9kos8hokgj.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.hr1sotk548uazdt.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.r1mkhnlzeny8r1v.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.rw9csuwauqq65d2.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.uv8c0r69zj37m2.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.vmhgwd12iwpksl9.rcgu.o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305.8rq7vsh59v1xpht.rcgu.o" "-L" "/Users/bigman/Documents/opengl/target/debug/deps" "-L" "/Users/bigman/Documents/opengl/target/debug/build/fermium-953d7e0bee78aaf7/out/lib" "-L" "/Users/bigman/Documents/opengl/target/debug/build/fermium-953d7e0bee78aaf7/out/lib" "-L" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/bigman/Documents/opengl/target/debug/deps/libberyllium-93904a5340d5d2fd.rlib" "/Users/bigman/Documents/opengl/target/debug/deps/libobjc-8a13ac3baf316bfb.rlib" "/Users/bigman/Documents/opengl/target/debug/deps/libmalloc_buf-1279be4a0da6202c.rlib" "/Users/bigman/Documents/opengl/target/debug/deps/liblibc-5e4822d31cf10f76.rlib" "/Users/bigman/Documents/opengl/target/debug/deps/libzstring-7f162cbda9b29001.rlib" "/Users/bigman/Documents/opengl/target/debug/deps/libtinyvec-d72ce2389dfaa142.rlib" "/Users/bigman/Documents/opengl/target/debug/deps/libbytemuck-dac07b5acce9e3b9.rlib" "/Users/bigman/Documents/opengl/target/debug/deps/libfermium-36aa956babba2f91.rlib" "/Users/bigman/Documents/opengl/target/debug/deps/libchlorine-fdebb138e2bae085.rlib" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-c047ccf37d2c9989.rlib" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-479f6a3646fc9c2c.rlib" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libobject-7a5dbda4659854de.rlib" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libmemchr-21db3783f16058ed.rlib" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-bc1dcfa1ffab2652.rlib" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgimli-326c2fed02a024e2.rlib" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-6cee2d8aed290e33.rlib" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_detect-abe3d83fb53f6790.rlib" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-a3d322fe643d1a33.rlib" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libminiz_oxide-796c0979aa0619c8.rlib" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libadler-45c554f893d47cc8.rlib" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-5de68974b16fa161.rlib" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-8fce473cc391b0d7.rlib" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-e12825695dbeadf4.rlib" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-890e623f71562a92.rlib" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-0ba1002b3e9972f6.rlib" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-1bf2f523c1bee03d.rlib" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-d0a8c087921eb265.rlib" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-403189210ce7ce14.rlib" "-lobjc" "-liconv" "-framework" "Foundation" "-framework" "AVFoundation" "-framework" "AudioToolbox" "-framework" "CoreAudio" "-framework" "Carbon" "-framework" "ForceFeedback" "-framework" "IOKit" "-framework" "Cocoa" "-framework" "CoreVideo" "-liconv" "-lm" "-framework" "CoreHaptics" "-framework" "QuartzCore" "-framework" "Metal" "-framework" "GameController" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv" "-L" "/Users/bigman/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/Users/bigman/Documents/opengl/target/debug/deps/opengl-cf90588a3409e305" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: Undefined symbols for architecture x86_64:
            "_OBJC_CLASS_$_GCColor", referenced from:
                objc-class-ref in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputDualShockTouchpadTwo", referenced from:
                _IOS_MFIJoystickUpdate in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCHapticsLocalityHandles", referenced from:
                _IOS_JoystickGetCapabilities in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCHapticsLocalityTriggers", referenced from:
                _IOS_JoystickGetCapabilities in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputRightTrigger", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForAxis in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputLeftThumbstick", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForAxis in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputRightThumbstick", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForAxis in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputButtonA", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForButton in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputLeftTrigger", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForAxis in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputButtonX", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForButton in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputDualShockTouchpadOne", referenced from:
                _IOS_MFIJoystickUpdate in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputButtonB", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForButton in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputButtonHome", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForButton in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputButtonMenu", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForButton in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputButtonY", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForButton in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCHapticsLocalityLeftTrigger", referenced from:
                _IOS_JoystickInitRumble in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCHapticsLocalityRightTrigger", referenced from:
                _IOS_JoystickInitRumble in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputButtonOptions", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForButton in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputLeftShoulder", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForButton in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputRightThumbstickButton", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForButton in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCHapticsLocalityLeftHandle", referenced from:
                _IOS_JoystickInitRumble in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCHapticsLocalityRightHandle", referenced from:
                _IOS_JoystickInitRumble in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputXboxPaddleOne", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForButton in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
                _IOS_AddJoystickDevice in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
                _IOS_MFIJoystickUpdate in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputXboxPaddleFour", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForButton in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
                _IOS_AddJoystickDevice in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
                _IOS_MFIJoystickUpdate in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputDualShockTouchpadButton", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForButton in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
                _IOS_AddJoystickDevice in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
                _IOS_MFIJoystickUpdate in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "___isPlatformVersionAtLeast", referenced from:
                -[SDL_RumbleMotor cleanup] in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
                -[SDL_RumbleMotor setIntensity:] in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
                _IOS_GameControllerGetAppleSFSymbolsNameForButton in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
                _IOS_GameControllerGetAppleSFSymbolsNameForAxis in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
                _IOS_JoystickInit in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
                _IOS_JoystickOpen in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
                _IOS_JoystickRumble in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
                ...
            "_GCInputXboxPaddleTwo", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForButton in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
                _IOS_AddJoystickDevice in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
                _IOS_MFIJoystickUpdate in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCHapticDurationInfinite", referenced from:
                -[SDL_RumbleMotor setIntensity:] in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputRightShoulder", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForButton in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputLeftThumbstickButton", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForButton in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
            "_GCInputXboxPaddleThree", referenced from:
                _IOS_GameControllerGetAppleSFSymbolsNameForButton in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
                _IOS_AddJoystickDevice in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
                _IOS_MFIJoystickUpdate in libfermium-36aa956babba2f91.rlib(SDL_mfijoystick.m.o)
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: could not compile `opengl` due to previous error

我甚至还没有真正实现OpenGL,我只是想让SDL2来创建一个窗口; w;
这是我的密码,也许我漏掉了什么?

use beryllium::{ window, init, gl_window };
use zstring::zstr;

fn main() {
    let sdl = init::Sdl::init(init::InitFlags::EVERYTHING).expect("couldn't start SDL");

    sdl.gl_set_attribute(gl_window::GlAttr::MajorVersion, 3).unwrap();
    sdl.gl_set_attribute(gl_window::GlAttr::MinorVersion, 3).unwrap();
    sdl.gl_set_attribute(gl_window::GlAttr::Profile, 1).unwrap();

    let _win = sdl
    .create_gl_window(
        zstr!("Hello Window"),
        None,
        (800, 600),
        window::WindowFlags::OPENGL,
    )
    .expect("couldn't make a window and context");

}

我使用的是beryllium机箱,没有使用任何SDL2的控制器绑定(我想这就是编译器在喊什么?)我在MacOS Catalina上编译,我确实读到过OpenGL的MacOS实现没有FORWARD_COMPATIBLE标志会很麻烦,但OpenGL不应该与项目链接,因为它不是use d,对吗?即使这样,它仍然不应该破坏编译过程。我不是编译Maven,任何帮助都将不胜感激!

n53p2ov0

n53p2ov01#

我正在学习一个教程,建议在MacOs上编译时添加 #[cfg(target_os =“macos”)] 标记。该标记是在指定向前兼容性标志时设置的,您没有这样做,因为我假设您不希望包含库中任何已弃用的部分。但我会尝试在第10行设置该标记,就在您设置OpenGL属性的位置下面
教程链接:https://rust-tutorials.github.io/learn-opengl/basics/000-creating-a-window.html

相关问题