469,575 Members | 1,193 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,575 developers. It's quick & easy.

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


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('freeimagewrapper',
define_macros = [('MAJOR_VERSION', '3'),
('MINOR_VERSION', '7')],
include_dirs = ['../../Source/'],
libraries = ['FreeImage'],
sources = ['freeimagemodule.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 'freeimagewrapper' extension
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\link.exe /DLL
"/LIBPATH:C:\Program Files\Python24\PCBuild" FreeImage.lib
wrapper build\temp.win32-2.4\Release\freeimagemodule.obj

The errors are like

Creating library build\temp.win32-2.4\Release\freeimagewrapper.lib and
freeimagemodule.obj : error LNK2019: unresolved external symbol
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 1303

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Robert Ferrell | last post: by
1 post views Thread by Mathieu Malaterre | last post: by
15 posts views Thread by Colin J. Williams | last post: by
1 post views Thread by Terry Hancock | last post: by
7 posts views Thread by Frans Englich | last post: by
6 posts views Thread by ajikoe | last post: by
1 post views Thread by Bo Peng | last post: by
1 post views Thread by Alexandre Guimond | last post: by
reply views Thread by Alexandre Guimond | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.