Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

Thread: teensy_loader_cli compile error using MinGW

  1. #1
    Junior Member
    Join Date
    Dec 2019
    Posts
    9

    teensy_loader_cli compile error using MinGW

    Hi,
    I'm getting an error message when trying to compile the teensy_loader_cli. I've downloaded the files from https://github.com/PaulStoffregen/teensy_loader_cli and installed MinGW on a windows 10 pc. I've also edited the Makefile included in the download and edited the header as:
    #OS ?= LINUX
    OS ?= WINDOWS
    #OS ?= MACOSX
    #OS ?= BSD

    however when I run the make command I get the following error?

    C:\MinGW\teensy_loader_cli-master>mingw32-make
    rm -f teensy_loader_cli teensy_loader_cli.exe*
    process_begin: CreateProcess(NULL, rm -f teensy_loader_cli teensy_loader_cli.exe*, ...) failed.
    make (e=2): The system cannot find the file specified.
    Makefile:59: recipe for target 'clean' failed
    mingw32-make: *** [clean] Error 2

    Do I need to edit anything else ? just keen to compile the cli code.

    cheers

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,467
    It's trying to run "rm" to delete a file.

    Either install a "rm" program, or edit the makefile to use dos "del" command.

  3. #3
    Junior Member
    Join Date
    Feb 2020
    Posts
    4
    Quote Originally Posted by jeff0778 View Post
    Hi,
    I'm getting an error message when trying to compile the teensy_loader_cli. I've downloaded the files from https://github.com/PaulStoffregen/teensy_loader_cli and installed MinGW on a windows 10 pc. I've also edited the Makefile included in the download and edited the header as:
    #OS ?= LINUX
    OS ?= WINDOWS
    #OS ?= MACOSX
    #OS ?= BSD

    however when I run the make command I get the following error?

    C:\MinGW\teensy_loader_cli-master>mingw32-make
    rm -f teensy_loader_cli teensy_loader_cli.exe*
    process_begin: CreateProcess(NULL, rm -f teensy_loader_cli teensy_loader_cli.exe*, ...) failed.
    make (e=2): The system cannot find the file specified.
    Makefile:59: recipe for target 'clean' failed
    mingw32-make: *** [clean] Error 2

    Do I need to edit anything else ? just keen to compile the cli code.

    cheers


    Were you successful? I'm quite new to the CLI code myself and had to make a couple of adjustments to the make file to get it to compile as well.

  4. #4
    Junior Member
    Join Date
    Dec 2019
    Posts
    9
    Thanks, it looks like I did have rm installed but needed to add a separate PATH in the windows environment variables of "C:\MinGW\msys\1.0\bin"
    It no longer throws up the original error, although it doesn't really do anything now. it just returns the last line in the make file ?

    c:\teensy_loader>mingw32-make
    rm -f teensy_loader_cli teensy_loader_cli.exe*

    if i remove the -f force and replace it with -v i get the following:

    c:\teensy_loader>mingw32-make
    rm -v teensy_loader_cli teensy_loader_cli.exe*
    rm: cannot lstat `teensy_loader_cli': No such file or directory
    rm: cannot lstat `teensy_loader_cli.exe*': No such file or directory
    Makefile:59: recipe for target 'clean' failed
    mingw32-make: *** [clean] Error 1

    have you any pointers to how i can get this to compile ?

    Cheers

  5. #5
    Junior Member
    Join Date
    Feb 2020
    Posts
    4
    I do.

    After you installed MinGW, did you add it's main and Bin paths to your environmental variables? you can check this by going to command prompt and entering "gcc -v." this command is what should be placed in the make file for your CC value (e.g. CC = gcc)

    At the end (line 59 as noted in your last post) something about the file can't get cleaned; most likely because it doesn't exist. I changed that filename from: teensy_loader_cli teensy_loader_cli.exe* to teensy_loader_cli teensy_loader_cli.exe (no star which isn't a valid character in windows OS).

    let me know if this helps...I've recently compiled mine in the last week so it's still fresh in my memory.

  6. #6
    Junior Member
    Join Date
    Dec 2019
    Posts
    9
    Thanks,
    I've added
    C:\MinGW, C:\MinGW\bin & C:\MinGW\msys\1.0\bin to the environment variables but it still doesn't seem to compile.

    if i run gcc -v in the command prompt i get, which looks ok.

    C:\teensy_loader>gcc -v
    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wrapper.exe
    Target: mingw32
    Configured with: ../src/gcc-6.3.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --target=mingw32 --with-gmp=/mingw --with-mpfr --with-mpc=/mingw --with-isl=/mingw --prefix=/mingw --disable-win32-registry --with-arch=i586 --with-tune=generic --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-pkgversion='MinGW.org GCC-6.3.0-1' --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --enable-libgomp --disable-libvtv --enable-nls
    Thread model: win32
    gcc version 6.3.0 (MinGW.org GCC-6.3.0-1)


    Is your Makefile using the uncommented OS ?= WINDOWS ??
    As this seems to use "CC ?= i586-mingw32msvc-gcc", but I've also tried it with "CC ?= gcc" and "CC ?= gcc -v" with the same out come.

    I've also tried removing the * at the end of the last line under clean as you suggested, but still the same.

  7. #7
    Junior Member
    Join Date
    Dec 2019
    Posts
    9
    I think i might have got this working now.

    I've abandoned the Makefile and just typed the following gcc command, which seems to have build and .exe file.

    C:\teensy_loader>gcc -Wall -s -DUSE_WIN32 -o teensy_loader_cli.exe teensy_loader_cli.c -lhid -lsetupapi -lwinmm


    I've removed the -O2 flag, not sure if that will be an issue ?

    I've done a small test and it looks to be working.

  8. #8
    Junior Member
    Join Date
    Feb 2020
    Posts
    4
    Quote Originally Posted by jeff0778 View Post
    I think i might have got this working now.

    I've abandoned the Makefile and just typed the following gcc command, which seems to have build and .exe file.

    C:\teensy_loader>gcc -Wall -s -DUSE_WIN32 -o teensy_loader_cli.exe teensy_loader_cli.c -lhid -lsetupapi -lwinmm


    I've removed the -O2 flag, not sure if that will be an issue ?

    I've done a small test and it looks to be working.

    glad to hear it worked!

    I did a quick google search (because I wasn't too familiar with it myself) and found that although there may be some performance benefit, I am not sure if its significant; nor do I know if they apply to mingw installations; the information below seems a bit outdated.

    "We suggest that you use the '-O2' switch in all of your compilations; it increases speed and decreases the program size at the cost of compilation time."

    http://tigcc.ticalc.org/doc/comopts.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •