并行虚拟机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下的编译环境设置。

 

你可能感兴趣的:(并行虚拟机PVM在VC++6.0下的编译环境设置)