Linux下的winsock库有什么问题? [英] what is wrong with the winsock libary beneath Linux ??

查看:56
本文介绍了Linux下的winsock库有什么问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有


我使用Redhat8.0,我在这个盒子里用葡萄酒编写程序,

我的葡萄酒版本是wine-20020605 -2由Redhat提供。安装完葡萄酒后,

我只是在/ usr / lib / wine中找到库

lrwxrwxrwx 1 root root 17 Jul 29 12:10 libgdi32.dll .so - >

wine / gdi32.dll.so

lrwxrwxrwx 1 root root 20 Jul 29 12:10

libkernel32.dll。所以 - > wine / kernel32.dll.so

lrwxrwxrwx 1 root root 17 Jul 29 12:10 libntdll.dll.so - >

wine / ntdll.dll.so

lrwxrwxrwx 1 root root 18 Jul 29 12:10 libuser32.dll.so - >

wine / user32.dll.so

lrwxrwxrwx 1 root root 14 Jul 29 12:10 libwine.so - >

libwine.so.1.0

-rwxr-xr-x 1 root root 19971 Sep 5 2002 libwine.so .1.0

lrwxrwxrwx 1 root root 20 Jul 29 12:10 libwine_tsx11.so - >

libwine_tsx11.so.1.0

-rwxr- xr-x 1 root root 97902 2002年9月5日libwine_tsx11.so.1.0

lrwxrwxrwx 1 root root 22 Jul 29 12:10

libwine_unicode.so - > libwine_unicode.so.1.0

-rwxr-xr-x 1 root root 836708 2002年9月5日

libwine_unicode.so.1.0

-rw- r - r-- 1 root root 50514 2002年9月5日libwine_uuid.a

* lrwxrwxrwx 1 root root 19 Jul 29 20:31

libwinsock.dll.so - > ; wine / winsock.dll.so

lrwxrwxrwx 1 root root 20 Jul 29 12:10

libwinspool.drv.so - > wine / winspool.drv.so

* lrwxrwxrwx 1 root root 18 Jul 29 14:31 libws2_32.dll.so - >

wine / ws2_32.dll.so

* lrwxrwxrwx 1 root root 19 Jul 29 13:05

libwsock32.dll.so - > wine / wsock32.dll.so

lrwxrwxrwx 1 root root 18 Jul 29 12:10 libx11drv.dll.so - >

wine / x11drv.dll.so


查看此列表,并且在开头,没有链接

libwinsock.dll.so,libws2_32.dll.so和libwsock32.dll.so ,

但是我的程序必须加载winsock2,所以我自己手动完成它们。

,如我程序部分所示:


#include< winsock2.h>

#include< stdio.h>

#include< windows.h>

#include< process.h>

#include< string.h>

#include< winbase.h>


所以,我将它们从/ usr / lib / wine / wine链接到/ usr / lib / wine

然后运行命令ldconfig。

然后我编译我的program test.c with:


#gcc -I / usr / include / wine / wine -I / usr / include / wine / wine / msvcrt -L / usr / lib / win

e -o test test.c -lws2_32.dll


而奇怪的是我是穆斯林找到process.h在

/ usr / include / wine / msvcrt。

并运行此测试,

#。/ test

我收到错误分段错误。


所以,我运行gdb,找到


收到的程序信号SIGSEGV,分段错误。
来自/usr/lib/wine/libws2_32.dll.so的dllname()中的
0x40035614

(gdb)

有什么不对?并且任何人都知道??

我搜索谷歌,没有结果。

谢谢~~


Ka。 J.Ch

Hi, all

I use Redhat8.0, and I complie a program with wine in this box,
my wine version is wine-20020605-2 by Redhat. and after install wine,
I just locate the library in /usr/lib/wine

lrwxrwxrwx 1 root root 17 Jul 29 12:10 libgdi32.dll.so ->
wine/gdi32.dll.so
lrwxrwxrwx 1 root root 20 Jul 29 12:10
libkernel32.dll.so -> wine/kernel32.dll.so
lrwxrwxrwx 1 root root 17 Jul 29 12:10 libntdll.dll.so ->
wine/ntdll.dll.so
lrwxrwxrwx 1 root root 18 Jul 29 12:10 libuser32.dll.so ->
wine/user32.dll.so
lrwxrwxrwx 1 root root 14 Jul 29 12:10 libwine.so ->
libwine.so.1.0
-rwxr-xr-x 1 root root 19971 Sep 5 2002 libwine.so.1.0
lrwxrwxrwx 1 root root 20 Jul 29 12:10 libwine_tsx11.so ->
libwine_tsx11.so.1.0
-rwxr-xr-x 1 root root 97902 Sep 5 2002 libwine_tsx11.so.1.0
lrwxrwxrwx 1 root root 22 Jul 29 12:10
libwine_unicode.so -> libwine_unicode.so.1.0
-rwxr-xr-x 1 root root 836708 Sep 5 2002
libwine_unicode.so.1.0
-rw-r--r-- 1 root root 50514 Sep 5 2002 libwine_uuid.a
*lrwxrwxrwx 1 root root 19 Jul 29 20:31
libwinsock.dll.so -> wine/winsock.dll.so
lrwxrwxrwx 1 root root 20 Jul 29 12:10
libwinspool.drv.so -> wine/winspool.drv.so
*lrwxrwxrwx 1 root root 18 Jul 29 14:31 libws2_32.dll.so ->
wine/ws2_32.dll.so
*lrwxrwxrwx 1 root root 19 Jul 29 13:05
libwsock32.dll.so -> wine/wsock32.dll.so
lrwxrwxrwx 1 root root 18 Jul 29 12:10 libx11drv.dll.so ->
wine/x11drv.dll.so

look at this list, and at the beginning, there is no link of
libwinsock.dll.so, libws2_32.dll.so and libwsock32.dll.so,
but my program must load winsock2, so I do them my myself manually.
as below the part of my program:

#include <winsock2.h>
#include <stdio.h>
#include <windows.h>
#include <process.h>
#include <string.h>
#include <winbase.h>

so, I link them from /usr/lib/wine/wine to /usr/lib/wine
and then run command ldconfig.
and then I compile my program test.c with:

#gcc -I/usr/include/wine/wine -I/usr/include/wine/wine/msvcrt -L/usr/lib/win
e -o test test.c -lws2_32.dll

and the strange thing is I must locate the process.h in
/usr/include/wine/msvcrt .
and run this test,
#./test
I got error "Segmentation fault".

so, I run gdb, and find

Program received signal SIGSEGV, Segmentation fault.
0x40035614 in dllname () from /usr/lib/wine/libws2_32.dll.so
(gdb)

what is wrong?? and anyone knows ??
and I search the google, no result.
Thanks~~

Ka. J.Ch

推荐答案

Ka写道:
所有

我用的是Redhat8.0,我在这个盒子里用葡萄酒编写一个程序,
[snip]有什么不对?有谁知道??
Hi, all

I use Redhat8.0, and I complie a program with wine in this box, [snip] what is wrong?? and anyone knows ??




这与comp.lang.c无关


你可能应该问你的问题在comp.emulators.ms-windows.wine或

comp.os.linux.questions


-


Lew Pitcher,IT顾问,应用程序架构

企业技术解决方案,道明银行金融集团


(此处表达的意见是我自己的,不是我的雇主的)



This has nothing to do with comp.lang.c

You probably should ask your question in comp.emulators.ms-windows.wine or
comp.os.linux.questions


--

Lew Pitcher, IT Consultant, Application Architecture
Enterprise Technology Solutions, TD Bank Financial Group

(Opinions expressed here are my own, not my employer''s)


谢谢!我认为这里很有帮助,可能会有很多有经验的人来图书馆和编程。


Ka。 J. Ch。
Thanks! I think it is helpful here may be many experienced persons with C
library and programming.

Ka. J. Ch.
这与comp.lang.c无关

你可能应该在comp.emulators.ms-windows中提出你的问题。 wine或
comp.os.linux.questions
This has nothing to do with comp.lang.c

You probably should ask your question in comp.emulators.ms-windows.wine or
comp.os.linux.questions



Ka写道:
Ka wrote:
谢谢!我认为这里很有帮助,可能是很多有经验的C / /库和编程人员。
Thanks! I think it is helpful here may be many experienced persons with C
library and programming.




Plase不是顶级的。



Plase don''t top-post.

这与comp.lang.c无关

你可能应该在comp.emulators.ms-windows中提出你的问题。 wine
或comp.os.linux.questions
This has nothing to do with comp.lang.c

You probably should ask your question in comp.emulators.ms-windows.wine
or comp.os.linux.questions




这里可能有很多人经历过狗,孩子,

科幻小说,编纂者和美国内战的历史;

然而,这些东西不在这里。


-

Chris" electric hedgehog" Dollin

C常见问题解答: http://www.faqs.org/faqs/by-newsgrou...mp.lang.c.html

C欢迎: http://www.angelfire.com/ms3/bchambl...me_to_clc.html


这篇关于Linux下的winsock库有什么问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆