GPS未显示GTKAda应用程序的构建&;跑
我想玩一点GPS,我使用下面的程序,它只是从GPS生成的模板 当我尝试构建和运行时,我看不到窗口,但是如果我导航到生成可执行文件的文件夹,我可以运行可执行文件并看到窗口。我可以看到此选项卡已创建,但看不到我的应用程序GPS未显示GTKAda应用程序的构建&;跑,ada,gnat-gps,Ada,Gnat Gps,我想玩一点GPS,我使用下面的程序,它只是从GPS生成的模板 当我尝试构建和运行时,我看不到窗口,但是如果我导航到生成可执行文件的文件夹,我可以运行可执行文件并看到窗口。我可以看到此选项卡已创建,但看不到我的应用程序 with Gtk.Box; use Gtk.Box; with Gtk.Label; use Gtk.Label; with Gtk.Widget; use Gtk.Widget; with Gtk.Main; with Gtk.Window;
with Gtk.Box; use Gtk.Box;
with Gtk.Label; use Gtk.Label;
with Gtk.Widget; use Gtk.Widget;
with Gtk.Main;
with Gtk.Window; use Gtk.Window;
procedure Main is
Win : Gtk_Window;
Label : Gtk_Label;
Box : Gtk_Vbox;
begin
-- Initialize GtkAda.
Gtk.Main.Init;
-- Create a window with a size of 400x400
Gtk_New (Win);
Win.Set_Default_Size (400, 400);
-- Create a box to organize vertically the contents of the window
Gtk_New_Vbox (Box);
Win.Add (Box);
-- Add a label
Gtk_New (Label, "Hello world.");
Box.Add (Label);
-- Show the window
Win.Show_All;
-- Start the Gtk+ main loop
Gtk.Main.Main;
end Main;
我甚至试着确保我的程序正在运行,并把
Ada.Text\u IO.put\u行(“你好,世界!”)代码>在源代码中,并且它似乎是根据Run选项卡运行的。这是因为它卡在Gtk.Main.Main循环中。
要查看该窗口,可以使用自定义运行命令(Shift+F2)并选中“在外部终端中运行”选项
点击执行按钮,你会看到GtkWindow启动并运行
有关更多详细信息,请查看:
这是因为它卡在Gtk.Main.Main循环中。
要查看该窗口,可以使用自定义运行命令(Shift+F2)并选中“在外部终端中运行”选项
点击执行按钮,你会看到GtkWindow启动并运行
有关更多详细信息,请查看:
我也有同样的问题。
您需要向链接器添加“windows GUI”指令
转到项目/属性,在Build/Switches/Ada链接器下,在字段中添加此指令
-Wl,--subsystem,windows
或者将其放入gpr文件链接器部分,如下所示:
package Linker is
case Library_Type is
when "static" =>
for Switches ("ada") use ("-Wl,--subsystem,windows");
when "static-pic" =>
when "relocatable" =>
end case;
end Linker;
我也有同样的问题。
您需要向链接器添加“windows GUI”指令
转到项目/属性,在Build/Switches/Ada链接器下,在字段中添加此指令
-Wl,--subsystem,windows
或者将其放入gpr文件链接器部分,如下所示:
package Linker is
case Library_Type is
when "static" =>
for Switches ("ada") use ("-Wl,--subsystem,windows");
when "static-pic" =>
when "relocatable" =>
end case;
end Linker;