Difference between revisions of "MINGW Development Package(MAC OS)"
(→Program the Hex file into SJOne board) |
(→Program the Hex file into SJOne board) |
||
Line 70: | Line 70: | ||
|- | |- | ||
+ | | | ||
+ | '''2.''' Open lpc1758_freertos Project | ||
+ | <br/> | ||
+ | * Right click on the lpc1758_freertos project | ||
+ | * Choose '''Open Project''' | ||
+ | | [[File:open_project.png|left|frame|100px|Create New Eclipse C++ Project]] | ||
+ | <BR/> | ||
+ | |||
+ | |- | ||
+ | | | ||
+ | '''3.''' Write your source code | ||
+ | <br/> Copy the simple source code on the right. | ||
+ | | | ||
+ | <syntaxhighlight lang="c"> | ||
+ | #include <stdio.h> | ||
+ | |||
+ | int main(void) | ||
+ | { | ||
+ | /* Without this, printf() will not work */ | ||
+ | setvbuf(stdout, 0, _IONBF, 0); | ||
+ | setvbuf(stdin, 0, _IONBF, 0); | ||
+ | |||
+ | /* Write rest of your code here */ | ||
+ | printf("Hello World\n"); | ||
+ | return 0; | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | |- | ||
+ | | | ||
+ | '''4.''' Run your program | ||
+ | <br/> | ||
+ | * Click on the the harmmer button and start building your code | ||
+ | * build_with_dbc option will also generate the dbc file in _can_dbc directory | ||
+ | | [[File:Build_code.png|left|frame|100px|Run your project]] | ||
|} | |} |
Revision as of 18:46, 25 December 2016
This tutorial shows you how to compile a C/C++ program in Mac OS using Eclipse. Remember that GNU is the linux-based compiler and hence if we want to use it for Mac OS, we have to have certain executable(s) to be running in Mac OS.
Contents
Development Package
You can get the same development package as the one we promote for ARM processors.
- Get the Development Package and unzip to an absolute directory such as Desktop
- SourceForge SJSU Development Package
- The unzipped path should not have spaces
Required Package
You might need to get and install the following package:
- Command Line Tools
Open Eclipse and Create New Project
1. Open Eclipse.
|
|
2. Open lpc1758_freertos Project
|
|
3. Write your source code
|
#include <stdio.h>
int main(void)
{
/* Without this, printf() will not work */
setvbuf(stdout, 0, _IONBF, 0);
setvbuf(stdin, 0, _IONBF, 0);
/* Write rest of your code here */
printf("Hello World\n");
return 0;
} |
4. Run your program
|
Program the Hex file into SJOne board
1. Open Eclipse.
|
|
2. Open lpc1758_freertos Project
|
|
3. Write your source code
|
#include <stdio.h>
int main(void)
{
/* Without this, printf() will not work */
setvbuf(stdout, 0, _IONBF, 0);
setvbuf(stdin, 0, _IONBF, 0);
/* Write rest of your code here */
printf("Hello World\n");
return 0;
} |
4. Run your program
|