我如何解决当前的OpenGL错误,我的CMakelist可能是我的问题

发布于 2025-01-25 12:45:20 字数 1490 浏览 2 评论 0 原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

海未深 2025-02-01 12:45:20

请提供更多详细信息,例如您相关的cmakelists.txt部分,以获取更多信息并从社区获得更快的帮助。

现在,进入错误日志,似乎您正在使用基于ARM的编译器对源文件进行交叉编译。

错误消息“ ld:scholdutection ARM64找不到的符号”将我视为一个链接器问题,您应该在find_package()和cmakelists.txt中的for OpenGL中使用find_package()和链接呼叫。

因此,首先,您应该最初遵循两个步骤,看看它是否解决了您的问题:

1。确保CMAKE构建系统指向纠正编译器工具链路径(此处的ARM编译器)。

请参阅CMAKE的官方网站:

2。确保您要链接OpenGL

find_package(opengl required)

target_include_directories(your_executable_name public $ {opentgl_include_dir})
target_link_libraries(your_executable_name public $ {OpenGl_libraries})

Please provide more details like your relevant section of CMakeLists.txt for getting more info and getting quicker help from community.

Now, coming to the error logs, it seems you are cross-compiling the source files using a arm-based compilers.

The error message "ld: symbol(s) not found for architecture arm64" looks to me as a linker issue and you should be having the find_package() and linking calls in CMakeLists.txt for OpenGL.

So to start with , you should follow two steps initially and see if it solves your problem:

1. Make sure the CMake build system is pointing to correct compiler tool chain path (arm compilers in here).

Refer official website of CMake for same:
https://cmake.org/cmake/help/book/mastering-cmake/chapter/Cross%20Compiling%20With%20CMake.html

2. Make sure you are linking OpenGL

find_package(OpenGL REQUIRED)

target_include_directories(your_executable_name PUBLIC ${OPENGL_INCLUDE_DIR})
target_link_libraries(your_executable_name PUBLIC ${OPENGL_LIBRARIES})

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文