[python] BOOST_PYTHON_MODULE() causing .lib generation?

Hi, I'm currently using MSVC 9 with Boost 1.34.1. When I create a boost module using BOOST_PYTHON_MODULE(), I notice that my application is generating a .lib and .exp files when my application is a .exe (I'm embedding python, not extending into a library). I have no need for my application to generate a .lib file, is there a way I can disable the generation of this library file? Thanks.

Robert Dailey wrote:
Hi,
I'm currently using MSVC 9 with Boost 1.34.1. When I create a boost module using BOOST_PYTHON_MODULE(), I notice that my application is generating a .lib and .exp files when my application is a .exe (I'm embedding python, not extending into a library). I have no need for my application to generate a .lib file, is there a way I can disable the generation of this library file?
Have a look at the libs/python/test/exec.cpp test (and its build process). It sounds as if you are trying to do the same thing, i.e. generating an extension module, but keeping it with the embedded python interpreter in the main application. HTH, Stefan -- ...ich hab' noch einen Koffer in Berlin...

On Mon, Feb 25, 2008 at 3:29 PM, Stefan Seefeld <seefeld@sympatico.ca> wrote:
Have a look at the libs/python/test/exec.cpp test (and its build process). It sounds as if you are trying to do the same thing, i.e. generating an extension module, but keeping it with the embedded python interpreter in the main application.
Thanks for your response. I looked at exec.cpp but I didn't notice anything in there that would help resolve my issue. You also mentioned to check out the build process, which I have no idea how to do. Could you give me a little more guidance? Thank you.

Robert Dailey wrote:
Thanks for your response. I looked at exec.cpp but I didn't notice anything in there that would help resolve my issue. You also mentioned to check out the build process, which I have no idea how to do. Could you give me a little more guidance? Thank you.
It doesn't sound as if your problem is with the code, but rather with how you compile / link it. So, looking at the exec.cpp code wouldn't help you. I'm suggesting that you actually build the exec.cpp test (using bjam) and compare the compile and link commands to the ones you are using in your own project. I have no experience with MSVC 9 and thus can't help you make that compile your project properly, I'm afraid. Regards, Stefan -- ...ich hab' noch einen Koffer in Berlin...

On Mon, Feb 25, 2008 at 5:36 PM, Stefan Seefeld <seefeld@sympatico.ca> wrote:
It doesn't sound as if your problem is with the code, but rather with how you compile / link it. So, looking at the exec.cpp code wouldn't help you. I'm suggesting that you actually build the exec.cpp test (using bjam) and compare the compile and link commands to the ones you are using in your own project. I have no experience with MSVC 9 and thus can't help you make that compile your project properly, I'm afraid.
Likewise, I have no experience with bjam. So if you could specifically tell me what files to look at and also where in the file to look I'd appreciate it. Thanks again for your continued help.

Robert Dailey wrote:
On Mon, Feb 25, 2008 at 5:36 PM, Stefan Seefeld <seefeld@sympatico.ca> wrote:
It doesn't sound as if your problem is with the code, but rather with how you compile / link it. So, looking at the exec.cpp code wouldn't help you. I'm suggesting that you actually build the exec.cpp test (using bjam) and compare the compile and link commands to the ones you are using in your own project. I have no experience with MSVC 9 and thus can't help you make that compile your project properly, I'm afraid.
Likewise, I have no experience with bjam. So if you could specifically tell me what files to look at and also where in the file to look I'd appreciate it. Thanks again for your continued help.
I'm not sure you would find help in any particular file. However, the problem does sound rather simple: you want to build an executable when you actually build a library. That sounds like a pretty simple but fundamental setting in your project file. HTH, Stefan -- ...ich hab' noch einen Koffer in Berlin...

On Mon, Feb 25, 2008 at 7:00 PM, Stefan Seefeld <seefeld@sympatico.ca> wrote:
I'm not sure you would find help in any particular file.
However, the problem does sound rather simple: you want to build an executable when you actually build a library. That sounds like a pretty simple but fundamental setting in your project file.
I think I see where you're confused. What I meant to say from the very beginning is that I DO build an executable, however the linker ALSO outputs a .LIB file. In my project settings I have it setup to build an application (EXE), not a library! When I comment out the BOOST_PYTHON_MODULE() code, the library is no longer generated.

On 26/02/2008, Robert Dailey <rcdailey@gmail.com> wrote:
On Mon, Feb 25, 2008 at 7:00 PM, Stefan Seefeld <seefeld@sympatico.ca> wrote:
I'm not sure you would find help in any particular file.
However, the problem does sound rather simple: you want to build an executable when you actually build a library. That sounds like a pretty simple but fundamental setting in your project file.
I think I see where you're confused. What I meant to say from the very beginning is that I DO build an executable, however the linker ALSO outputs a .LIB file. In my project settings I have it setup to build an application (EXE), not a library! When I comment out the BOOST_PYTHON_MODULE() code, the library is no longer generated.
The boost python module code creates exports in your program. The ms linker will always generate a lib file for any dll/exe with exports. There is no option (at least in .net 2003) to not generate the .lib

On Tue, Feb 26, 2008 at 3:04 AM, Simon Hammett <div0@users.sourceforge.net> wrote:
The boost python module code creates exports in your program. The ms linker will always generate a lib file for any dll/exe with exports. There is no option (at least in .net 2003) to not generate the .lib
Thank you for your valued response to my inquiry. Will there be support in Boost 1.35 to disable the exports? A simple preprocessor macro would be sufficient I hope.

On 26/02/2008, Robert Dailey <rcdailey@gmail.com> wrote:
On Tue, Feb 26, 2008 at 3:04 AM, Simon Hammett <div0@users.sourceforge.net> wrote:
The boost python module code creates exports in your program. The ms linker will always generate a lib file for any dll/exe with exports. There is no option (at least in .net 2003) to not generate the .lib
Thank you for your valued response to my inquiry. Will there be support in Boost 1.35 to disable the exports? A simple preprocessor macro would be sufficient I hope.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
try BOOST_PYTHON_STATIC_MODULE that's available in version 1.33.1 and presumably later versions.

on Tue Feb 26 2008, "Simon Hammett" <div0-AT-users.sourceforge.net> wrote:
On 26/02/2008, Robert Dailey <rcdailey@gmail.com> wrote:
On Mon, Feb 25, 2008 at 7:00 PM, Stefan Seefeld <seefeld@sympatico.ca> wrote:
I'm not sure you would find help in any particular file.
However, the problem does sound rather simple: you want to build an executable when you actually build a library. That sounds like a pretty simple but fundamental setting in your project file.
I think I see where you're confused. What I meant to say from the very beginning is that I DO build an executable, however the linker ALSO outputs a .LIB file. In my project settings I have it setup to build an application (EXE), not a library! When I comment out the BOOST_PYTHON_MODULE() code, the library is no longer generated.
The boost python module code creates exports in your program. The ms linker will always generate a lib file for any dll/exe with exports. There is no option (at least in .net 2003) to not generate the .lib
If you #define BOOST_PYTHON_STATIC_MODULE as described in http://boost.org/libs/python/doc/v2/configuration.html, it will not try to export symbols for your extension module. -- Dave Abrahams Boost Consulting http://boost-consulting.com

on Mon Feb 25 2008, "Robert Dailey" <rcdailey-AT-gmail.com> wrote:
Hi,
I'm currently using MSVC 9 with Boost 1.34.1. When I create a boost module using BOOST_PYTHON_MODULE(), I notice that my application is generating a .lib and .exp files
I suppose you mean MSVC or Visual Studio is generating .lib and .exp files?
when my application is a .exe (I'm embedding python, not extending into a library). I have no need for my application to generate a .lib file, is there a way I can disable the generation of this library file?
I can't picture what you're describing. However, I suggest strongly that you a) Follow the build advice in the Boost.Python documentation b) Post Boost.Python-related questions in its specific mailing list: http://boost.org/more/mailing_lists.htm#cplussig Good luck, -- Dave Abrahams Boost Consulting http://boost-consulting.com
participants (4)
-
David Abrahams
-
Robert Dailey
-
Simon Hammett
-
Stefan Seefeld