xmake生成wxWidgets工程下载repo #6583
Replies: 3 comments 6 replies
-
xrepo info
xrepo 是 cli, xmake-repo 是中心包仓库
部分有镜像,具体看 xmake-repo 对应包的 urls 配置。这边不会提供存储服务,包本身如果有提供官方镜像源,就可以配上去,没有那就是没有 |
Beta Was this translation helpful? Give feedback.
-
谢谢, 刚刚能把wxWidgets的package下载下来了。我也看到在~/.xmake/cache里面有下载下来的压缩包。
我也查看了
这个应该怎么解决。 谢谢 |
Beta Was this translation helpful? Give feedback.
-
我已经发到xmake-repo那边了。 然而,我的电脑上本身安装了wxWidgets在 我用下面的command,可以成功的编译运行 g++ main.cpp `wx-config --cxxflags --libs` -o hello
./hello 这证明我的环境是没有问题的。 而 -I/opt/wxWidgets/lib/wx/include/gtk3-unicode-3.3 -I/opt/wxWidgets/include/wx-3.3 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread
-L/opt/wxWidgets/lib -pthread -lwx_gtk3u_xrc-3.3 -lwx_gtk3u_html-3.3 -lwx_gtk3u_qa-3.3 -lwx_gtk3u_core-3.3 -lwx_baseu_xml-3.3 -lwx_baseu_net-3.3 -lwx_baseu-3.3 根据这些信息,我将lua文件改成下面的样子 add_rules("mode.debug", "mode.release")
--add_requires("wxwidgets")
target("haha")
set_kind("binary")
add_files("src/*.cpp")
set_languages("c++")
-- set_toolchains("g++")
-- add_packages("wxwidgets")
--
-- If you want to known more usage about xmake, please see https://xmake.io
--
-- ## FAQ
--
-- You can enter the project directory firstly before building project.
--
-- $ cd projectdir
--
-- 1. How to build project?
--
-- $ xmake
--
-- 2. How to configure project?
--
-- $ xmake f -p [macosx|linux|iphoneos ..] -a [x86_64|i386|arm64 ..] -m [debug|release]
--
-- 3. Where is the build output directory?
--
-- The default output directory is `./build` and you can configure the output directory.
--
-- $ xmake f -o outputdir
-- $ xmake
--
-- 4. How to run and debug target after building project?
--
-- $ xmake run [targetname]
-- $ xmake run -d [targetname]
--
-- 5. How to install target to the system directory or other output directory?
--
-- $ xmake install
-- $ xmake install -o installdir
--
-- 6. Add some frequently-used compilation flags in xmake.lua
--
-- @code
-- -- add debug and release modes
-- add_rules("mode.debug", "mode.release")
--
-- -- add macro definition
-- add_defines("NDEBUG", "_GNU_SOURCE=1")
--
-- -- set warning all as error
-- set_warnings("all", "error")
--
-- -- set language: c99, c++11
-- set_languages("c99", "c++11")
--
-- -- set optimization: none, faster, fastest, smallest
-- set_optimize("fastest")
--
-- -- add include search directories
add_includedirs("/opt/wxWidgets/include/wx-3.3/", "/opt/wxWidgets/lib/wx/include/gtk3-unicode-3.3/")
--
-- -- add link libraries and search directories
add_links("wx_gtk3u_xrc-3.3", "wx_gtk3u_html-3.3", "wx_gtk3u_qa-3.3", "wx_gtk3u_core-3.3", "wx_baseu_xml-3.3", "wx_baseu_net-3.3", "wx_baseu-3.3")
add_linkdirs("/opt/wxWidgets/lib/")
--
-- -- add system link libraries
-- add_syslinks("z", "pthread")
--
-- -- add compilation and link flags
add_cxflags("-D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread")
add_ldflags("-pthread")
--
-- @endcode
--
但是,我运行 usr/bin/gcc -c -m32 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -I/opt/wxWidgets/include/wx-3.3 -I/opt/wxWidgets/lib/wx/include/gtk3-unicode-3.3 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -DNDEBUG -o build/.objs/haha/linux/i386/release/src/main.cpp.o src/main.cpp
error: @programdir/core/main.lua:329: @programdir/actions/build/main.lua:146: @programdir/modules/async/runjobs.lua:331: @programdir/modules/private/action/build/object.lua:100: @programdir/modules/core/tools/gcc.lua:1035: In file included from /opt/wxWidgets/include/wx-3.3/wx/object.h:23,
from /opt/wxWidgets/include/wx-3.3/wx/wx.h:14,
from src/main.cpp:1:
/opt/wxWidgets/include/wx-3.3/wx/string.h:242:15: error: ‘wxUniChar wxCStrData::operator[](unsigned int) const’ cannot be overloaded with ‘wxUniChar wxCStrData::operator[](size_t) const’
242 | wxUniChar operator[](unsigned int n) const { return operator[](size_t(n)); }
| ^~~~~~~~
/opt/wxWidgets/include/wx-3.3/wx/string.h:238:22: note: previous declaration ‘wxUniChar wxCStrData::operator[](size_t) const’
238 | inline wxUniChar operator[](size_t n) const;
| ^~~~~~~~
/opt/wxWidgets/include/wx-3.3/wx/string.h:1563:15: error: ‘wxUniChar wxString::operator[](unsigned int) const’ cannot be overloaded with ‘wxUniChar wxString::operator[](size_t) const’
1563 | wxUniChar operator[](unsigned int n) const
| ^~~~~~~~
/opt/wxWidgets/include/wx-3.3/wx/string.h:1560:15: note: previous declaration ‘wxUniChar wxString::operator[](size_t) const’
1560 | wxUniChar operator[](size_t n) const
| ^~~~~~~~
/opt/wxWidgets/include/wx-3.3/wx/string.h:1575:18: error: ‘wxUniCharRef wxString::operator[](unsigned int)’ cannot be overloaded with ‘wxUniCharRef wxString::operator[](size_t)’
1575 | wxUniCharRef operator[](unsigned int n)
| ^~~~~~~~
/opt/wxWidgets/include/wx-3.3/wx/string.h:1572:18: note: previous declaration ‘wxUniCharRef wxString::operator[](size_t)’
1572 | wxUniCharRef operator[](size_t n)
| ^~~~~~~~
可以看到编译的option是
和编译成功的option并不完全一样,用到了 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
hi,all,
我在linux下面,用vscode的xmake插件,生成了wxWidgets的工程,并且没有改动任何一行代码和配置(lua)。然后
xmake build
的时候,就要下载一堆repo:note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo:
-> nanosvg 2022.07.09 [from:wxwidgets, license:zlib]
-> meson 1.8.2 [host, from:libepoxy,gdk-pixbuf,libxkbcommon,gtk3,wayland,at-spi2-core,graphene,pango,glib,wayland-protocols,fontconfig,harfbuzz,cairo,pixman, license:Apache-2.0]
-> at-spi2-core 2.53.90 [from:wxwidgets,gtk3, license:LGPL-2.1]
-> libtiff v4.7.0 [from:wxwidgets,gdk-pixbuf]
-> wxwidgets 3.2.5
please input: y (y/n/m)
看样子是xmake-repo需要下载安装这些package
我的问题是
/usr/bin
?谢谢
Beta Was this translation helpful? Give feedback.
All reactions