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

Mingw build problem #169

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

Mingw build problem #169

ivictbor opened this issue Jul 11, 2013 · 8 comments

Comments

@ivictbor
Copy link

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
Copy link
Contributor

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
Copy link
Collaborator

texane commented Jan 25, 2014

Thanks. I added your comments as INSTALL.mingw

2014/1/24 dandev37 notifications@github.com

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.

Install MinGW and MSYS to C:\MinGW with the graphical installer from
http://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/downloadand 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

4.

Download these three glib, pkg-config, pkg-config-dev archives and
extract contents to C:\MinGW
- http://win32builder.gnome.org/packages/3.6/glib_2.34.3-1_win32.zip
-
http://win32builder.gnome.org/packages/3.6/pkg-config_0.28-1_win32.zip
-
http://win32builder.gnome.org/packages/3.6/pkg-config-dev_0.28-1_win32.zip
5.

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

./autogen.sh
./configure --prefix=/mingw
make
make install

6.

Repeat for stlink source from https://github.com/texane/stlink

./autogen.sh
./configure --prefix=/mingw
make
make install

7.

Enjoy the fruits of the stlink developers.


Reply to this email directly or view it on GitHubhttps://github.com//issues/169#issuecomment-33275976
.

@ivictbor
Copy link
Author

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!

@dandev37
Copy link
Contributor

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
Copy link
Collaborator

texane commented Mar 1, 2014

request merged, thanks !

2014-02-28 21:26 GMT+01:00 dandev37 notifications@github.com:

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.

Reply to this email directly or view it on GitHubhttps://github.com//issues/169#issuecomment-36390895
.

@gdema
Copy link

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?

@ghost
Copy link

ghost commented Sep 11, 2014

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
Copy link

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

@Nightwalker-87 Nightwalker-87 added this to the v1.2.0 and older milestone Feb 25, 2020
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Apr 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants