Command Line Compiler mikroCAVR.exe

Beta Testing discussion on mikroC PRO for AVR.
Post Reply
Author
Message
David Prentice
Posts: 8
Joined: 30 Oct 2008 12:23

Command Line Compiler mikroCAVR.exe

#1 Post by David Prentice » 03 Nov 2008 15:26

I am having no success in building a program via the command line. I have copy-pasted the command sent by the IDE and this just gives error messages:
File '__Lib_Math.c' not found
...

I get the same results with the 'example' from the command line options Help page.

It would be nice to get this functioning correctly so that I can investigate the compiler via a Makefile.

David.

User avatar
rajkovic
mikroElektronika team
Posts: 694
Joined: 16 Aug 2004 12:40

Re: Command Line Compiler mikroCAVR.exe

#2 Post by rajkovic » 03 Nov 2008 17:04

David Prentice wrote:I am having no success in building a program via the command line. I have copy-pasted the command sent by the IDE and this just gives error messages:
File '__Lib_Math.c' not found
...

I get the same results with the 'example' from the command line options Help page.

It would be nice to get this functioning correctly so that I can investigate the compiler via a Makefile.

David.
We have changed names of system libraries, and help did not follow that change. We will fix this in help file. Thank you for your report.

here is the functionall example:

Code: Select all

mikrocAVR.exe -MSF -DBG -pATMEGA16 -ES -C -O11111114 -fo8 -N"C:\Program Files\Mikroelektronika\mikroC PRO for AVR\Examples\Development Systems\EasyAVR5A\Led Blinking\LedBlinking.mcpav" -SP"C:\Program Files\Mikroelektronika\mikroC PRO for AVR\Defs" -SP"C:\Program Files\Mikroelektronika\mikroC PRO for AVR\Uses\LTE64KW" -SP"C:\Program Files\Mikroelektronika\mikroC PRO for AVR\Examples\Development Systems\EasyAVR5A\Led Blinking" "LedBlinking.c" "__Lib_Math.mcl" "__Lib_MathDouble.mcl" "__Lib_System.mcl" "__Lib_Delays.mcl"  
Copy paste from IDE must work, if it is not working please copy paste it here so we can see where is the problem and to fix it if there is any

If you need more info about which libraries are supported and their file names you can find that in *.mlk file which is located in INSTALLATION_DIR\defs\.
mlk are xml files that are used by compiler and linker (these files gives description of device and which libraries are suppotred for specific device) . Adding your own custom libraries is possible see
Creating New Library section in help.

In def folder apart mlk files there are *.c files which have all definitions of sfr and sfr bits.

This file is also easy to find by right-clicking for example PORTB in code editor and
selecting find declaration (project for specific mcu must be opened before).

David Prentice
Posts: 8
Joined: 30 Oct 2008 12:23

#3 Post by David Prentice » 03 Nov 2008 23:23

Thanks for your help. I have got a makefile working now. The command line seems to need trailing backslashes for the search path. Although the Windows filesystem understands slashes as path separators, MikroCAvr.exe does not.

Incidentally I have now discovered a "unique" predefined macro __MCPP that I can use to distinguish compilers.

I can use regular library headers to give function prototypes. However you still need the "invisible" "Uses" path for system internal functions. The compiler appears to find the "Defs" path all by itself.

David.

Post Reply

Return to “mikroC PRO for AVR Beta Testing”