Go to Post When I see stuff like that, sometimes I say, "That's BRILLIANT, why didn't I think of that?" But I never like the answer. - dtengineering [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-01-2004, 15:45
Obi's Avatar
Obi Obi is offline
Registered User
#0870
 
Join Date: Jan 2004
Location: Southold
Posts: 18
Obi is an unknown quantity at this point
Error Message

I'm getting the following error message:
"Warning [2058] call of function without prototype" when I try to do the following code:
printf("Seconds: %d \n",seconds);
Problems?
  #2   Spotlight this post!  
Unread 24-01-2004, 16:19
doy's Avatar
doy doy is offline
#1208 Ex-Lead Programmer
AKA: Jesse Luehrs
#1208 (The Super Critical Axe Men)
Team Role: Alumni
 
Join Date: Jan 2004
Location: O'Fallon, IL
Posts: 27
doy is on a distinguished road
Send a message via AIM to doy
Re: Error Message

Quote:
Originally Posted by Obi
I'm getting the following error message:
"Warning [2058] call of function without prototype" when I try to do the following code:
printf("Seconds: %d \n",seconds);
Problems?
you need to put
Code:
#include "printf_lib.h"
at the beginning of every file that you want to use printf in, or else the compiler will yell at you like that.
  #3   Spotlight this post!  
Unread 24-01-2004, 16:54
Damian Manda's Avatar
Damian Manda Damian Manda is offline
The Damian
no team
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Fort Collins, CO
Posts: 154
Damian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud ofDamian Manda has much to be proud of
Send a message via AIM to Damian Manda
Re: Error Message

This doesnt have to do with the function being prototyped, but when it works, you will need to change your statement to:

Quote:
Originally Posted by Obi
printf("Seconds: %d \n",(int)seconds);
Otherwise you will not get the value that you want.
--Damian Manda

Last edited by Damian Manda : 24-01-2004 at 16:55. Reason: Bolded (int)
  #4   Spotlight this post!  
Unread 24-01-2004, 18:44
echos's Avatar
echos echos is offline
Jack of all trades
#1125
Team Role: Programmer
 
Join Date: Dec 2003
Location: San Diego, CA
Posts: 61
echos will become famous soon enough
Send a message via ICQ to echos Send a message via AIM to echos Send a message via MSN to echos Send a message via Yahoo to echos
Re: Error Message

Type casting is not the problem here. Even if the type cast is wroung the program will still compile, you'll just get undesired results thats all. Kinda like this

Code:
 Printf("4 + 4 = %d");
 //this could return anything like "4 + 4 = 4098
 //now how did that happen?
__________________

Entity Hosting Staff
http://www.entityhosting.com/
  #5   Spotlight this post!  
Unread 24-01-2004, 20:10
Jay Lundy Jay Lundy is offline
Programmer/Driver 2001-2004
FRC #0254 (The Cheesy Poofs)
Team Role: Alumni
 
Join Date: Jun 2001
Rookie Year: 2001
Location: Berkeley, CA
Posts: 320
Jay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to all
Re: Error Message

The syntax error has already been pointed out. Damian was just pointing out a much harder to find logic error.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 20:23.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi