building python extensions

alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
I am using Ice 3.6 on Windows. I have built Ice for C++ from source and now I am attempting to build the python extension (IcePy) with the intention of using a python client.

I am getting the following unresolved externals which appears to a problem with building IceSSL sliced files. The python Makefile.mak forces me to use CPP_COMPILER=vc100 but the Ice for C++ is built using vc110 (Visual Studio 2012). Is this causing the problem? If so, how do I build the python extension with VS 2012 to be compatible with everything else.

C:\Ice-3.6.0\python>nmake /f Makefile.mak

Microsoft (R) Program Maintenance Utility Version 11.00.50727.1
Copyright (C) Microsoft Corporation. All rights reserved.

"making all in modules"
"making all in IcePy"
link.exe /LIBPATH:"C:\Python27\libs" /LIBPATH:"..\..\..\cpp\lib" /nolog
o /OPT:REF /pdb:none /dll .\BatchRequestInterceptor.obj .\Communicator.obj .\
Connection.obj .\ConnectionInfo.obj .\Current.obj .\Endpoint.obj .\EndpointI
nfo.obj .\ImplicitContext.obj .\Init.obj .\Logger.obj .\ObjectAdapter.obj .
\ObjectFactory.obj .\Operation.obj .\Properties.obj .\PropertiesAdmin.obj .\
Proxy.obj .\Slice.obj .\Thread.obj .\Types.obj .\Util.obj /out:..\..\python
\IcePy.pyd IcePy.res
Creating library ..\..\python\IcePy.lib and object ..\..\python\IcePy.exp
ConnectionInfo.obj : error LNK2019: unresolved external symbol "__declspec(dllim
port) class Ice::LocalObject * __cdecl IceSSL::upCast(class IceSSL::ConnectionIn
fo *)" ([email protected]@@[email protected]@@[email protected]@@Z) re
ferenced in function sslConnectionInfoGetCipher
ConnectionInfo.obj : error LNK2019: unresolved external symbol "__declspec(dllim
port) class Ice::LocalObject * __cdecl IceSSL::upCast(class IceSSL::WSSConnectio
nInfo *)" ([email protected]@@[email protected]@@[email protected]@
@Z) referenced in function wssConnectionInfoGetHeaders
ConnectionInfo.obj : error LNK2019: unresolved external symbol "__declspec(dllim
port) public: __cdecl IceSSL::ConnectionInfo::ConnectionInfo(void)" (__imp_??0Co
[email protected]@@[email protected]) referenced in function "public: __cdecl IceSSL::Co
nnectionInfo__staticInit::ConnectionInfo__staticInit(void)" (??0ConnectionInfo__
[email protected]@@[email protected])
ConnectionInfo.obj : error LNK2019: unresolved external symbol "__declspec(dllim
port) protected: void __cdecl IceSSL::ConnectionInfo::`vbase destructor'(void)"
([email protected]@@IEAAXXZ) referenced in function "public: __cde
cl IceSSL::ConnectionInfo__staticInit::~ConnectionInfo__staticInit(void)" (??1Co
[email protected]@@[email protected])
EndpointInfo.obj : error LNK2019: unresolved external symbol "__declspec(dllimpo
rt) class Ice::LocalObject * __cdecl IceSSL::upCast(class IceSSL::EndpointInfo *
)" ([email protected]@@[email protected]@@[email protected]@@Z) referenc
ed in function "public: static class IceInternal::Handle<class IceSSL::EndpointI
nfo> __cdecl IceInternal::Handle<class IceSSL::EndpointInfo>::dynamicCast<class
Ice::EndpointInfo>(class IceUtil::HandleBase<class Ice::EndpointInfo> const &)"
@[email protected]
@Z)
EndpointInfo.obj : error LNK2019: unresolved external symbol "__declspec(dllimpo
rt) class Ice::LocalObject * __cdecl IceSSL::upCast(class IceSSL::WSSEndpointInf
o *)" ([email protected]@@[email protected]@@[email protected]@@Z) re
ferenced in function wssEndpointInfoGetResource
..\..\python\IcePy.pyd : fatal error LNK1120: 6 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
\VC\BIN\amd64\link.exe"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: 'for' : return code '0x1'
Stop.
NMAKE : fatal error U1077: 'for' : return code '0x1'
Stop.

Comments

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Dennis,

    Python is itself built with Visual Studio: Visual Studio 2010 for Python 3.3 and 3.4, and Visual Studio 2015 for Python 3.5. See https://docs.python.org/devguide/setup.html#windows.

    We use the same version of Visual Studio to build the Ice for Python extension, and we recommend you do the same.

    Which version of Python are you using?

    Best regards,
    Bernard
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    I need to build it with VS 2012 then. Why can't it be built with VS 20212 using CPP_COMPILER=VC110? Otherwise, I am not going to be able to use it. I'm currently using Python 2.7, is that the problem? It builds everything, it just has a problem with the link step.
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    We recommend using the same compiler as the compiler used to build Python to prevent mixing C runtime libraries. For Python 2.7, you're supposed to be using Visual Studio 2008 or the special compiler release made freely available by Microsoft for Python 2.7. It's available at this link: https://www.microsoft.com/en-us/down....aspx?id=44266

    However, Ice 3.6 no longer supports building the python extension from source with this Visual Studio version so I'm afraid it won't work.

    Why do you need to build the extension with VS2012? Can't you just use the Ice 3.6.1 Python 2.7 wheel available on PyPI (https://pypi.python.org/pypi/zeroc-ice/3.6.1)?

    Cheers,
    Benoit.
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Btw, the linker error you posted is most likely caused by a bug in 3.6.0 which has been fixed with Ice 3.6.1.

    Cheers,
    Benoit.
  • alversonalverson Member Dennis AlversonOrganization: Braxton TechnologiesProject: Orbital Analysis
    Great thanks. I'll need to migrate to 3.6.1.
Sign In or Register to comment.