并行虚拟机PVM在VC++6.0下的编译环境设置

并行虚拟机PVM在VC++6.0下的编译环境设置

(源自: http://www.slintec.com  作者: zengl(at)ics.ict.ac.cn   如需转载请注明出处)

1.打开VC++6.0菜单Project->Project settings->Link
2.在Category选择Input,然后在Object/library modules中添加libpvm3.lib wsock32.lib(注意空格)
  同时在Additional library path:添加libpvm3.lib所在的目录,如C:/Program Files/PVM3.4/lib/WIN32
  如不添加libpvm3.lib,可能出现以下编译错误
--------------------Configuration: slave2 - Win32 Debug--------------------
Linking...
slave1.obj : error LNK2001: unresolved external symbol _pvm_exit
slave1.obj : error LNK2001: unresolved external symbol _pvm_send
slave1.obj : error LNK2001: unresolved external symbol _pvm_parent
slave1.obj : error LNK2001: unresolved external symbol _pvm_pkfloat
slave1.obj : error LNK2001: unresolved external symbol _pvm_pkint
slave1.obj : error LNK2001: unresolved external symbol _pvm_initsend
slave1.obj : error LNK2001: unresolved external symbol _pvm_upkfloat
slave1.obj : error LNK2001: unresolved external symbol _pvm_upkint
slave1.obj : error LNK2001: unresolved external symbol _pvm_recv
slave1.obj : error LNK2001: unresolved external symbol _pvm_mytid
slave1.obj : error LNK2001: unresolved external symbol __fltused
slave1.obj : error LNK2001: unresolved external symbol __chkesp
LINK : error LNK2001: unresolved external symbol _mainCRTStartup
Debug/slave2.exe : fatal error LNK1120: 13 unresolved externals
Error executing link.exe.

slave2.exe - 14 error(s), 0 warning(s)

  如不添加wsock32.lib,可能出现以下编译错误
--------------------Configuration: slave2 - Win32 Debug--------------------
Linking...
LIBCMT.lib(tolower.obj) : error LNK2005: __tolower already defined in LIBCD.lib(tolower.obj)
LIBCMT.lib(tolower.obj) : error LNK2005: _tolower already defined in LIBCD.lib(tolower.obj)
LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
libpvm3.lib(lpvm.obj) : error LNK2001: unresolved external symbol ___WSAFDIsSet@8
libpvm3.lib(pvmcruft.obj) : error LNK2001: unresolved external symbol ___WSAFDIsSet@8
libpvm3.lib(lpvm.obj) : error LNK2001: unresolved external symbol _getsockname@12
libpvm3.lib(lpvm.obj) : error LNK2001: unresolved external symbol _bind@12
libpvm3.lib(lpvm.obj) : error LNK2001: unresolved external symbol _socket@12
libpvm3.lib(lpvm.obj) : error LNK2001: unresolved external symbol _listen@8
libpvm3.lib(lpvm.obj) : error LNK2001: unresolved external symbol _setsockopt@20
libpvm3.lib(lpvm.obj) : error LNK2001: unresolved external symbol _connect@12
libpvm3.lib(lpvm.obj) : error LNK2001: unresolved external symbol _accept@12
libpvm3.lib(lpvm.obj) : error LNK2001: unresolved external symbol _select@20
libpvm3.lib(lpvm.obj) : error LNK2001: unresolved external symbol _WSAStartup@8
libpvm3.lib(pvmcruft.obj) : error LNK2001: unresolved external symbol _htons@4
libpvm3.lib(pvmcruft.obj) : error LNK2001: unresolved external symbol _htonl@4
libpvm3.lib(xdr_mem.obj) : error LNK2001: unresolved external symbol _htonl@4
libpvm3.lib(pvmcruft.obj) : error LNK2001: unresolved external symbol _ntohs@4
libpvm3.lib(pvmcruft.obj) : error LNK2001: unresolved external symbol _ntohl@4
libpvm3.lib(xdr_mem.obj) : error LNK2001: unresolved external symbol _ntohl@4
libpvm3.lib(pvmwin.obj) : error LNK2001: unresolved external symbol _send@16
libpvm3.lib(pvmwin.obj) : error LNK2001: unresolved external symbol _recv@16
Debug/slave2.exe : fatal error LNK1120: 16 unresolved externals
Error executing link.exe.

3.在Ignore libraries:中添加libcmt.lib,libcd.lib(注意逗号),否则可能会出现以下定义重复的错误,导致编译通

不过
Linking...
LIBCMT.lib(tolower.obj) : error LNK2005: __tolower already defined in LIBCD.lib(tolower.obj)
LIBCMT.lib(tolower.obj) : error LNK2005: _tolower already defined in LIBCD.lib(tolower.obj)
LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library

4.在VC++6.0菜单tools->Directories->Show directories for选择include files,然后添加include目录,例如

C:/PROGRAM FILES/PVM3.4/INCLUDE,C:/PROGRAM FILES/PVM3.4/SRC 否则编译可能无法通过。
5.在程序里面包含 #include "pvm3.h" 至此完成PVM在VC++6.0下的编译环境设置。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值