Linking to Python for Windows CE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Martin Evans

    #1

    Linking to Python for Windows CE

    I've just been tasked with porting our desktop embedded Python support
    onto our existing CE offering. I've managed to compile the Python
    sources and have produced an armdbg420\pytho n23.lib file.

    When I come to link to the Python library though from our one of our
    DLLs, I am getting the following unresolved externals:

    -------------------
    embedded.obj : error LNK2019: unresolved external symbol
    "__declspec(dll import) int __cdecl WinCE_fclose(vo id *)"
    (__imp_?WinCE_f close@@YAHPAX@Z ) referenced in function "unsigned long
    __cdecl PythonThread(vo id *)" (?PythonThread@ @YAKPAX@Z)

    embedded.obj : error LNK2019: unresolved external symbol __imp_LoadLibra ryU
    referenced in function "unsigned long __cdecl PythonThread(vo id *)"
    (?PythonThread@ @YAKPAX@Z)

    embedded.obj : error LNK2019: unresolved external symbol
    "__declspec(dll import) void * __cdecl WinCE_fopen(cha r const *,char const
    *)" (__imp_?WinCE_f open@@YAPAXPBD0 @Z) referenced in function "void *
    __cdecl
    OpenScriptFile( unsigned short *)" (?OpenScriptFil e@@YAPAXPAG@Z)

    -------------------

    python23.lib does have entries for WinCE_fopen (part of
    wince-compatibility.c ) when looking at the lib file using dumpbin (all
    are undecorated). Have I missed some vital step in producing it?


    Just to clarify my environment, I am producing a PocketPC 2003
    application that embeds Python, scripts are launched within our
    application with script output displayed in our own output window. We
    also provide our own Python extension library. All works on ok on the
    desktop version.

    Any help would gratefully appreciated. Thanks.

    Martin

  • Martin Evans

    #2
    Re: Linking to Python for Windows CE

    Sorry, false alarm. It turned out one of my own files was using
    fopen/fclose and this was upseting things. After removing those it
    linked fine.

    Martin Evans wrote:
    [color=blue]
    > I've just been tasked with porting our desktop embedded Python support
    > onto our existing CE offering. I've managed to compile the Python
    > sources and have produced an armdbg420\pytho n23.lib file.
    >
    > When I come to link to the Python library though from our one of our
    > DLLs, I am getting the following unresolved externals:
    >
    > -------------------
    > embedded.obj : error LNK2019: unresolved external symbol
    > "__declspec(dll import) int __cdecl WinCE_fclose(vo id *)"
    > (__imp_?WinCE_f close@@YAHPAX@Z ) referenced in function "unsigned long
    > __cdecl PythonThread(vo id *)" (?PythonThread@ @YAKPAX@Z)
    >
    > embedded.obj : error LNK2019: unresolved external symbol __imp_LoadLibra ryU
    > referenced in function "unsigned long __cdecl PythonThread(vo id *)"
    > (?PythonThread@ @YAKPAX@Z)
    >
    > embedded.obj : error LNK2019: unresolved external symbol
    > "__declspec(dll import) void * __cdecl WinCE_fopen(cha r const *,char const
    > *)" (__imp_?WinCE_f open@@YAPAXPBD0 @Z) referenced in function "void *
    > __cdecl
    > OpenScriptFile( unsigned short *)" (?OpenScriptFil e@@YAPAXPAG@Z)
    >
    > -------------------
    >
    > python23.lib does have entries for WinCE_fopen (part of
    > wince-compatibility.c ) when looking at the lib file using dumpbin (all
    > are undecorated). Have I missed some vital step in producing it?
    >
    >
    > Just to clarify my environment, I am producing a PocketPC 2003
    > application that embeds Python, scripts are launched within our
    > application with script output displayed in our own output window. We
    > also provide our own Python extension library. All works on ok on the
    > desktop version.
    >
    > Any help would gratefully appreciated. Thanks.
    >
    > Martin
    >[/color]

    Comment

    • Fuzzyman

      #3
      Re: Linking to Python for Windows CE

      There are modified Python sources for Windows CE via the sourceforge
      site :

      http://sourceforge.net/projects/pythonce

      There is now a rudimentary website :

      Download Python Windows CE port for free. Python port for Windows CE (Pocket PC) devices. Intended to be as close to desktop version as possible (console, current directory support, testsuite passed).


      It seems like this project now has traction again. The source has to be
      'hacked' quite a bit to compile for Windows CE and there was concern
      about moving the macros required to do this into the main source, which
      is why it is a separate project.

      The current latest version is 2.3.5 - but this may change soon.

      All the best,

      Fuzzyman
      http://www.voidspace.org.uk/python/index.shtml

      Comment

      • Fuzzyman

        #4
        Re: Linking to Python for Windows CE

        Hmmm... looks like you're already using this. Sorry.

        All the best,

        Fuzzyman
        http://www.voidspace.org.uk/python/index.shtml

        Comment

        Working...