go gtk3 pcman-key

go build -ldflags "-H windowsgui -w -s"

Installing on Windows - gotk3/gotk3 Wiki
See [the official GTK instructions for Windows](https://www.gtk.org/docs/installations/windows/ "the official GTK instructions for Windows").https://www.gtk.org/docs/installations/windows/

`go
1、管理员权限运行 
   go1.19.1.windows-amd64.msi

 配置 系统环境变量 
 path里确认已加 d:\app\Go\bin
 GOBIN = d:\app\Go\bin
 GOROOT = d:\app\Go  (安装目录) 
 GOPATH = e:\source\go  (go 源代码目录)
 CGO_ENABLED  = 1
 GO111MODULE = on 
 GOPROXY = https://goproxy.cn,direct

  注意系统环境变量要和Go env 结果中的配置一致。
  改写GO环境变量
  go env -w CC=d:\Tools\msys64\mingw64\bin\gcc.exe


2、安装msys2
  配置系统环境变量
  PKG_CONFIG_PATH =D:\Tools\msys64\mingw64\lib\pkgconfig
  path 增加:
     D:\Tools\msys64\mingw64\bin
     D:\Tools\msys64\mingw64\include
     D:\Tools\msys64\mingw64\lib
     D:\Tools\msys64\mingw64\lib\pkgconfig
     D:\Tools\msys64\usr\include
     D:\Tools\msys64\usr\lib
     D:\Tools\msys64\mingw64\lib\glib-2.0\include

3、管理员模式启动 mingw64.exe
   $pacman -S mingw-w64-x86_64-gtk3 mingw-w64-x86_64-toolchain base-devel glib2-devel
       最后有提示信息:
       Note that 'D:/Tools/msys64/mingw64/share' is not in the search path
       set by the XDG_DATA_HOME and XDG_DATA_DIRS
       environment variables, so applications may not
       be able to find it until you set them. The
       directories currently searched are:

        - D:\Tools\msys64\home\jordan\.local\share
        - D:\Tools\msys64\mingw64\share\
        - D:\Tools\msys64\usr\local\share\
        - D:\Tools\msys64\usr\share\
   $sed -i -e 's/-Wl,-luuid/-luuid/g' /mingw64/lib/pkgconfig/gdk-3.0.pc # This fixes a bug in pkgconfig

    
4、查看go env

   goland 如果找不到SDK,则需要修改文件 (src\runtime\internal\sys\)zversion.go
     const TheVersion = `go1.18.7`  (你的安装版本)

5、下载 gtk3 sample
   go build -ldflags "-H windowsgui -w -s"  
   连接参数 -H windowsgui 表示连接出来的程序不要带控制台

【排错】:

GOLand debug 时:
could not launch process: decoding dwarf section info at offset 0x6: unsupported DWARF version 5


https://blog.jetbrains.com/go/2019/02/06/debugging-with-goland-getting-started/

go 1.17  和 Goland 使用的调试工具版本不匹配。dlv.exe version .
“I'm going to close this. The fixes on both our side and on go's side have been merged. It just so happens that delve will need to be built with (as of yet unreleased) go 1.18 to read executables built with recent versions of gcc on windows (or macos).” 


PS D:\app\Go\bin> dlv version
Delve Debugger
Version: 1.8.0
Build: $Id: 6a6c9c332d5354ddf1f8a2da3cc477bd18d2be53 $
PS D:\app\Go\bin>
PS D:\app\Go\bin> go version
go version go1.17 windows/amd64

安装dlv 【去https://github.com/go-delve/delve 查看都有哪些版本】
$ go install github.com/go-delve/delve/cmd/dlv@master  #Install at tree head:
$ go install github.com/go-delve/delve/cmd/dlv@latest  #Install the latest release:
$ go install github.com/go-delve/delve/cmd/dlv@v1.7.3  #指定1.7.3版本
$ go install github.com/go-delve/delve/cmd/dlv@v1.7.4-0.20211208103735-2f13672765fe

  go install github.com/go-delve/delve/cmd/dlv@v1.5.1  #指定1.5.1版本 ok ,编译出go\bin\dlv.exe
  go get -u github.com/go-delve/delve/cmd/dlv@v1.5.1
  就在 gobin下生成对应的版本
  配置dlv
  GoLand Help->Edit Cusom Properties
   
        dlv.path=D:/app/go/bin/dlv.exe
  【《《go1.18.3,dlv1.5.1,go-gtk3 可以debug了》》】

编译失败:
   cgo-gcc-prolog: In function '_cgo_26ff448d08b0_Cfunc_g_binding_get_source':
  cgo-gcc-prolog:71:2: warning: 'g_binding_get_source' is deprecated: Use 'g_binding_dup_source' instead [-Wdeprecated-declarations]
   In file included from D:/Tools/msys64/mingw64/include/glib-2.0/glib-object.h:22,
                 from D:/Tools/msys64/mingw64/include/glib-2.0/gio/gioenums.h:28,
                 from D:/Tools/msys64/mingw64/include/glib-2.0/gio/giotypes.h:28,
                 from D:/Tools/msys64/mingw64/include/glib-2.0/gio/gio.h:26,
                 from E:\source\go1.18\pkg\mod\github.com\gotk3\gotk3@v0.6.1\glib\gbinding.go:3:
  D:/Tools/msys64/mingw64/include/glib-2.0/gobject/gbinding.h:113:23: note: declared here
  113 | GObject *             g_binding_get_source          (GBinding *binding);
  【解决】
    \source\go1.18\pkg\mod\github.com\gotk3\gotk3@v0.6.1\glib\gbinding.go:3:
    // Retrieves the GObject instance used as the source of the binding
func (v *Binding) GetSource() *Object {
    // obj := C.g_binding_get_source(v.native())  ///旧
    obj := C.g_binding_dup_source(v.native())     ///新 
    if obj == nil {
        return nil
    }
    return wrapObject(unsafe.Pointer(obj))
}

// Retrieves the GObject instance used as the target of the binding.
func (v *Binding) GetTarget() *Object {
    // obj := C.g_binding_get_target(v.native())
    obj := C.g_binding_dup_target(v.native())
    if obj == nil {
        return nil
    }
    return wrapObject(unsafe.Pointer(obj))
}

  【按头文件 gbinging.h 中最新函数替换旧函数】
     g_binding_get_source    --》     g_binding_dup_source   
      g_binding_get_target  ----》    g_binding_dup_target  
      g_binding_get_source_property (GBinding *binding);
      g_binding_get_target_property (GBinding *binding);

  

6、pacman 安装工具链时,提示错误
   
  提示key错误: rm -fr /etc/pacman.d/gnupg  删除这个目录  ----GnuPG-2.1 与 pacman 密钥环
  “ https://www.archlinuxcn.org/gnupg-2-1-and-the-pacman-keyring/
  GnuPG-2.1 与 pacman 密钥环

 使用官方的pacman密钥环:pacman (简体中文)/Package signing (简体中文) - ArchWiki (archlinux.org)

   

重置所有密钥

如果要删除或重置系统,删除 /etc/pacman.d/gnupg 目录并重新运行 pacman-key --init。通过 pacman-key --populate archlinux 重新添加默认密钥。如果 archlinux-keyring 不是最新的,需要在更新系统前先执行 pacman -S archlinux-keyring

  pacman -Syu    提示 custom.db 无法更新。从某个源找不到。“error: failed retrieving file 'custom.db' from ”
    修改etc/pacman.conf 
      注释掉最后的[custom]段。
    并更新源: 
      [mingw64]
        Include = /etc/pacman.d/mirrorlist.mingw  用下面的对应的源改这个文件
      [msys]
        Include = /etc/pacman.d/mirrorlist.msys   同理
    ## 参考 https://archlinux.org/mirrorlist/
    ## MSYS2 repository mirrorlist
    ##
    
    ## Primary
    ## msys2.org
    Server = https://sourceforge.net/projects/msys2/files/REPOS/MSYS2/$arch/
    Server = https://www2.futureware.at/~nickoe/msys2-mirror/msys/$arch/
    Server = https://mirror.yandex.ru/mirrors/msys2/msys/$arch/
    Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/$arch/
    Server = http://mirrors.ustc.edu.cn/msys2/msys/$arch/
    Server = http://mirror.bit.edu.cn/msys2/msys/$arch/
    Server = https://mirror.selfnet.de/msys2/msys/$arch/
    Server = https://mirrors.sjtug.sjtu.edu.cn/msys2/msys/$arch/
    Server = https://msys2.nyc3.digitaloceanspaces.com/msys/$arch/
    Server = https://mirror.jmu.edu/pub/msys2/msys/$arch/
    Server = https://ftp.cc.uoc.gr/mirrors/msys2/msys/$arch/
    Server = https://ftp.acc.umu.se/mirror/msys2.org/msys/$arch/
    Server = https://mirrors.piconets.webwerks.in/msys2-mirror/msys/$arch/
    Server = https://quantum-mirror.hu/mirrors/pub/msys2/msys/$arch/
    Server = https://mirrors.dotsrc.org/msys2/msys/$arch/ 
    Server = https://mirror.ufro.cl/msys2/msys/$arch/
    Server = https://mirror.clarkson.edu/msys2/msys/$arch/
    Server = https://ftp.nluug.nl/pub/os/windows/msys2/builds/msys/$arch/
    Server = https://download.nus.edu.sg/mirror/msys2/msys/$arch/
    Server = https://ftp.osuosl.org/pub/msys2/msys/$arch/


##
## 32-bit Mingw-w64 repository mirrorlist
##

## Primary
## msys2.org
Server = https://sourceforge.net/projects/msys2/files/REPOS/MINGW/i686/
Server = https://www2.futureware.at/~nickoe/msys2-mirror/mingw/i686/
Server = https://mirror.yandex.ru/mirrors/msys2/mingw/i686/
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/i686/
Server = http://mirrors.ustc.edu.cn/msys2/mingw/i686/
Server = http://mirror.bit.edu.cn/msys2/mingw/i686/
Server = https://mirror.selfnet.de/msys2/mingw/i686/
Server = https://mirrors.sjtug.sjtu.edu.cn/msys2/mingw/i686/
Server = https://msys2.nyc3.digitaloceanspaces.com/mingw/i686/
Server = https://mirror.jmu.edu/pub/msys2/mingw/i686/
Server = https://ftp.cc.uoc.gr/mirrors/msys2/mingw/i686/
Server = https://ftp.acc.umu.se/mirror/msys2.org/mingw/i686/
Server = https://mirrors.piconets.webwerks.in/msys2-mirror/mingw/i686/
Server = https://quantum-mirror.hu/mirrors/pub/msys2/mingw/i686/
Server = https://mirrors.dotsrc.org/msys2/mingw/i686/ 
Server = https://mirror.ufro.cl/msys2/mingw/i686/
Server = https://mirror.clarkson.edu/msys2/mingw/i686/
Server = https://ftp.nluug.nl/pub/os/windows/msys2/builds/mingw/i686/
Server = https://download.nus.edu.sg/mirror/msys2/mingw/i686/
Server = https://ftp.osuosl.org/pub/msys2/mingw/i686/


##
## 64-bit Mingw-w64 repository mirrorlist
##

## Primary
## msys2.org
Server = https://sourceforge.net/projects/msys2/files/REPOS/MINGW/x86_64/
Server = https://www2.futureware.at/~nickoe/msys2-mirror/mingw/x86_64/
Server = https://mirror.yandex.ru/mirrors/msys2/mingw/x86_64/
Server = https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/x86_64/
Server = http://mirrors.ustc.edu.cn/msys2/mingw/x86_64/
Server = http://mirror.bit.edu.cn/msys2/mingw/x86_64/
Server = https://mirror.selfnet.de/msys2/mingw/x86_64/
Server = https://mirrors.sjtug.sjtu.edu.cn/msys2/mingw/x86_64/
Server = https://msys2.nyc3.digitaloceanspaces.com/mingw/x86_64/
Server = https://mirror.jmu.edu/pub/msys2/mingw/x86_64/
Server = https://ftp.cc.uoc.gr/mirrors/msys2/mingw/x86_64/
Server = https://ftp.acc.umu.se/mirror/msys2.org/mingw/x86_64/
Server = https://mirrors.piconets.webwerks.in/msys2-mirror/mingw/x86_64/
Server = https://quantum-mirror.hu/mirrors/pub/msys2/mingw/x86_64/
Server = https://mirrors.dotsrc.org/msys2/mingw/x86_64/ 
Server = https://mirror.ufro.cl/msys2/mingw/x86_64/
Server = https://mirror.clarkson.edu/msys2/mingw/x86_64/
Server = https://ftp.nluug.nl/pub/os/windows/msys2/builds/mingw/x86_64/
Server = https://download.nus.edu.sg/mirror/msys2/mingw/x86_64/
Server = https://ftp.osuosl.org/pub/msys2/mingw/x86_64/

     
`

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 要进行gtk-doc-tools的离线安装,您需要以下步骤。 1. 下载gtk-doc-tools的源代码包。您可以从Gtk官方网站或其他可靠的源进行下载。确保下载对应于您操作系统和版本的正确包。 2. 在您的计算机上解压源代码包。您可以选择将其解压到任意位置,例如您的主文件夹或者/opt目录。解压后,您将会得到一个包含gtk-doc-tools的文件夹。 3. 打开终端,并切换到解压后的文件夹中。 4. 运行以下命令以配置gtk-doc-tools的安装选项: ``` ./configure ``` 该命令将会检查您的系统环境,并根据您的配置进行预准备。 5. 运行以下命令以编译gtk-doc-tools: ``` make ``` 这将会开始编译gtk-doc-tools。这个过程可能需要一些时间,请耐心等待。 6. 运行以下命令以安装gtk-doc-tools: ``` sudo make install ``` 这个命令将会将gtk-doc-tools安装到您的操作系统中。请确保您具有足够的权限来安装软件。 7. 安装完成后,您可以通过在终端中运行gtk-doc-check命令来验证安装是否成功。如果安装成功,您将会看到相关信息。 通过以上步骤,您可以离线安装gtk-doc-tools。请注意,由于系统配置和版本的差异,可能会影响安装过程。 ### 回答2: 要离线安装gtk-doc-tools,您需要进行以下步骤: 1. 首先,您需要下载gtk-doc-tools的离线安装包。您可以在gtk-doc-tools官方网站或其他可信的软件下载网站上找到这个安装包。确保下载的安装包与您系统的架构和版本相匹配。 2. 在下载完安装包后,将其解压缩到您想要安装gtk-doc-tools的目录。您可以选择将其解压缩到系统的默认目录,或者根据个人喜好选择其他目录。 3. 打开终端(Terminal)并导航到解压缩的gtk-doc-tools目录。 4. 在终端中,输入以下命令以开始安装过程: ``` ./configure make make install ``` 这些命令将配置安装环境,并编译和安装gtk-doc-tools。 5. 安装完成后,您可以通过运行以下命令来验证gtk-doc-tools是否成功安装: ``` gtkdoc-scan --version ``` 如果成功安装,您将看到gtk-doc-tools的版本信息。 请注意,离线安装gtk-doc-tools可能需要一些先决条件,例如GLib、Make、GCC等。如果您在安装过程中遇到依赖错误,请根据错误消息安装缺失的依赖项。 总之,通过下载gtk-doc-tools的离线安装包,解压缩并使用终端进行安装,您可以离线安装gtk-doc-tools。请确保您在安装过程中满足所有的依赖项和系统要求。 ### 回答3: gtk-doc-tools是一组用于生成GTK+应用程序文档的工具集。如果需要进行离线安装,可以按照以下步骤进行操作: 1. 首先,将gtk-doc-tools的源代码下载到本地。可以通过官方网站或者其他可靠的源代码仓库获取到最新的源代码包。下载源代码包后,解压缩到指定目录。 2. 进入解压缩后的目录,使用终端进入该目录。 3. 在终端中执行以下命令来安装gtk-doc-tools之前的依赖包:sudo apt-get install autoconf automake libtool 4. 在终端中执行以下命令来配置gtk-doc-tools的安装选项:./configure --prefix=/usr 这里的"--prefix=/usr"参数指定了gtk-doc-tools安装的目标路径,可以根据需要进行调整。 5. 配置完成后,执行make命令来编译gtk-doc-tools。这个过程可能需要一些时间,具体取决于您的计算机性能。 6. 编译完成后,执行sudo make install命令来安装gtk-doc-tools。这个命令将会将gtk-doc-tools的文件复制到指定的安装目录。 7. 安装完成后,可以在终端中执行gtkdocize命令来验证gtk-doc-tools是否已经成功安装。如果终端返回了gtkdocize的版本信息,则表示安装成功。 至此,gtk-doc-tools已经成功进行了离线安装。你可以在终端中使用gtk-doc-tools来生成GTK+应用程序的文档,为开发和使用这些应用程序提供参考和帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值