Hi everyone, im a beginner in the C rpogramming language. I'm not sure if this is the right place to ask a question like this but, here it goes. I was wondering if there was a way to compile my programs so that they open in they're own window instead of the terminal? Any help would be much appreciated! :)
I don't really use C. However, my uneducated guess would be that you would need some kind of GUI library for that. Some C IDEs + compilers have one built in. I'll let Articoz know that you posted. As he uses C/C++ he can answer this question better than I can.
You need to either use the Windows API or some GUI library. If you want to make games, then SDL is a nice candidate. See http://www.libsdl.org/
If you don't mind using c++ you can also check out this hardware accelerated game engine: http://hge.relishgames.com/
It is a windows-only but pretty nice though. These tutorials show everything you need to do to get it up and running in no time and are very easy to follow: http://hge.relishgames.com/doc/index.html
But if you open a real window output from printf and cout and other stuff will not be seen in it.
Thank you for the response. I eventually will end up with C++ im sure. I'm a "newbie" to programming and C. I also forgot to mention that I'm using Linux (debian) build. How would i get the gui library? Once I have it, can I call on it with an #inlude statement?
Look for tutorials on the sites.
If you just want to make games then SDL provides you with a window or full-screen canvas where you can draw your graphics on. Here are some excellent tutorials
The tutorials should show you how to include the given library and how to link it also.
Yes, thank you. GTK+2 works great. Theres also another program I found that is a gui to use gtk+2 and writes it into .c source files for you!!! It's called "Glade." As far as I know its only to develop GNOME applications, but isn't gtk the same way??? I guess it would depend on the compiler…….Anyways thanks for your help. So, theres not much C language programming done here????
i've never tried GTK myself but it should be pretty easy. I don't know about the GNOME stuff. But you should be able to run GTK applications on other desktops also, e.g. KDE, but i don't know how. I know you can run it on windows :)
No there is not much C going on here… But do stick around :)