Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How can i compile this C Sources?

Status
Not open for further replies.

The Puma

Full Member level 2
Full Member level 2
Joined
Apr 4, 2002
Messages
134
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Visit site
Activity points
895
c2c- plus picant

Hallo,

I have three C sources

**broken link removed**
**broken link removed**
**broken link removed**

Which compiler can i use the compile this?
I used the C2C-Plus, but i get a lot of errors

Please help me
 

c2c lcd.c

What kind of errors do you get? This may be an incorrectly set-up project in picant. Otherwise it should work
 

gam said:
What kind of errors do you get? This may be an incorrectly set-up project in picant. Otherwise it should work

I have put the three source files ( lcd-example.c/lcd873.c and lcd873.h ) in a directory

I use Sourceboost for compiling
Make a new project with filename lcd in the directory where the files are.

Then add the three files to the project ( in workspace )

Then go to the settings menu option "Toolsuite" and choose C2C-Plus
and option "Target" to PIC16F873

Then do "Compile"
i get the following errors:

Compiling...

F:\SOURCE~1\c2c.exe -PPIC16F873 -SRC -ols -md -O2 -Ip16F873.inc -oLcd.asm lcd.c Lcd873.c

C2C-plus 5.4e C-compiler Copyright(C) 1998-99,2000-2004 by Pavel Baranov
**broken link removed**
support@picant.com
(Extended version, trial period day 3)

Licensed to: not registered


lcd.c
Lcd873.c(731): Warning: Possible truncation to 8-bit
Lcd873.c(732): Warning: Possible truncation to 8-bit
Lcd873.c(978): Warning: Possible truncation to 8-bit
Lcd873.c(1050): Warning: Possible truncation to 8-bit
Lcd873.c(1051): Warning: Possible truncation to 8-bit
Lcd873.c(1329): Warning: Possible truncation to 8-bit
Lcd873.c(1350): Warning: Possible truncation to 8-bit
Lcd873.c(1397): Warning: Possible truncation to 8-bit
Lcd873.c(1418): Warning: Possible truncation to 8-bit
Lcd873.c(1427): Warning: Possible truncation to 8-bit
Lcd873.c(1461): Warning: Possible truncation to 8-bit
Lcd873.c(1470): Warning: Possible truncation to 8-bit
Lcd873.c(1493): Warning: Possible truncation to 8-bit
Lcd873.c(1495): Warning: Possible truncation to 8-bit
lcd.c(134): Warning: Possible truncation to 8-bit
lcd.c(205): Warning: Truncation from 16-bit to 8-bit
lcd.c(209): Warning: Truncation from 16-bit to 8-bit
Lcd873.c
Lcd873.c(26): Error: The function 'input_pin_port_b' is already defined
Lcd873.c(48): Error: General error
Lcd873.c(50): Error: General error
Lcd873.c(53): Error: General error
Lcd873.c(53): Error: General error
Lcd873.c(53): Error: General error
Lcd873.c(54): Error: General error
Lcd873.c(59): Error: The function 'input_pin_port_c' is already defined
Lcd873.c(81): Error: General error
Lcd873.c(83): Error: General error
Lcd873.c(86): Error: General error
Lcd873.c(86): Error: General error
Lcd873.c(86): Error: General error
Lcd873.c(87): Error: General error
Lcd873.c(92): Error: The function 'input_pin_port_a' is already defined
Lcd873.c(114): Error: General error
Lcd873.c(116): Error: General error
Lcd873.c(119): Error: General error
Lcd873.c(119): Error: General error
Lcd873.c(119): Error: General error
Lcd873.c(120): Error: General error
Lcd873.c(135): Error: The function 'lcd_AutoSend' is already defined
Lcd873.c(138): Error: General error
Lcd873.c(159): Error: The function 'lcd_AutoStatusCheck' is already defined
Lcd873.c(163): Error: General error
Lcd873.c(176): Error: General error
Lcd873.c(181): Error: General error in function definition

Finished.
Done

Failed


Whats is gooing wrong
Please can you help me with this problem

Grtz
John
 

Why 3 source files to project?

You have only 2 source files and 1 include file....
at least this would explain the "already defined" error...

The other "general" errors look strange...did you check the file for strange LF/CR characters?


anyway...this:
Code:
  char  i[8] =
  {
   00000001b,
   00000010b,
   00000100b,
   00001000b,
   00010000b,
   00100000b,
   01000000b,
   10000000b
   };

  pinNumber = pinNumber & 00000111b;
  pinNumber = i[pinNumber];

looks like very bad/inefficient c-coding to me (o;


why not:

Code:
pinNumber = 0x01 << (pinNumber & 0x07);

?
 

Possible truncation warning has to do with datatypes
char can have 8 bits and if you want to assign an int (16 bits or 32 bits) to a char you can have a possible truncation. Since it's someone else's code => ignore and think he has checked it!

Lcd873.c(26): Error: The function 'input_pin_port_b' is already defined
comes from old or new c2c version. I do not use this compiler or this source so don't ask any other questions about it.
just read the header file:
Code:
#ifdef   old_C2C
char input_pin_port_b(char pinNumber);
char input_pin_port_c(char pinNumber);
char input_pin_port_a(char pinNumber);
#endif
=> check where you defined old_C2C

the other 'already defined' errors probably have the same cause

I always hate the non descriptive errors
eg: 'general error'
this is clearly a great compiler you're using ;-)
Since the one i've seen are located in the functions that were already defined, you probably will solve this error too with NOT defining old_C2C

now i don't have any idea of the workings of your compiler, other files in your project, ... . I just can tell by analyzing the files is that the old_C2C issue will probably solve your problem

Antharax

------
Funny message i found on the internet about compiler error messages:

These are some of the error messages produced by Apple's MPW C compiler. These are all real. (If you must know I was bored one afternoon and decompiled the String resources for the compiler.) The compiler is 324k in size so these are just an excerpt I hope. I'm not sure where I stand on the copyright issue. Tony Cunningham

"String literal too long (I let you have 512 characters, that's 3 more than ANSI said I should)"

"...And the lord said, 'lo, there shall only be case or default labels inside a switch statement'"

"a typedef name was a complete surprise to me at this point in your program"

"'Volatile' and 'Register' are not miscible"

"You can't modify a constant, float upstream, win an argument with the IRS, or satisfy this compiler"

"This struct already has a perfectly good definition"

"type in (cast) must be scalar; ANSI 3.3.4; page 39, lines 10-11 (I know you don't care, I'm just trying to annoy you)"

"Can't cast a void type to type void (because the ANSI spec. says so, that's why)"

"Huh ?"

"can't go mucking with a 'void *'"

"we already did this function"

"This label is the target of a goto from outside of the block containing this label AND this block has an automatic variable with an initializer AND your window wasn't wide enough to read this whole error message"

"Call me paranoid but finding '/*' inside this comment makes me suspicious"

"Too many errors on one line (make fewer)"

"Symbol table full - fatal heap error; please go buy a RAM upgrade from your local Apple dealer"
 

I don't know about C2C but usually when I compile multi-file code,

I only put
#include "*.h"
No
#include "*.c"

Then I include the sources I need in MPLAB (with Hi-tech C)
 

By the way, there is an application for C2C that allows you to integrate it with MPLAB, google for "C2C rocket". Or maybe it is on the picant website directly.

Personally I would suggest HI-Tech
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top