Developer forums (C::B DEVELOPMENT STRICTLY!) > Contributions to C::B
problem with ZLIB
thomas:
Sorry, not using Visual C++...
MortenMacFly:
Me not eighter. :|
To be honest: If I encounter trouble with VC(6) projects I convert them into C::B. I really find C::B easier to understand when it comes to project settings and stuff. This might be an option for you, too (if you are hopefully not using MFC?!).
Michael:
--- Quote from: MortenMacFly on February 24, 2006, 08:00:53 pm ---You want to use *.lib -> use a MS compiler (such as MSVC Toolkit, it's free).
You want to use *.a -> use e.g. the MinGW compiler.
--- End quote ---
I have always believed that .lib was just for M$ compiler, but the libxml2 library used by Dev-C++ is a libxml2.lib and not a libxml2.a :? (as I was expecting). Anyway, it works :).
Probably it is a .lib done for MinGW and not for M$ a compiler.
--- Quote from: MortenMacFly on February 24, 2006, 08:00:53 pm ---There is also a way to convert *.lib to *.a if you really need to use MinGW. Here is how it's done for python:
Create libpython22.a
To create Python extensions, you need to link against the Python library. Unfortunately, most Python distributions are provided with Python22.lib, a library in Microsoft Visual C++ format. GCC expects a .a file (libpython22.a to be precise.). Here's how to convert python22.lib to libpython22.a:
1. Download pexport (from here or http://starship.python.net/crew/kernr/mingw32/pexports-0.42h.zip).
2. Get Python22.dll (it should be somewhere on your harddrive).
3. Run : pexports python22.dll > python22.def
This will extract all symbols from python22.dll and write them into python22.def.
4. Run : dlltool --dllname python22.dll --def python22.def --output-lib libpython22.a
This will create libpython22.a (dlltool is part of MinGW utilities).
5. Copy libpython22.a to c:\python22\libs\ (in the same directory as python22.lib).
"This trick should work for all Python versions, including future releases of Python. You can also use this trick to convert other libraries."
Morten.
--- End quote ---
Thanks for posting this example. Very useful :D.
Best wishes,
Michael
MortenMacFly:
--- Quote from: Michael on February 25, 2006, 04:43:49 pm ---Thanks for posting this example. Very useful :D.
--- End quote ---
The credits go to a webpage I unfortunately have forgotten to bookmark - somewhere near google... ;-)
maxest:
MortenMacFly: i know i'm a little mad but not crazy enough to use MFC :P i tried to make myself learn this, at least a little.. but i just couldn't :D
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version