🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.ms-windows.programmer.misc
4 messages
4 total messages Started by Nicholas Cory Williams Thu, 14 Mar 1996 01:32
Help needed using C's conio.h functions.
#2818
Author: Nicholas Cory Williams
Date: Thu, 14 Mar 1996 01:32
38 lines
1620 bytes
I am trying to program a game that was origianlly going to be for DOS until
I realised that my Turbo C/C++ compiler for Windows only compiled for windows.
Now, I have to find a way of using basic text windows or something to output
my text card game.
I thought I had found the perfect solution when I found functions like
cprintf and window and clrscr, etc. in the conio.h library however, they
won't work.

#include<conio.h>

int main(void)
{
	clrscr();
	window(10, 10, 20, 20);
	cprintf("Hello world\r\n");
	getch();
	return 0;
}

This program gives me these warnings and errors:
Warning WINDOW.C 6: Call to function 'window' with no prototype in function
main
Warning WINDOW.C 7: Call to function 'cprintf' with no prototype in function
main
Linker Error: Undefined symbol _cprintf in module WINDOW.C
Linker Error: Undefined symbol _window in module WINDOW.C

I think I have all my directories set up right, (all my other functions
work fine with calls to other libraries).

Might this have something to do with me running all this under Win95? Is there
something else I need to do to get these to work? I tried putting in
prototypes for these functions but that only got rid of the warnings.

Please help me....

Nick.
Re: Help needed using C's conio.h functions.
#2819
Author: Polver
Date: Thu, 14 Mar 1996 03:57
3 lines
643 bytes
I believe that the functions in the conio.h file are not meant to be used
in windows applications. The conio.h stuff is just for DOS. Or something
like that.
Re: Help needed using C's conio.h functions.
#2820
Author: John Grant
Date: Thu, 14 Mar 1996 05:09
48 lines
2261 bytes
In article <4i7sun$49j@darkstar.UCSC.EDU> nwaussie@cats.ucsc.edu (Nicholas Cory Williams) writes:
>
>I am trying to program a game that was origianlly going to be for DOS until
>I realised that my Turbo C/C++ compiler for Windows only compiled for windows.
>Now, I have to find a way of using basic text windows or something to output
>my text card game.
>I thought I had found the perfect solution when I found functions like
>cprintf and window and clrscr, etc. in the conio.h library however, they
>won't work.
>
>#include<conio.h>
>
>int main(void)
>{
>	clrscr();
>	window(10, 10, 20, 20);
>	cprintf("Hello world\r\n");
>	getch();
>	return 0;
>}
>
>This program gives me these warnings and errors:
>Warning WINDOW.C 6: Call to function 'window' with no prototype in function
>main
>Warning WINDOW.C 7: Call to function 'cprintf' with no prototype in function
>main
>Linker Error: Undefined symbol _cprintf in module WINDOW.C
>Linker Error: Undefined symbol _window in module WINDOW.C
>
>I think I have all my directories set up right, (all my other functions
>work fine with calls to other libraries).
>
>Might this have something to do with me running all this under Win95? Is there
>something else I need to do to get these to work? I tried putting in
>prototypes for these functions but that only got rid of the warnings.
>
>Please help me....
	
	You asked a question about DOS vs Windows & Turbo C++ for Windows a
	few days ago. I answered it. In my answer, I told you all about
	<conio.h> and gave you some advice about DOS & Windows programming
	Either you ignored it or you didn't bother reading the reply.
	I used my newsreader to find the article for you and I have e-mailed
	it to you. You need to read more carefully.
-- 
John A. Grant						jagrant@emr1.emr.ca
Airborne Geophysics
Geological Survey of Canada, Ottawa
Re: Help needed using C's conio.h functions.
#2821
Author: Doug & Rose Miller
Date: Sun, 17 Mar 1996 01:53
38 lines
1899 bytes
nwaussie@cats.ucsc.edu (Nicholas Cory Williams) wrote:
+I am trying to program a game that was origianlly going to be for DOS until
+I realised that my Turbo C/C++ compiler for Windows only compiled for windows.
+Now, I have to find a way of using basic text windows or something to output
+my text card game.
+I thought I had found the perfect solution when I found functions like
+cprintf and window and clrscr, etc. in the conio.h library however, they
+won't work.
+
+#include<conio.h>
+
+int main(void)
+{
+	clrscr();
+	window(10, 10, 20, 20);
+	cprintf("Hello world\r\n");
+	getch();
+	return 0;
+}
+
+This program gives me these warnings and errors:
+Warning WINDOW.C 6: Call to function 'window' with no prototype in function
+main
+Warning WINDOW.C 7: Call to function 'cprintf' with no prototype in function
+main
+Linker Error: Undefined symbol _cprintf in module WINDOW.C
+Linker Error: Undefined symbol _window in module WINDOW.C
+
+I think I have all my directories set up right, (all my other functions
+work fine with calls to other libraries).
+
+Might this have something to do with me running all this under Win95? Is there
+something else I need to do to get these to work? I tried putting in
+prototypes for these functions but that only got rid of the warnings.
+
+Please help me....
+
Compiles clean for me.  Check your compiler switches.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads