Click to See Complete Forum and Search --> : conio.h


arlenagha
11-21-2002, 11:31 PM
its me again with another c++ problem. my source files requires the conio.h file. i have the file and i know where it is. (/usr/include/wine/wine/msvcrtf/conio.h). i tried making gcc look for it, but it keep saying that "file not found". i just don't know exactly how to use the gcc -I, -L and l options correctly. could anyone help me out.

GaryJones32
11-22-2002, 12:30 AM
HI,
The -I (includes) flag points to the directory where your header file or files are.

g++ -I/usr/include/wine/wine/msvcrtf

that should get the compiler to find the file

-L sets the directory where the libraries to link to are

and the specific libraries are named with -l

no need for spaces after the flags just space before the next flag

don't use the prefix "lib" or the suffix (after the dot)
for libraries

generally put them like

g++ -I... -L... ThenOptionsLike -Wall ThenFilelike hello.cpp ThenLibrarieslike -lX11 ThenOutput -o hello


hope that helps

bwkaz
11-25-2002, 03:33 PM
Even if you have the header file, you most likely won't be able to compile anything. Well, let me restate that. Compiling will work fine, but linking will fail horribly.

Just having the conio.h file does not mean that you have the functions that conio.h declares actually defined anywhere... most likely, you don't. Which means it won't work. Go ahead and try it, but I don't think you'll get anywhere...

What are you trying to use conio.h for? ncurses might be an OK substitute, but curses is kind of heavy for some things -- it may not be worth the bloat.

arlenagha
11-26-2002, 04:21 AM
well bwkaz, the thing is that i am new to programming. Eventhough i took c++ course in high school more than 3 years ago, i have forgotten most of it. so what i am doing now is reading a book titled "Object-oriented programming in c++". The thing is that the book has examples which are written in either Microsoft Visual c++ or Borland c++, but i do the examples in linux. one of the examples happens to use conio.h. do u have any suggestions on learning c++ in linux from scratch???