954,496 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

simple problem i think

Program wont run error says
1>c:\users\owner\documents\visual studio 2008\projects\ia\ia\jb bakery.c(16) : warning C4013: 'sleep' undefined; assuming extern returning int
1>Linking...
1>JB Bakery.obj : error LNK2019: unresolved external symbol _sleep referenced in function _welcome
1>C:\Users\Owner\Documents\Visual Studio 2008\Projects\IA\Debug\IA.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Users\Owner\Documents\Visual Studio 2008\Projects\IA\IA\Debug\BuildLog.htm"
1>IA - 2 error(s), 2 warning(s)

#include<stdio.h>
#include<conio.h>
#include<time.h>

void welcome();

int main()
{
	welcome();
	
	getch();
}
void welcome()
{
	printf("\nWELCOME");
	sleep (1000);
	printf("JB Bakery Interface");
	

}
jaymayne
Newbie Poster
13 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

try to include the header unistd.h

zeroliken
Veteran Poster
1,106 posts since Nov 2011
Reputation Points: 201
Solved Threads: 162
 
try to include the header unistd.h

What you think this is a Unix/Linux based system?

gerard4143
Nearly a Posting Maven
2,272 posts since Jan 2008
Reputation Points: 512
Solved Threads: 387
 
What you think this is a Unix/Linux based system?


my bad... is it windows.h then?

zeroliken
Veteran Poster
1,106 posts since Nov 2011
Reputation Points: 201
Solved Threads: 162
 

Where is sleep() defined?

WaltP
Posting Sage w/ dash of thyme
Moderator
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 
Where is sleep() defined?


I never knew i had to declare a sleep function how would i declare it

jaymayne
Newbie Poster
13 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

Depends on what you want it to do. You have to figure that out and write the function.

Or is there a different problem you have not expressed correctly?

WaltP
Posting Sage w/ dash of thyme
Moderator
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

Depends on what you want it to do. You have to figure that out and write the function.

Or is there a different problem you have not expressed correctly?

the problem is ive never used the time.h function before so i searched the internet and i thought just by doing it in the format in the code posted that it would work so could u lead me in the right direction

jaymayne
Newbie Poster
13 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: