CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2009
    Posts
    19

    Link python26.lib to my app

    Hello all,

    I'm having troubles linking python statically to my application
    I downloaded the python's sources and compiled, all good
    I added the library as a dependency (python26.lib)
    compilation succeed

    BUT, when I run the application its looking for the python26.dll !!!

    what is the problem here ?
    anybody knows ?

    thanx
    Eli

  2. #2
    Join Date
    Jan 2009
    Posts
    35

    Re: Link python26.lib to my app

    Have you put python26.dll into the same directory as your .exe file?

  3. #3
    Join Date
    Aug 2009
    Posts
    19

    Re: Link python26.lib to my app

    no
    I mean if I statically link python26.lib to my app
    why do I need the dll ?
    am I missing something ?

  4. #4
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Link python26.lib to my app

    Quote Originally Posted by Rockem View Post
    Hello all,

    I'm having troubles linking python statically to my application
    I downloaded the python's sources and compiled, all good
    I added the library as a dependency (python26.lib)
    Did you build an import library or static library? Just stating "I added the library" doesn't mean anything until you can clarify which one you built, either import or static library.

    Regards,

    Paul McKenzie

  5. #5
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Link python26.lib to my app

    Quote Originally Posted by Rockem View Post
    no
    I mean if I statically link python26.lib to my app
    Either you created a static library and then linking it, or you created a DLL and you are linking the import library that was created when the DLL was created.

    In other words, you may have built a new python DLL, and you're using the .LIB file that the DLL created, thinking that this .LIB file is a static library (when it isn't).

    OR

    You may need to tell your app via preprocessor constant(s) that you are using the static library when you build your app, so that your app doesn't assume you're using the DLL. The app could have macros, pragmas, etc. that are changed or turned on/off, depending on how the python code is to be called (via DLL or object code that was linked in).

    Regards,

    Paul McKenzie
    Last edited by Paul McKenzie; November 3rd, 2009 at 11:01 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured