Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make static command doesnot work on Windows ,with minGW #26

Closed
dogeFu opened this issue Nov 21, 2018 · 5 comments
Closed

make static command doesnot work on Windows ,with minGW #26

dogeFu opened this issue Nov 21, 2018 · 5 comments

Comments

@dogeFu
Copy link

dogeFu commented Nov 21, 2018

I did as the README says. use "make static" command to build this library.But it failed.

this is the error:
./configure
process_begin: CreateProcess(NULL, env bash D:\Librarys\libimagequant-master\configure, ...) failed.
make (e=2):
mingw32-make: *** No rule to make target 'config.mk', needed by 'pam.o'. Stop.

I am not good at Makefile build system.Don't know what is going on.

Any help will be appreciated~

BTW, msvc brunch build fail with VS2015 too...

@kornelski
Copy link
Member

Is that all output you have?

The second error "No rule to make target 'config.mk'" just means the ./configure didn't run.

However, "process_begin: CreateProcess(NULL, env bash D:\Librarys\libimagequant-master\configure, ...) failed." doesn't really mean anything. There are dozens of ways in which ./configure can fail, so it's hard to say what's going on without more information.


Another option is to use Rust/Cargo to build it for MSVC (note that MinGW is not compatible with MSVC projects).

I'm assuming you're building 64-bit executable for 64-bit Windows:

@dogeFu
Copy link
Author

dogeFu commented Nov 22, 2018

Is that all output you have?

The second error "No rule to make target 'config.mk'" just means the ./configure didn't run.

However, "process_begin: CreateProcess(NULL, env bash D:\Librarys\libimagequant-master\configure, ...) failed." doesn't really mean anything. There are dozens of ways in which ./configure can fail, so it's hard to say what's going on without more information.

Another option is to use Rust/Cargo to build it for MSVC (note that MinGW is not compatible with MSVC projects).

I'm assuming you're building 64-bit executable for 64-bit Windows:

* Run https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe (say yes to default config)

* Reboot (to update `PATH` otherwise `cargo.exe` won't be found)

* Run `cargo build --release` in libimagequant directory. It will create `target/release/libimagequant.lib` (or `*.a` or similar).

Yes,that was all I got.
I think minGW's make command doesn't work in this project, or there muse be something I did wrong.
I build a Rust version too, but, it's a 64-bit lib. I need a 32-bit lib for my vc++ project.

@dogeFu
Copy link
Author

dogeFu commented Nov 22, 2018

I use MSYS2 to build it, and get a 32-bit "libimagequant.a" file ;

But when I build my project, which links libimagequant.a and libgcc.a as the REMEAD says.
this error shows :

LNK2019:unresolved external symbol ___getreent, referenced at _liq_crash_if_invalid_handle_pointer_given.constprop.19
LNK2019:unresolved external symbol _vsnprintf, referenced at _liq_verbose_printf
LNK2001:unresolved external symbol _vsnprintf.

looks like this issue : https://github.com/kornelski/pngquant/issues/41

I tried as the issue said, link a "libmingwex.a" with my project , It didn't work...

Windows is just so unflattering , isn't it...

@kornelski
Copy link
Member

kornelski commented Nov 25, 2018

These uresolved symbols look like you've tried to use MinGW library with Visual Studio. They are incompatible in many subtle, but crashy ways. You can only use MinGW gcc with MinGW-only projects. And for Visual Studio projects you must use Microsoft's compiler.

If you have an existing Visual Studio project, then add the .c files to it.

@dogeFu
Copy link
Author

dogeFu commented Nov 26, 2018

I buiild the msvc-branch with openMP option turn off , and it works.

thanks for your help.

@dogeFu dogeFu closed this as completed Nov 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants