日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux如何编译wine,利用winelib编译一个可在linux下运行的程序

發布時間:2023/12/15 linux 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux如何编译wine,利用winelib编译一个可在linux下运行的程序 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

利用winelib編譯一個可在linux下運行的程序

只是想既可以使用linux的api,又可以使用windows的api

#include

#include

#include

#include

int main(int argc, char* argv[])

{

printf("long %d\n", sizeof(long));

system("lspci");

char bufr[256];

gethostname(bufr, sizeof(bufr));

strcat(bufr, " says, 'Howdy World!'");

MessageBox(NULL, bufr, "Junk", MB_OK);

return(0);

}

在64位機器上編譯

winegcc -m32 -o ?junk junk.c

得到

linux-b460:/home/winelib # ls

junk.c ?junk.exe ?junk.exe.so

運行

wine junk.exe.so

運行結果

linux-b460:/home//winelib # wine junk.exe.so

long 4

00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 18)

00:06.0 PCI bridge: Intel Corporation Core Processor Secondary PCI Express Root Port (rev 18)

00:1a.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 05)

00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 05)

00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 05)

00:1c.4 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 5 (rev 05)

00:1c.5 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 6 (rev 05)

00:1c.6 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 7 (rev 05)

00:1c.7 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 8 (rev 05)

00:1d.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 05)

00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev a5)

00:1f.0 ISA bridge: Intel Corporation 3400 Series Chipset LPC Interface Controller (rev 05)

00:1f.2 IDE interface: Intel Corporation 5 Series/3400 Series Chipset 4 port SATA IDE Controller (rev 05)

00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller (rev 05)

00:1f.5 IDE interface: Intel Corporation 5 Series/3400 Series Chipset 2 port SATA IDE Controller (rev 05)

01:00.0 SCSI storage controller: LSI Logic / Symbios Logic SAS1068E PCI-Express Fusion-MPT SAS (rev 04)

05:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection

06:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection

07:05.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED Graphics Family (rev 10)

Application tried to create a window, but no driver could be loaded.

Make sure that your X server is running and that $DISPLAY is set correctly.

err:systray:initialize_systray Could not create tray window

Application tried to create a window, but no driver could be loaded.

Make sure that your X server is running and that $DISPLAY is set correctly.

可以看到system是linux的api

messagebox是win的api,但是沒有在x環境下所以報錯

去掉-m32也編不過,也就是還只能生成32位的程序,對我用處不大,僅記錄之

總結

以上是生活随笔為你收集整理的linux如何编译wine,利用winelib编译一个可在linux下运行的程序的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。