LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   C and C++ Under Linux (https://www.linuxquestions.org/questions/programming-9/c-and-c-under-linux-751172/)

Hi_This_is_Dev 08-29-2009 07:28 PM

C and C++ Under Linux
 
Hi,


I am familiar with C/C++ and have worked on Windows Platform. But I am finding it a little bit difficult in programming for Linux because I have no idea of as to what "include files" are available therein for Linux and what not which are found for C/C++ for Windows.


For example, these line of code would not work in Linux:

Code:

#include <conio.h>
#include <graphics.h>


and so wouldn't their related functions which I have been using so far in Windows.


So, can you suggest me how to find out what "include files" or "header files" are out there available to work with in gcc for Linux? Could you give me a link to a good online or pdf tutorial where I can get all this info?

However, I am going to google it now. But I think you guys have got great ideas! ;)

Thanks!

bigrigdriver 08-29-2009 09:20 PM

The place to look for documentation on the compiler most commonly used (the gnu gcc/g++ compiler) is http://gnu.gcc.org/onlinedocs/.
Scroll down the the version of gcc you are using, and choose from PDF, Postscript, html, and tarball.

Wim Sturkenboom 08-30-2009 12:29 AM

conio.h is definitely a MS only thing. If you need functions that are in there, you can look at ncurses ; not sure if every function from conio is in there

don't know about graphics.h

You can run locate stdio.h to find where the standard include files are and next analyse that directory.

PS There is a dedicated programming section here at LQ. Useful for programming specific questions.

XavierP 08-30-2009 05:29 AM

Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.

Hi_This_is_Dev 08-30-2009 01:18 PM

Thanks for the info. I am going to look at GCC online documentation now at http://gcc.gnu.org/onlinedocs/

ta0kira 08-30-2009 02:19 PM

I think a more appropriate place to look is the glibc online reference. 99% of what I use when programming in C on Linux is covered there. The gcc, ld, and make infopages are also very useful for understanding how Linux programs and libraries are built. As far as graphics and terminal, you might want to look for documentation of ncurses, Qt, and GTK+.
Kevin Barry

paulsm4 08-31-2009 12:24 AM

These are basically *DOS* include's! It's extremely unlikely you'd ever see either of these headers in an actual "Windows" (e.g. Win32 GUI) program:

Quote:

#include <conio.h>
#include <graphics.h>
If you want console-mode programs (like conio.h) then "ncurses" is a great alternative to consider under Linux.

If you want a true GUI (for example, the kinds of things you might have done with Microsoft MFC), then look at Qt or GTK2+.

One other alternative to consider is SDL:

http://gamedevgeek.com/tutorials/get...rted-with-sdl/


Good luck .. PSM

Hi_This_is_Dev 08-31-2009 02:16 PM

http://www.gnu.org/software/libc/manual/


Excellent resource! Thanks!


I installed qt but as I am not familiar with its functionality, I would like to get started with it.


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