我有一个 Grid ,其中包含 Frames 中的一些标签,使其看起来像一张桌子。这个网格被插入一个垂直的盒子中,其中直接子标签正确居中(它们以与网格相同的方式打包在盒子中)。
我的简化代码是这样的:
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
window = Gtk.Window()
g = Gtk.Grid() # this should be in the horizontal center of the window
g.attach(Gtk.Label("This should be centered but it is not."), 0, 0, 1, 1)
b = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
b.pack_start(g, True, False, 0) # The same behavior with: b.pack_start(g, True, True, 0)
b.pack_start(Gtk.Label("This label is centered as it should be. Try to resize the window."), True, False, 0)
window.add(b)
window.connect("delete-event", Gtk.main_quit)
window.show_all()
Gtk.main() …
Run Code Online (Sandbox Code Playgroud) 我正在通过教程学习使用 CMake:http : //derekmolloy.ie/hello-world-introductions-to-cmake/。我尝试使用 cmake 编译我的 hello_world.cpp,但我在 Windows 10 中的 MSys2 上收到此错误消息:
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
The CMAKE_C_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl …
Run Code Online (Sandbox Code Playgroud) 在中编译了应用程序后mingw-w64 64-bit Shell
,它在shell内the application was unable to start correctly (0xc00007b)
可以正常运行,但是在shell之外正常运行时会出现错误。
当抱怨缺少mDLL2 / mingw-w64 bin目录时,我从msys2 / mingw-w64 bin目录中移走了一些必需的DLL,但现在却出现了这种不透明的错误。我究竟做错了什么?
该GtkOverlay
小部件有一个特殊的set_overlay_pass_through
方法将输入传递到底层覆盖层。我想使用此功能GtkDrawingArea
在 UI 上叠加来添加绘图。不幸的是,它对我不起作用,没有输入事件被传递。
我正在使用msys2
和gtkmm
。
这是我的代码:
Gtk::DrawingArea drawingArea;
Gtk::Fixed nodeBox; //filled with several widgets
Gtk::Overlay overlay;
overlay.add_overlay(nodeBox);
overlay.add_overlay(drawingArea);
overlay.set_overlay_pass_through(drawingArea,true);
window.add(overlay);
Run Code Online (Sandbox Code Playgroud)
当我更改两个add_overlay
调用的顺序时,输入事件正常工作,但nodeBox
隐藏绘图区域的小部件。
我最近更新了 msys2,发现 mintty 在调用之前总是显示“Shells (bash)”对话框。
每次点击按钮有点烦人,如何通过修复默认外壳来抑制这个对话框?薄荷版本是mintty 2.7.7 (x86_64-pc-msys)
.
我最近更新了所有msys2包,现在我无法构建我的项目.在链接其中一个.dlls时发生错误 - target_library.dll
.
我不清楚错误消息.状态5是什么意思?
collect2.exe:错误:ld返回5退出状态
完整信息:
Run Code Online (Sandbox Code Playgroud)g++ -Wl,-s,--relax,--gc-sections -shared -Wl,-subsystem,windows -mthreads -Wl,--out-implib,C:/msys64/workspace/Project_Root_Directory/project/src/../build/release/plugins/libtarget_library.dll.a -o ../../../../build/release/plugins/target_library.dll object_script.target_library.Release -lglu32 -lopengl32 -luser32 -LC:/msys64/workspace/Project_Root_Directory/project/build/release -LC:/msys64/workspace/Project_Root_Directory/project/third-party/out/lib -LC:/msys64/workspace/Project_Root_Directory/project/deps/lib -lexif -ldecimal -lsqlite3 -lutils -LC:/Python35/libs -lpython35 -lkmlbase -lkmlengine -lkmldom -lkmlxsd -lminizip -luriparser -lkmlconvenience -lcore -lrender -lraster -lgui -LC:/msys64/workspace/Project_Root_Directory/project/deps/lib/target_library/win64 -LC:/msys64/mingw64/lib C:/msys64/mingw64/lib/libQt5Widgets.dll.a C:/msys64/mingw64/lib/libQt5WinExtras.dll.a C:/msys64/mingw64/lib/libQt5Gui.dll.a C:/msys64/mingw64/lib/libQt5Network.dll.a C:/msys64/mingw64/lib/libQt5Concurrent.dll.a C:/msys64/mingw64/lib/libQt5Xml.dll.a C:/msys64/mingw64/lib/libQt5Core.dll.a collect2.exe: error: ld returned 5 exit status make[4]: *** [Makefile.Release:159: ../../../../build/release/plugins/target_library.dll] Error 1 make[4]: Leaving directory '/workspace/Project_Root_Directory/project/src/modules/plugins/target_library' make[3]: Leaving directory '/workspace/Project_Root_Directory/project/src/modules/plugins/target_library' make[2]: *** [Makefile:384: sub-target_library-make_first] Error 2 make[2]: Leaving directory '/workspace/Project_Root_Directory/project/src/modules/plugins' make[1]: …
在装有 MSYS2 的 Windows 上,我尝试安装 jekyll:
gem install jekyll
Run Code Online (Sandbox Code Playgroud)
但它失败了,抱怨它无法构建本机扩展 ffi。
寻找mkmf.log
:
"pkg-config --exists libffi"
| pkg-config --libs libffi
=> "-LD:/dev/msys64/mingw64/lib/../lib -lffi\r\n"
"gcc -o conftest.exe -I/usr/include/ruby-2.3.0/x86_64-msys -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-strict-aliasing conftest.c -L. -L/usr/lib -L. -pipe -fstack-protector -lruby230 -lpthread -lgmp -ldl -lcrypt "
In file included from D:/dev/msys64/usr/include/ruby-2.3.0/ruby/ruby.h:36:0,
from .../msys64/usr/include/ruby-2.3.0/ruby.h:33,
from conftest.c:1:
D:/dev/msys64/usr/include/ruby-2.3.0/ruby/defines.h:61:11: fatal error: sys/select.h: No such file or directory
Run Code Online (Sandbox Code Playgroud)
它到底意味着什么以及我该如何解决它。
我需要在 MSYS2 上安装 Python 开发工具。
我的 Python 安装有效(通过调用python3.6
或python3
:
$ python3.6
Python 3.6.5 (default, Apr 16 2018, 10:17:38) [GCC 7.3.0 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Run Code Online (Sandbox Code Playgroud)
安装工具:
$ pip3 install setuptools
Requirement already satisfied: setuptools in /usr/lib/python3.6/site-packages (36.4.0)
Run Code Online (Sandbox Code Playgroud)
我已尝试按照如何安装 python 开发人员包中的建议进行安装?. MSYS2
没有yum
所以我用过pacman
:
$ pacman -S python-devel
error: target not found: python-devel
$ pacman -S python3-devel
error: target not found: …
Run Code Online (Sandbox Code Playgroud) 我想使用Perl 6及其NativeCall库在Windows 10上开发GTK + 3应用程序.我已经安装了MSYS2和GTK + 3,可以使用它运行一个示例GTK + 3 C程序.但我无法在MSYS2上安装Perl 6.我试图在网上搜索相关的博客或帖子,但我找不到任何解决方案.如何在MSYS2上安装Perl 6(Rakudo)?
在 CLion 中打开 makefile 项目时,我收到错误消息:
Cannot run program "make" (in directory "D:\Werkstudent\XWF\XT_Einzelauswertung"): CreateProcess error=2, The system cannot find the file specified: CreateProcess error=2, The system cannot find the file specified
Make execution failed with exit code = 127
Run Code Online (Sandbox Code Playgroud)
mingw-w64-x86_64-toolchain
已安装。Build, Execution, Deployment -> Toolchains
我添加了 MinGW 和 Environment C:\msys64\mingw64
。Make、C 编译器和 C++ 编译器都被正确检测到。Build, Execution, Deployment -> Build Tools -> Make
我已将可执行文件的路径设置为C:\msys64\mingw64\bin\mingw32-make.exe
.CLion的相关调试日志:
2020-11-23 10:01:57,997 [ 244797] INFO - …
Run Code Online (Sandbox Code Playgroud) msys2 ×10
c++ ×4
gtk3 ×3
msys ×3
mingw-w64 ×2
clion ×1
cmake ×1
dll ×1
grid-layout ×1
gtkmm ×1
gtkmm3 ×1
installation ×1
makefile ×1
mintty ×1
nativecall ×1
perl6 ×1
python ×1
python-2.7 ×1
python-3.x ×1
qt5 ×1
rubygems ×1
window ×1
windows ×1
windows-10 ×1