|
|
View previous topic :: View next topic |
Author |
Message |
tom Guest
|
compile, build files in mplab |
Posted: Mon May 03, 2004 5:39 pm |
|
|
Hi,
I'm using mplabide 6.50, PCWH3.41 which has PCM3.181, I try to compile two simple files. As follows:
"main.c"
#include <16F877.h>
#include <i2c_master.c>
#fuses HS, NOWDT,NOPROTECT, NOLVP
#use delay(clock = 20000000)
void main()
{
init_I2c_master();
}
"i2c_master.c"
void init_I2c_master()
{
;
}
However I kept get such error message
Executing: "C:\Program files\Picc\CCSC.exe" "main.c" +FM +DF +LN +T -A +M +Z +Y=9 +EA
>>> Warning 208 "C:\main.c" Line 30(1,2): Function not void and does not return a value
Memory usage: ROM=0% RAM=3% - 3%
0 Errors, 1 Warnings.
Executing: "C:\Program files\Picc\CCSC.exe" "i2c_master.c" +FM +DF +LN +T -A +M +Z +Y=9 +EA
*** Error 128 "C:\i2c_master.c" Line 8(1,1): A #DEVICE required before this line
Halting build on first failure as requested.
BUILD FAILED: Mon May 03 16:38:42 2004
Anyone know what's wrong?
Thanks
Tom
It keeps |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Mon May 03, 2004 5:51 pm |
|
|
You *don't* need to compile the i2c_master.c file separately. Since it is included in the main file it will be merged and compiled automatically when you compile main.c.
But in case you are wondering about the cause of the error; anything you compile in CCS basically has to start with a #device statement. Your main.c is including PIC16F877.h, which has a #device on the top of it. But your i2c_master.c doesn't include that file directly and it doesn't have a #device in its main body either so it won't compile.
Last edited by Haplo on Mon May 03, 2004 5:55 pm; edited 1 time in total |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon May 03, 2004 5:52 pm |
|
|
Are you "adding" the i2c_master.c file to the MPLAB project ?
If so, don't do that. The only file that you should "add" to
the Source Files section of the Project Windows is main.c.
[Edit - Haplo, you beat me by one minute ]
Last edited by PCM programmer on Mon May 03, 2004 6:01 pm; edited 1 time in total |
|
|
Tom Guest
|
|
Posted: Mon May 03, 2004 6:00 pm |
|
|
Yes, I remove the I2c_master.c from project, it works well now, also it still prints error, if I2c_master.c is wrong.
Thanks a lot!
Tom |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Mon May 03, 2004 6:23 pm |
|
|
Tom, happy to hear it is working now.
PCM, it's ok, your answer contained a very important point that I forgot to mention in my post |
|
|
Guest
|
|
Posted: Tue May 04, 2004 1:02 am |
|
|
Hi!
I had another problem using MPLAB 6.5 (and 6.51, too) with PCM 3.184.
Every time I try to build my source, I get this message:
Executing: "C:\Program Files\PICC\Ccsc.exe" main.c +FM +p
No Errors
Skipping link step. Not all sources built successfully.
BUILD FAILED: Mon May 03 09:53:24 2004
System information:
Win NT (SP6)
MPLAB 6.5
ICD 2
My source worked well under MPLAB 6.43! But this IDE version had other problems, so I decided to use MPLAB 6.5!
I think it's not a compiler problem, but don't know what to do yet!
Any solutions?
Thanks a lot...
LK@ms |
|
|
AdrianoPegoraro Guest
|
Build problem on MPLAB 6.50 |
Posted: Tue May 04, 2004 1:07 pm |
|
|
Hello,
yes, I'm experiencing the same problem as you, even with my PCM version 3.187, running under Win98. I still don't know how to solve this problem, but I think I'm going to try an older version of MPLAB, as you said it worked, maybe 6.4x.
Sincerely,
Adriano.
Anonymous wrote: | Hi!
I had another problem using MPLAB 6.5 (and 6.51, too) with PCM 3.184.
Every time I try to build my source, I get this message:
Executing: "C:\Program Files\PICC\Ccsc.exe" main.c +FM +p
No Errors
Skipping link step. Not all sources built successfully.
BUILD FAILED: Mon May 03 09:53:24 2004
System information:
Win NT (SP6)
MPLAB 6.5
ICD 2
My source worked well under MPLAB 6.43! But this IDE version had other problems, so I decided to use MPLAB 6.5!
I think it's not a compiler problem, but don't know what to do yet!
Any solutions?
Thanks a lot...
LK@ms |
|
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Tue May 04, 2004 3:08 pm |
|
|
Quote: |
Every time I try to build my source, I get this message:
Executing: "C:\Program Files\PICC\Ccsc.exe" main.c +FM +p
No Errors
Skipping link step. Not all sources built successfully.
BUILD FAILED: Mon May 03 09:53:24 2004
|
Did you try enabling '+EW' in the compiler command options to get a clue
regarding such error?
Also post the most relevant of your code (headers, #includes, etc) to give us a chance to help you better.
Humberto |
|
|
lk@ms
Joined: 04 May 2004 Posts: 1
|
|
Posted: Wed May 05, 2004 2:20 am |
|
|
Hello Humberto!!
Thanks for reply...
Yes, I tried also the +EW or the +EA command, but get the same result!
To make it easier for u, I'd like to post my whole code:
Code: | #if defined(__PCM__)
#include <16f877.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=4000000)
#endif
#define DAC_LOAD PIN_B1
#define SPI_DO PIN_C5
#define SPI_CLK PIN_C3
void main()
{ int i=1;
set_tris_b(0x00);
output_low(DAC_LOAD);
setup_spi(spi_master | spi_h_to_l | spi_clk_div_64);
do
{
output_high(DAC_LOAD);
spi_write(0x0);
switch(i)
{
case 1: spi_write(0x00);
i=2;
break;
case 2: spi_write(0x64);
i=1;
break;
default: break;
}
output_low(DAC_LOAD);
}while(1);
}
|
I only get the "Condition always TRUE" message for while(1);
During writing this text, I looked in the program memory and noticed that it is empty, although all files (e.g. *.cof, *.hex) are available in the project folder.
So I tried this:
Import the *.cof (or *.cod) file after building the project by hand
(the "builded failed" message still appears)
The memory is filled up!
After programming the device with my ICD2, I set a breakpoint in the project to analyse the debugmode.
You always get the "The project is out of date"-message while hit the run-button for the first time!
Ignore it and it will work...
It's not a good solution, but it worked!
Any other ideas would be appreciated...
@Adriano: Maybe you can try it on Win98, too! Let us know...
Kind regards!!!
lk@ms |
|
|
Adriano Pegoraro
Joined: 04 May 2004 Posts: 1 Location: Porto Alegre, Brazil
|
Build on MPLAB 6.50 |
Posted: Wed May 05, 2004 7:19 am |
|
|
Hei Ik@ms,
I've tried to build my program on MPLAB 6.40, instead of 6.50, and it worked! I followed your tip on your previous message. For me, it's going good so far. Usually the last versions of MPLAB are unstable, and it's preferable to take older ones...
Regards,
Adriano. |
|
|
GMP
Joined: 22 Sep 2003 Posts: 2 Location: Rosenberg, TX
|
Skipping Link Step msg in MPLAB IDE 6.5x |
Posted: Mon Jun 28, 2004 12:17 pm |
|
|
Hi all,
This may have already been cleared up elsewhere by now but I didn't find it.
It appears that newer MPLAB IDE versions (V6.5X) will give a message to the effect of:
Executing: "C:\Program Files\PICC\PCM\Ccsc.exe" control_PD.c
No Errors
Skipping link step. Not all sources built successfully.
BUILD FAILED: Mon Jun 28 13:11:41 2004
This occurs when the "CCS C Compiler" toolsuit is selected. Instead select "CCS C Compiler for PIC12/14/16/18" from Project->Select Language Toolsuit.
GMP |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|