gpioke 编译

用qt 的

mingw32-make

下载源码和编译:

https://gist.github.com/Mapleaph/c45593300af2fe54d5219c97ecebe77c


直接 mingw32-make


F:\evideo\x86服务器相关技术\h310\gpioke\c45593300af2fe54d5219c97ecebe77c-587d7f45894759b38ad9149e8ccb35356674c3a4>mingw32-make -f Makefile.win
gcc -Wall -o gpioke gpioke.c -L. -lpci -lwinio64
gpioke.c: In function 'try_pch':
gpioke.c:343:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      PBYTE sbmap = (PBYTE)((u64)sbreg_addr);
                    ^
C:\Users\James\AppData\Local\Temp\ccOlDJrj.o:gpioke.c:(.text+0x548): undefined reference to `GetPortVal@12'
C:\Users\James\AppData\Local\Temp\ccOlDJrj.o:gpioke.c:(.text+0x5c4): undefined reference to `GetPortVal@12'
C:\Users\James\AppData\Local\Temp\ccOlDJrj.o:gpioke.c:(.text+0x640): undefined reference to `GetPortVal@12'
C:\Users\James\AppData\Local\Temp\ccOlDJrj.o:gpioke.c:(.text+0xc50): undefined reference to `GetPhysLong@8'
C:\Users\James\AppData\Local\Temp\ccOlDJrj.o:gpioke.c:(.text+0xc8e): undefined reference to `SetPhysLong@8'
C:\Users\James\AppData\Local\Temp\ccOlDJrj.o:gpioke.c:(.text+0x15a7): undefined reference to `InitializeWinIo@0'
C:\Users\James\AppData\Local\Temp\ccOlDJrj.o:gpioke.c:(.text+0x163c): undefined reference to `ShutdownWinIo@0'
collect2.exe: error: ld returned 1 exit status
mingw32-make: *** [Makefile.win:6: gpioke] Error 1


分析原因是因为qt编译器是32位版本

修改编译选项:

LDFLAGS = -L. -lpci -lwinio32
#LDFLAGS = -L. -lpci –lwinio64


mingw32-make 通过。




  • 打开系统调试模式:cmd下运行 bcdedit /set testsigning on
  • 安装数字签名

    步骤如下: 打开 WinIO64.sys的属性框,翻到“数字签名”选项卡,点击“详细信息” 在新出来的对话框中点击“查看证书” 在又新出来的对话框中点击“安装证书” 点击“下一步”,然后选择“将所有的证书放入下列存储” 点击浏览,选择“受信任的根证书发布机构” 点击“下一步”,然后点击“完成” 在弹出的“安全性警告”对话框中选择“是”,才能导入成功 然后重启。

注意 win7及以上系统需要以管理员权限打开应用。如开发的时候需要以管理员方式运行eclipse,否则winio会初始化失败!!!



C:\WINDOWS\system32>bcdedit /set testsigning on
设置元素数据时出错。
该值受安全引导策略保护,无法进行修改或删除。

参考:

https://zhuanlan.zhihu.com/p/34743309


去bios里面,关闭  Secure Boot

posted on 2021-01-19 10:04  katago  阅读(102)  评论(0编辑  收藏  举报