473,699 Members | 2,119 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

libraries with distutils

Hi I have a question about writing a portable setup.py script for distutils.

I have a directory structure like this.

| |------ FreeImage.h
| |------FreeImage.lib
| |------FreeImage.dll

|----------freeimagemodule .c

I want to create a setup file that works on both unix and Windows but I
am having trouble with windows.
My setup.py file is like the following:

from distutils.core import setup, Extension

ext_module = Extension('free imagewrapper',
define_macros = [('MAJOR_VERSION ', '3'),
('MINOR_VERSION ', '7')],
include_dirs = ['../../Source/'],
libraries = ['FreeImage'],
sources = ['freeimagemodul e.c'])

setup (name = 'freeimage',
version = '1.0',
author = 'Glenn Pierce',
description = 'Python wrapper for the freeimage library',
ext_modules = [ext_module])
I am getting link errors as vs can't seem to find ../../Dist/FreeImage.lib

The output is

running build
running build_ext
building 'freeimagewrapp er' extension
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\li nk.exe /DLL
Files\Python24\ libs"
"/LIBPATH:C:\Prog ram Files\Python24\ PCBuild" FreeImage.lib
/EXPORT:initfree image
wrapper build\temp.win3 2-2.4\Release\fre eimagemodule.ob j
/OUT:build\lib.w in32-2.
4\freeimagewrap per.pyd
/IMPLIB:build\te mp.win32-2.4\Release\fre eimagewrapper.l ib

The errors are like

Creating library build\temp.win3 2-2.4\Release\fre eimagewrapper.l ib and
build\temp.win3 2-2.4\Release\fre eimagewrapper.e xp
freeimagemodule .obj : error LNK2019: unresolved external symbol
_FreeImage_Unlo a
d referenced in function _destroy

Also I guess when the python module is installed it will still need to
find FreeImage.dll in a libray path searched by the system or will
distutils place the actual dll and lib files where thay can be found ?

I have read the distutils guide but wasn't clear on the library section
for ext modules.

Thanks for any help.


Jul 19 '05 #1
0 1447

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Robert Ferrell | last post by:
I'm trying to do some debugging of python extensions on Windows2K. MS Visual Studio (.NET) says it can't find the debug version of the python libraries. (The message is "python.exe does not contain any debugging information".) I installed the binaries from the Windows installer. How should I get the debug libraries? Or is that even what I need? I'm kind of new to Windows, and Visual Studio in particular, so maybe I'm way off base. ...
by: Mathieu Malaterre | last post by:
Hello, I thought this would be easy but I guess I didn't get the distutil feeling. I am trying to write a setup for install my package but I don't understand how to do that. organisation: setup.py /bin/
by: Colin J. Williams | last post by:
The distutils download page has: -------------------------------------------------------- Current stable release The current stable release is Distutils 1.0.2; you can download it as: * Distutils-1.0.2.tar.gz (source distribution) (233k) * Distutils-1.0.2.zip (source distribution) (274k) * Distutils-1.0.2.win32.exe (Windows installer) (187k)
by: Terry Hancock | last post by:
Some time ago, I got the idea that I wanted to build image resources from vector graphic originals, instead of marshalling hundreds of tiny little icon images by hand. I wrote "BuildImage" to do this for me, and so far, it works very well, so I'm trying to make it easier to use and available to more developers. There is a brief (and somewhat dated) tutorial explaining what BuildImage itself does at:
by: Frans Englich | last post by:
This is silly. How do I access data files I've installed with distutils? In a portable, generic way, I want to find out what is the following path on most systems: /usr/local/lib/python2.4/lib/site-packages/foo/bar.txt How do I figure out the rest, if I know foo/bar.txt? sys.prefix doesn't get me far. I've googled, and looked in the python reference. I must be blind if the
by: ajikoe | last post by:
Hello I tried to combine c++ and python together. So I follow from this website: http://kortis.to/radix/python_ext/ I have this code: # prmodule.c static PyObject *pr_isprime(PyObject *self, PyObject *args){ int n, input; if (!PyArg_ParseTuple(args, "i", &input))
by: Bo Peng | last post by:
Dear list, My python modules depend on a few boost libraries. For convenience, I include the source code of these libraries with my distribution and treat them as standard source files. This results in huge cc.exe command lines and I get an error saying error: command 'cc' failed: Invalid argument under win32/mingw. (I am not quite sure this is the reason though.) How can I let setup.py build these boost libraries separately so that I
by: Alexandre Guimond | last post by:
Hi. I want to create a portable setup.py file for windows / linux for an extension package that i need to link with external libraries (gsl and boost). on windows i do something like this: imaging = Extension( 'pyag.imaging._imaging', sources = ( glob.glob( 'Source/pyag/imaging/Src/*.cpp' ) + glob.glob(
by: Alexandre Guimond | last post by:
Hi. I just noticed that the "libraries" options under the section in setup.cfg doesn't seem to get expanded. In particular, in distutils.command.build_ext.py of python 2.4. (line147): if type(self.libraries) is StringType: self.libraries = though library_dirs for example gets split on ';' (line 156) elif type(self.library_dirs) is StringType:
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.