Giter Site home page Giter Site logo

MinGW/make errors about libdeflate HOT 8 CLOSED

ebiggers avatar ebiggers commented on September 7, 2024 1
MinGW/make errors

from libdeflate.

Comments (8)

ebiggers avatar ebiggers commented on September 7, 2024

Two problems:

1.) The MinGW distribution you're using does not put standard UNIX tools on the PATH, most critically a shell sh. To me this seems pretty broken and you should report it to the author of the distribution (how is anyone's makefile supposed to work without a sh?). Oddly enough, the distribution does include such tools in its git\bin and git\usr\bin directories and they do appear to work, but they are not added to PATH by the batch script you're supposed to run.

2.) The MinGW distribution only installs the compiler as plain gcc, not as x86_64-w64-mingw-gcc. This means you'll need to build with make CC=gcc. I also found that libdeflate's Makefile did not work properly in this (somewhat legitimate) case, so I've fixed it and also updated the README.

from libdeflate.

JoeUX avatar JoeUX commented on September 7, 2024

That's very helpful. At first I was puzzled by your references to git\bin and git\usr\bin since I didn't have any such directories in the MinGW install. Then I realized I chose his "without-git" build since I already have git installed separately. I had no idea I needed to put sh on my path until now. So I did that and the build runs through to the error at bottom:

CC       lib/aligned_malloc.pic.o
  CC       lib/deflate_decompress.pic.o
  CC       lib/x86_cpu_features.pic.o
  CC       lib/deflate_compress.pic.o
  CC       lib/adler32.pic.o
  CC       lib/zlib_decompress.pic.o
  CC       lib/zlib_compress.pic.o
  CC       lib/crc32.pic.o
  CC       lib/gzip_decompress.pic.o
  CC       lib/gzip_compress.pic.o
  CCLD     libdeflate.so
  CC       lib/aligned_malloc.o
  CC       lib/deflate_decompress.o
  CC       lib/x86_cpu_features.o
  CC       lib/deflate_compress.o
  CC       lib/adler32.o
  CC       lib/zlib_decompress.o
  CC       lib/zlib_compress.o
  CC       lib/crc32.o
  CC       lib/gzip_decompress.o
  CC       lib/gzip_compress.o
  AR       libdeflate.a
  GEN      programs/config.h
  CC       programs/gzip.o
  CC       programs/prog_util.o
  CC       programs/tgetopt.o
  CCLD     gzip
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o):crt0_c.c:(.text.startup+0x2e): undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:177: gzip] Error 1

Any ideas? I'm not sure what these Linux .a binaries are doing in this context.

Conversely, I was able to successfully compile using nmake, but that took a lot of digging and modifications to the .msc file, pointing it to the right includes, and only succeeds when using a special VS command line interface. I can write that up separately. The Windows C runtime and libraries were refactored for Windows 10, and relocated.

from libdeflate.

ebiggers avatar ebiggers commented on September 7, 2024

That's what I was referencing in (2); the Makefile didn't detect that just gcc could be MinGW. If you use the latest "master" from the git repository it should work.

from libdeflate.

ebiggers avatar ebiggers commented on September 7, 2024

I'm also surprised to hear that the Visual Studio / MSC build was so difficult to get working. I understand that for the command-line Microsoft tools to work at all to build any program, you need to have your command prompt set up with the appropriate environmental variables by using the dedicated shortcut or by sourcing vcvarsall. So that is a given. With regards to things being changed for Windows 10, I cannot say one way or another, but I would be surprised for them to have broken everything. But if you believe any specific changes are needed on my side then please go ahead and propose them (I don't regularly use the Microsoft tools).

from libdeflate.

JoeUX avatar JoeUX commented on September 7, 2024

Ah, sorry. Now it works!

On the nmake side, I had to add these paths to CFLAGS: -I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\ucrt" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include"

And I had to use the Visual Studio x64 Native Tools Command Prompt (the one highlighted in the attached screenshot -- there are lots of command prompts.) If I use any other, I always get a linker error that it can't open msvcrt.lib. It's a mess.
vs command prompt

from libdeflate.

ebiggers avatar ebiggers commented on September 7, 2024

Hmm. Well, I am closing this issue since your original problem was resolved, to the extent I could on my side. Feel free to do some more research into the problems with VS2015 if you are interested.

from libdeflate.

JoeUX avatar JoeUX commented on September 7, 2024

Roger that. Thanks for your help.

from libdeflate.

bolunfeng avatar bolunfeng commented on September 7, 2024

Roger that. Thanks for your help.

D:\software\libdeflate>make
此时不应有 -Wpedantic。
此时不应有 -Wdeclaration-after-statement。
此时不应有 -Wmissing-prototypes。
此时不应有 -Wstrict-prototypes。
此时不应有 -Wvla。
系统找不到指定的路径。
'flags' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
Makefile:179: recipe for target '.lib-cflags' failed
make: *** [.lib-cflags] Error 1

I want to build the project on windows 10 with MinGW,but I get the error.who can help me?

from libdeflate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.