Hot![SOLVED] Getting started with MCC - can't build blank project

Author
ttshaw1
New Member
  • Total Posts : 6
  • Reward points : 0
  • Joined: 2017/08/03 17:13:17
  • Location: 0
  • Status: offline
2018/07/16 18:47:02 (permalink)
0

[SOLVED] Getting started with MCC - can't build blank project

Hi,
 
I'm trying to make a simple project that'll run a timer, generate an interrupt every second, and toggle an LED in the timer interrupt service routine. But I haven't been able to get the project to compile at even the most basic level.
 
MCC version:    
3.55.1
 
MPLAB X version:    
4.20
 
Operating System and version:    
Linux Mint 19
 
Compiler version:    
XC16 v1.35
 
Device name:    
PIC18FJ256GA702
 
1. New project, Microchip Embedded -> Standalone Project, PIC24FJ256GA702, PICkit 4, XC16, name it and set it as main project.
2. Open MCC. Generate code from the default configuration.
3. Try to build it.
 
This results in errors that say
"In function `L13':
: undefined reference to `_main'"
which cause the build to fail. Any ideas what I'm doing wrong?
post edited by ttshaw1 - 2018/09/13 17:05:27

Attached Image(s)

#1

3 Replies Related Threads

    ttshaw1
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2017/08/03 17:13:17
    • Location: 0
    • Status: offline
    Re: Getting started with MCC - can't build blank project 2018/07/17 16:33:35 (permalink)
    0
    I was able to solve that issue by going into the project properties and unchecking "Use legacy libc" under the XC16 options. The next issue cropped up shortly afterwards. I tried adding a TMR1 module in MCC and got the error
    "In function `_SYSTEM_Initialize':
    : undefined reference to `_TMR1_Initialize'" when I tried to build the project.
     
    I found a quick and dirty fix for this is to add "include #"tmr1.c"" to mcc.c. I don't know if this results in working code but it compiles. But I'd rather find the elegant solution.
     
    It seems like the way it should work is mcc.c has mcc.h included, which includes tmr1.h, which has the declaration for TMR1_Initialize(), but somehow this isn't what the compiler sees.
     
    Thanks in advance for your input.
    #2
    IonutB
    Moderator
    • Total Posts : 105
    • Reward points : 0
    • Joined: 2008/08/04 09:43:55
    • Location: 0
    • Status: offline
    Re: Getting started with MCC - can't build blank project 2018/09/13 03:30:43 (permalink)
    3 (1)
    This issue has been solved in MCC v3.65. Please use this version, or any version released after this one.
     
    Thank you
    #3
    ttshaw1
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2017/08/03 17:13:17
    • Location: 0
    • Status: offline
    Re: Getting started with MCC - can't build blank project 2018/09/13 17:04:27 (permalink)
    0
    Solved after upgrading to MPLAB X IDE v5.00 and MCC v3.65
    #4
    Jump to:
    © 2018 APG vNext Commercial Version 4.5