Skip to content

Mingw build problem #169

Closed
ivictbor opened this Issue Jul 11, 2013 · 8 comments

5 participants

@ivictbor

Hi guys! Thank for your job! I successfully used your project on linux ubuntu and arch linux, but now I want to use it on windows. I installed latest mingw, cloned the repo and executed:

./autogen.sh
./configure

But configure crashes with:

./configure: line 4357: syntax error near unexpected token `USB,'
./configure: line 4357: `PKG_CHECK_MODULES(USB, libusb-1.0 >= 1.0.0,,'

What I do wrong? Do I need to install libusb to mingw? Where can I find it? Is there some manual for compiling texane/stlink on windows? You have alredy done a great job, and it should be some approximate instruction for compiling on windows or pre-compiled binarys.
I also tried:

Thanks in advance

@dandev37

Here's a step by step from a clean install to successfully setup MinGW and build libusb-1.0 and stlink for MS Windows. Hopefully this helps someone.

  1. Install MinGW and MSYS to C:\MinGW with the graphical installer from http://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download and add these packages:

    • mingw32-base
    • mingw-developer-toolkit
  2. Add C:\MinGW\bin to your path.

  3. Create an C:\MinGW\msys\1.0\etc\fstab file to mount C:\MinGW as /mingw as per http://www.mingw.org/wiki/MSYS

#Win32_Path     Mount_Point
c:/mingw        /mingw
  1. Download these three glib, pkg-config, pkg-config-dev archives and extract contents to C:\MinGW

  2. Download latest libusb-1.0 source from git://git.libusb.org/libusb.git and build (prefix as per http://www.mingw.org/wiki/MSYS)

./autogen.sh
./configure --prefix=/mingw
make
make install
  1. Repeat for stlink source from https://github.com/texane/stlink
./autogen.sh
./configure --prefix=/mingw
make
make install
  1. Enjoy the fruits of the stlink developers.
@texane
Owner
@ivictbor

Thank you very much for tutorial! I also can add, that at stage 2 I add path also to c:\MinGW\msys\1.0\bin(becouse I used MSYS bash to run build). So I had done "Win+R, cmd, enter, bash, enter" and there I executed ./autogen.sh .
All works for me!

@ivictbor ivictbor closed this Jan 26, 2014
@dandev37

FYI, if you want to connect your stlink/v2 to a USB 3.0 hub (as in most modern PCs and laptops), you must use the more recent libusb repository. Under step 5, use https://github.com/libusb/libusb instead. I have issued a pull request to update the instructions.

@texane
Owner
texane commented Mar 1, 2014
@gdema
gdema commented Sep 10, 2014

Hi, I never use mingw before. When I come to build the application, I obtain the following error:

image

Have you any suggestion?

@realblades

I recall mingw once having problems with long/odd path names (STLINK~1). I may remember wrong.

Did you try looking at (the end of) config.log like it suggests? You should be able to spot the way the compiler test failed.

@gdema
gdema commented Sep 11, 2014

Hi,
the problem is due to the proxy: after disabling the proxy and installing again mingw, I can now successfully build the software.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.