-
-
Notifications
You must be signed in to change notification settings - Fork 773
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
GCC cannot find lua headers on Ubuntu #5179
Comments
you can disable system package. or open a pr to improve to find lua from system in xmake-repo. add https://github.com/xmake-io/xmake-repo/blob/dev/packages/l/lua/xmake.lua |
Hi @waruqi . Thank you for your suggestions. I'd be glad to help improve xmake-repo, but I'd need some time to dive into the code. |
@waruqi hello. I've finally returned to research this issue. I checked how CMake handles this, and they have an extensive search through different version folders and some heuristic for choosing the most relevant one. See here: https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/FindLua.cmake#L91 Here's the question for Xmake. Does it sound like Xmake's responsibility to automatically provide include directories to most relevant Lua version? Say, if a developer uses |
we can use pkgconfig to find it, and use if on_fetch return info with version, add and we can add more extsource for more linux os. e.g. But we need set correct package name for different package managers. maybe you can refer other packages in xmake-repo. |
xmake does correctly find Lua in the system. But it doesn't add correct include directory.
|
please do not use see:
|
Xmake Version
v2.8.7+20240401
Operating System Version and Architecture
Ubuntu 24.04 LTS x86_64
Describe Bug
I am trying to compile a simple program inside an Ubuntu Docker container, but the compiler cannot locate Lua header files.
All necessary packages for building are installed inside the container, including lua5.1 and liblua5.1-dev. xmake is installed as instructed on the website. Here is the .Dockerfile contents. If you're not familiar with Docker, it's basically taking latest headless Ubuntu distribution as a base system and runs the commands between ALL_RUN ... ALL_RUN.
What I end up is a command line version of Ubuntu with xmake, gcc and lua5.1 installed.
Then I try to build this simple program:
I've attached the error message as a screenshot. Searching for
lua.hpp
gives one result in/usr/include/lua5.1/lua.hpp
.So I suspect this has something to do with the header being inside a version folder and that folder is not passed to the compiler as include directory.
Is it an xmake bug where it fails to provide proper include directories? Or is it a known Ubuntu+Lua feature, that requires special treatment? Btw, same thing happens on Debian. Am I doing something wrong here?
I'd appreciate any help.
Expected Behavior
The program is built correctly with
xmake -v luatest
Project Configuration
Additional Information and Error Logs
The text was updated successfully, but these errors were encountered: