Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - LDmicro/MicroChipStudio Build C Solution error

(you are viewing a thread; or go back to list of threads)

LDmicro/MicroChipStudio Build C Solution error (by Carey)
Hello,
I'd like to thank OnosTech for posting this tutorial on using Microchip studio and LDmicro to directly deploy to Arduino controllers. I have LD Micro installed at "C:\LDmicro" and my test Blink project at "C:\LDmicro\Projects\blink" I have set my GCC variables in buildAvr.bat to;

::SET GCC_PATH=%ProgramFiles%\Atmel\AVR-Gcc-8.2.0
SET GCC_PATH=C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin
::SET GCC_PATH=%ProgramFiles%\Atmel\Atmel Studio 6.0\extensions\Atmel\AVRGCC\3.4.0.65\AVRToolchain
::SET GCC_PATH=%ProgramFiles%\Arduino\hardware\tools\avr\bin
::SET GCC_PATH=%ProgramFiles%\Labcenter Electronics\Proteus 8.7 SP3 Professional\Tools\ARDUINO\hardware\tools\avr\bin
::SET GCC_PATH=%ProgramFiles%\Labcenter Electronics\Proteus 8 Professional\Tools\ARDUINO\hardware\tools\avr\bin
::SET GCC_PATH=D:\01 - Programas Plc\Atmel\AVR-Gcc-8.2.0
::SET GCC_PATH=D:\01 - Programas Plc\Arduino 1.8.0\hardware\tools\avr
::SET GCC_PATH=D:\WinAVR
::SET GCC_PATH=c:\WinAVR-20100110
::SET GCC_PATH=c:\avr-gcc-9.1.0-x64-mingw
::SET GCC_PATH=c:\avr8-gnu-toolchain-win32_x86

PATH %GCC_PATH%\BIN;%PATH%

I have added the following string to my PATH env variable as installed on my computer: "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin"

When I run Build C Solution, i get repetitive errors that look like this:

C:\LDmicro\Projects\blink>avr-gcc.exe -I" " -I" "\AVRGCC\lib\ -funsigned-char -funsigned-bitfields -O1 -fpack-struct -fshort-enums -g2 -Wall -c -std=gnu99 -MD -MP -mmcu="atmega2560" -MF AVRGCC\obj\AdcLib.d -MT AVRGCC\obj\AdcLib.d -MT AVRGCC\obj\AdcLib.o " "\AVRGCC\lib\AdcLib.c -o AVRGCC\obj\AdcLib.o
avr-gcc.exe: error: \AVRGCC\lib\AdcLib.c: No such file or directory
avr-gcc.exe: fatal error: no input files
compilation terminated.

"C:\LDmicro\Projects\blink\AVRGCC\lib" is a valid path in my blink project"

How do I go about troubleshooting this issue?

Thanks in advance for your help,
-Carey
Thu Jul 1 2021, 11:03:39
(no subject) (by José)
Hi Carey

There seem to be 2 pbs in your command line:

"\AVRGCC\lib\..." refer to absolute paths, ie "C:\AVRGCC\lib\..." which don't exist.
You should have "AVRGCC\lib..." as relative paths (without initial \) to refer to "C:\LDmicro\Projects\blink\AVRGCC\lib\..." which must be good.

Edit the .bat file containing those instructions ?

José
Thu Jul 1 2021, 16:00:32
(no subject) (by Carey Kiernan)
I'll certainly give it a try, Appreciate the help.
Thu Jul 1 2021, 16:50:35
(no subject) (by Carey)
the beginning of the error dump is here:

Running script = C:\LDmicro\build5411\buildAvr.bat
Working dir = " "
File name = "blink"
Target name = "atmega328"
...

C:\LDmicro\build5411\Projects\blink>chdir
C:\LDmicro\build5411\Projects\blink

C:\LDmicro\build5411\Projects\blink>if not exist AVRGCC\lib\UsrLib.c copy C:\LDmicro\build5411\\LIBRARIES_FOR\AVR\*.* AVRGCC\lib

C:\LDmicro\build5411\Projects\blink>dir AVRGCC\lib\*.c
Volume in drive C is Windows
Volume Serial Number is 7E21-02B4

Directory of C:\LDmicro\build5411\Projects\blink\AVRGCC\lib

07/01/2021 05:43 PM 1,679 AdcLib.c
07/01/2021 05:43 PM 7,349 I2CLib.c
07/01/2021 05:43 PM 9,284 LcdI2cLib.c
07/01/2021 05:43 PM 14,243 PwmLib.c
07/01/2021 05:43 PM 2,295 RomLib.c
07/01/2021 05:43 PM 2,356 SpiLib.c
07/01/2021 05:43 PM 941 UartLib.c
07/01/2021 05:43 PM 3,175 UsrLib.c
8 File(s) 41,322 bytes
0 Dir(s) 37,542,391,808 bytes free

C:\LDmicro\build5411\Projects\blink>SET GCC_PATH=C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin

C:\LDmicro\build5411\Projects\blink>PATH C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\BIN;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\WINDOWS\System32\OpenSSH\;C:\LDmicro;;C:\Program Files\Microchip\xc8\v2.31\bin;C:\Users\Carey\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin;

C:\LDmicro\build5411\Projects\blink>FOR %F in (AVRGCC\lib\*.c) do avr-gcc.exe -I" " -I" "\AVRGCC\lib\ -funsigned-char -funsigned-bitfields -O1 -fpack-struct -fshort-enums -g2 -Wall -c -std=gnu99 -MD -MP -mmcu="atmega328" -MF AVRGCC\obj\%~nF.d -MT AVRGCC\obj\%~nF.d -MT AVRGCC\obj\%~nF.o " "\AVRGCC\lib\%~nF.c -o AVRGCC\obj\%~nF.o

C:\LDmicro\build5411\Projects\blink>avr-gcc.exe -I" " -I" "\AVRGCC\lib\ -funsigned-char -funsigned-bitfields -O1 -fpack-struct -fshort-enums -g2 -Wall -c -std=gnu99 -MD -MP -mmcu="atmega328" -MF AVRGCC\obj\AdcLib.d -MT AVRGCC\obj\AdcLib.d -MT AVRGCC\obj\AdcLib.o " "\AVRGCC\lib\AdcLib.c -o AVRGCC\obj\AdcLib.o
avr-gcc.exe: error: \AVRGCC\lib\AdcLib.c: No such file or directory
avr-gcc.exe: fatal error: no input files
compilation terminated.

C:\LDmicro\build5411\Projects\blink>avr-gcc.exe -I" " -I" "\AVRGCC\lib\ -funsigned-char -funsigned-bitfields -O1 -fpack-struct -fshort-enums -g2 -Wall -c -std=gnu99 -MD -MP -mmcu="atmega328" -MF AVRGCC\obj\I2CLib.d -MT AVRGCC\obj\I2CLib.d -MT AVRGCC\obj\I2CLib.o " "\AVRGCC\lib\I2CLib.c -o AVRGCC\obj\I2CLib
^Cavr-gcc.exe: error: \AVRGCC\lib\I2CLib.c: No such file or directory
avr-gcc.exe: fatal error: no input files
compilation terminated.
Terminate batch job (Y/N)?

If you look at the PATH you'll notice that it contains "bin/BIN" (PATH C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\BIN;) and then it has the path to "avr8-gnu-toolchain\bin" at the end of the path. If you look at my PATH from a command prompt, it looks like:

C:\Users\Carey>echo %PATH%
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\WINDOWS\System32\OpenSSH\;C:\LDmicro;;C:\Program Files\Microchip\xc8\v2.31\bin;C:\Users\Carey\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin;

Does anyone have any ideas on how to figure out what's happening here? Thanks
Thu Jul 1 2021, 18:55:51
(no subject) (by OnosTech)
Try to Save As from the File menu in another folder and recompile again.
Fri Jul 2 2021, 11:37:24
(no subject) (by José)
The pb remains in the "\" as said before.
avr-gcc.exe is launched correctly (so the path is good) but it can't find files to compile because of those "\".

Please post as attached file the .bat file that you're running, but rename it before in .txt because the forum doesn't accept batch files (risk of viruses I suppose).

BR
José
Fri Jul 2 2021, 14:37:03
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):