jd-boyd / python-lzo

Python bindings for the LZO data compression library
GNU General Public License v2.0
74 stars 41 forks source link

lzo.lib file not found error in Windows 10 #49

Closed jerokpradeep closed 1 year ago

jerokpradeep commented 4 years ago

Hi, While trying to install this I'm getting this error. The lzo.lib is not found anywhere in the library as well under the src folder. Please help as I know I'm doing something worn over here.

LINK : fatal error LNK1181: cannot open input file 'C:\src\lzo-2.09\lzo.lib' error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\link.exe' failed with exit status 1181

Thanks Pradeep K

Tuo-ZHANG commented 3 years ago

Same issue here, have you solved it?

maxgerhardt commented 3 years ago

I've gotten it to work with the following procedure (prerequisites: VisualStudio + CMake installed):

  1. Download and extract the .tar.gz file as noted in https://github.com/jd-boyd/python-lzo#windows
  2. Extract it in C:\src\lzo-2.09\*source files here*
  3. Open a new shell in the directory above
  4. mkdir build && cd build
  5. cmake ..
  6. Project files for VisualStudio should be generated. Open lzo.sln.
  7. Build the lzo_static sub-project
  8. You should now have a C:\src\lzo-2.09\build\Release\lzo2.lib
  9. Duplicate above file as C:\src\lzo-2.09\lzo.lib
  10. Open a new shell where you've downloaded Python-LZO
  11. set LZO_DIR=C:\src\lzo-2.09
  12. python.exe setup.py install
  13. Should now end with Finished processing dependencies for ubidump==1.0.0 without error.
>python ubidump.py
usage: ubidump.py [-h] [--savedir DIRECTORY] [--preserve] [--cat FILE] [--listfiles] [--dumptree] [--verbose]
                  [--debug] [--encoding ENCODING] [--masteroffset MASTEROFFSET] [--root ROOT] [--rawdump]
                  [--volume VOLUME] [--hexdump LEB:OFF:N] [--nodedump LEB:OFF]
                  FILES [FILES ...]
ubidump.py: error: the following arguments are required: FILES
Ozzy4201 commented 1 year ago

How can i open a shell where i have downloaded Python-LZO to set the LZO_DIR when i need to set the LZO_DIR to install python-lzo?

maxgerhardt commented 1 year ago

You can download Python-LZO without installing it, I just meant you git clone this repository (or zip downloaded it).

Python-LZO and the LZO (C) source code are two different things.

jd-boyd commented 1 year ago

This should be fixed with 1.15.

endless-creation commented 1 month ago

I encountered this problem trying to install python-lzo==1.15 with lzo version 2.10. My system is running Windows 11, using 2022 BuildTools

maxgerhardt commented 1 month ago

Encountered meaning you encountered and solved it? Installing python-lzo 1.15 still works fine for me. Cmake and Visual Studio 2022 Build Tools (with C++ Desktop tools installed), I used this method in a Developer Terminal for VS 2022, with a base path of C:\Users\Max\temp\.

grafik

(Adapt paths as needed.)

git clone -b "v1.15" https://github.com/jd-boyd/python-lzo.git
cd python-lzo
cd lzo-2.10
mkdir build && cd build
cmake -G "Visual Studio 17 2022" ..
msbuild lzo_static_lib.vcxproj -p:Configuration=Release;Platform=x64;OutDir=C:\Users\Max\temp\python-lzo\lzo-2.10\

That should have generated C:\Users\Max\temp\python-lzo\lzo-2.10\lzo2.lib

Then just

pip install .

in the original python-lzo directory (C:\Users\Max\temp\python-lzo\) in this example.

endless-creation commented 1 month ago

Yes correct, I basically followed those steps with a couple differences -- I just wasn't aware that building the lzo2.lib was required, it wasn't clear from the README. Thanks