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

imgui: compile imgui project occur link issue of 'undefined reference to glClear' #3411

Open
Sunrisepeak opened this issue Mar 4, 2024 · 3 comments
Labels

Comments

@Sunrisepeak
Copy link

Sunrisepeak commented Mar 4, 2024

Xmake 版本

2.8.7

操作系统版本和架构

Ubuntu22.04

描述问题

真实问题出现在 我自己的项目KHistory上(xmake.lua)
老电脑上使用 xmake v2.7.3可以正常构建,新安装的ubuntu22.04, 使用 xmake v2.8.7 会出现 opengl 相关的问题

最后发现编译 imgui-scaffold示例也会出现问题

sudo add-apt-repository ppa:xmake-io/xmake
sudo apt-get update
sudo apt-get install g++ gdb xmake make git -y

image

期待的结果

imgui-scaffold 可以正常构建

工程配置

https://github.com/xmake-examples/imgui-scaffold

附加信息和错误日志

目前通过 安装mesa-common-dev, 并且在xmake.lua 中加 add_links("GL") 可以正常编译

sudo apt-get install mesa-common-dev

可能的原因 glfw 没有加 gl链接吗?

add_syslinks("dl", "pthread")

@Sunrisepeak Sunrisepeak added the bug label Mar 4, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: imgui-scaffold: Using xmake to compile projects that depend on imgui lacks opengl Related header file links

Xmake version

2.8.7

Operating system version and architecture

Ubuntu22.04

Describe the problem

Newly installed ubuntu22.04, after configuring the following environment, there is a problem when compiling the example imgui-scaffold
https://github.com/xmake-examples/imgui-scaffold

sudo add-apt-repository ppa:xmake-io/xmake
sudo apt-get update
sudo apt-get install g++ gdb xmake make git -y

image

Expected results

imgui-scaffold

Project configuration

https://github.com/xmake-examples/imgui-scaffold

Additional information and error logs

Currently, mesa-common-dev is installed and can be compiled normally by adding add_links("GL") to xmake.lua

sudo apt-get install mesa-common-dev

The possible reason is that glfw does not add gl link?

add_syslinks("dl", "pthread")

@Sunrisepeak Sunrisepeak changed the title imgui-scaffold: 使用xmake编译依赖imgui的项目缺少opengl相关头文件链接 imgui-scaffold: 使用xmake编译依赖imgui的项目缺少opengl相关头文件&链接失败 Mar 4, 2024
@c8ef
Copy link
Member

c8ef commented Mar 5, 2024

The config in imgui-scaffold seems deprecated, maybe enable this config and try again?

@Sunrisepeak
Copy link
Author

The config in imgui-scaffold seems deprecated, maybe enable this config and try again?

the glfw_opengl3 configs is kept for backwards compatibility, script auto config 'glfw' & 'opengl3' in L86 of xmake.lua

add_requires("imgui 1.88", {configs = {glfw_opengl3 = true}})

if package:config("glfw_opengl3") then

its more of a link issue

image

@Sunrisepeak Sunrisepeak changed the title imgui-scaffold: 使用xmake编译依赖imgui的项目缺少opengl相关头文件&链接失败 imgui: compile imgui project occur link issue of 'undefined reference to glClear' Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants