Import Environmental Manager in Python and build dll for V35

asked 2023-02-03 10:52:52 -0500

CPReddy gravatar image

def CreateDLL(psseversion, keyname): # ____________________ # [vars]

mypathlib = False  # set PATH and LIB values using installed components
src_lst = []

work_dir = os.getcwd()
if len(sys.argv) > 1:
    keyname = sys.argv[1]
dllname = "%s_v33.11.0.dll" % (keyname)
dlllib = dllname.replace('.dll', '.lib')
try:
    os.remove(dlllib)
except:
    pass

for ext in ['*.flx', '*.f', '*.for', '*.f90']:  # include conec & conet files
    src_lst += find_files(ext, work_dir)  # get source files
objlibfiles = find_files('*.obj', work_dir)
objlibfiles += find_files('*.lib', work_dir)

ierr = psse_env_manager.create_dll(psseversion,
                                   src_lst,
                                   modsources=[],
                                   objlibfiles=objlibfiles,
                                   dllname=dllname,
                                   workdir=work_dir,
                                   showprg=True,
                                   useivfvrsn='15.0.285',
                                   shortname=keyname,
                                   description='User Model',
                                   majorversion=1,
                                   minorversion=0,
                                   buildversion=0,
                                   companyname='Enerzinx',
                                   mypathlib=mypathlib)

if name == 'main': psseversion = 33 keyname = 'Mydll' CreateDLL(psseversion, keyname)

this code works for building the dll for ver33 and 34. But if I use the same code for ver35, it throws the error message below.

fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'x64'

ERROR during link(2)... Aborted

edit retag flag offensive close merge delete