![]() |
| | #1 |
| Registered User Join Date: Sep 2009
Posts: 7
| what is the best standard C libary for ubuntu? Cheers Mick |
| mickpc is offline | |
| | #2 |
| Registered User Join Date: Jul 2007
Posts: 44
| C standard library != graphics library. You already have a c standard library, most of your system depend on it. For graphics library check SDL for 2D and OpenGL for 3D. If you want to write GUI, read about Qt (C++, used by KDE) or Gtk (C, used by Gnome, pain in arse). |
| fronty is offline | |
| | #3 |
| Registered User Join Date: Sep 2009
Posts: 7
| I used synaptic to download libsdl1.2-dev and tried to compile a sample file, but the headers were not recognised. :| Cheers Mick |
| mickpc is offline | |
| | #4 |
| Registered User Join Date: Jul 2007
Posts: 44
| Are the headers located in some directory which is in your include path? |
| fronty is offline | |
| | #5 |
| Allways learning Join Date: Aug 2008 Location: ~/
Posts: 32
| There is a pretty good guide for setting up and creating a simple test program at lazyfoo.net. Just skip the part about downloading and installing the rpm since you have already installed the deb. If your using automake && autoconf Then just copy Code: <insert_var_here>_LDADD = -lSDL
__________________ |
| cs_student is offline | |
| | #6 |
| subminimalist Join Date: Jul 2008 Location: NYC
Posts: 3,944
| I believe SDL is a C++ API. If you want to use C, just use openGL (which is the 3D graphics part of SDL) with "glut".
__________________ Accuracy and integrity mean nothing if you don't make it past the censors...PYTHAGORAS |
| MK27 is offline | |
| | #7 |
| Allways learning Join Date: Aug 2008 Location: ~/
Posts: 32
| Nope, it's a C graphics API, so you can use it with C or C++.
__________________ |
| cs_student is offline | |
| | #8 |
| Woof, woof! Join Date: Mar 2007 Location: Australia
Posts: 3,139
| Standard "glut" is abandoned. And the "forks" like freeglut don't really offer much. I'd go with SDL or glfw if you want to use OpenGL. |
| zacs7 is offline | |
| | #9 | |
| Registered User Join Date: Sep 2009
Posts: 7
| Quote:
Also do I have to enter a value for insert_var_here? Edit: up until now I have just been typing gcc -o test test.c Last edited by mickpc; 09-27-2009 at 09:03 PM. | |
| mickpc is offline | |
| | #10 | |
| subminimalist Join Date: Jul 2008 Location: NYC
Posts: 3,944
| Quote:
@mickpc: you need to use linker flags, eg for OGL/glut: gcc test.c -lglut -lGLU -lGL -lXext -lX11 -lm Maybe some nice person will post the flags for SDL; if not I am sure they are on page one of the intro tutorial or whatever... * in any case, IMO you might as well keep your use of glut to a minimum; all it has to do is manage a window and an event loop. This way, when you want to really polish up and handle your own loop and window management, you will not find you have written something that involves a lot of higher-level functions from a secondary toolkit. The point of glut is just to allow you to do pure OpenGL programming easily. It is not to add a whole bunch of features like sound effects or whatever. It is a "low level" approach vs. the "high level" of SDL, which is it's own thing that potentially includes OGL -- whereas glut doesn't do anything except provide a cross-platform for OGL. It is and should be minimal. I have nothing against SDL, just this is apples and oranges. AFAICT (I have written a simple patch for tuxpaint, which is an SDL kid's game), you can do all kinds of stuff with SDL that really have absolutely nothing to do with 3D graphics programming.
__________________ Accuracy and integrity mean nothing if you don't make it past the censors...PYTHAGORAS Last edited by MK27; 09-28-2009 at 12:23 PM. | |
| MK27 is offline | |
| | #11 |
| Jaxom's & Imriel's Dad Join Date: Aug 2006 Location: Alabama
Posts: 801
| kennedy != graphics programmer PERIOD!!! . . . but, I thought that GTK was considered the "standard"? |
| Kennedy is offline | |
| | #12 | |
| subminimalist Join Date: Jul 2008 Location: NYC
Posts: 3,944
| Quote:
ps. you can thread GTK and OGL/glut together...
__________________ Accuracy and integrity mean nothing if you don't make it past the censors...PYTHAGORAS | |
| MK27 is offline | |
| | #13 |
| Registered User Join Date: Jul 2007
Posts: 44
| SDL is written in C, but it has bindings for frigging many languages. But basically it's a C library. GTK is "standard" widget toolkit on GNU, because it's used by GNOME. Portable graphics programming => SDL with OpenGL. Non-portable graphics programming for Unix-likes => Xlib, GLX, GLUT or whatever you want. Portable GUI => if you want C++, Qt, if you don't, just do it or suffer. |
| fronty is offline | |
| | #14 | |
| Registered User Join Date: Oct 2006
Posts: 263
| Quote:
| |
| Elkvis is offline | |
| | #15 |
| subminimalist Join Date: Jul 2008 Location: NYC
Posts: 3,944
| Actually GTK is cross-platform as well. AFAIK, glut is not tho [edit: wrong]. The GTK openGL extension does not appear to use glut.
__________________ Accuracy and integrity mean nothing if you don't make it past the censors...PYTHAGORAS Last edited by MK27; 09-28-2009 at 12:24 PM. |
| MK27 is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Standard efficiency | Jorl17 | C Programming | 3 | 06-18-2009 11:48 AM |
| array initialization & C standard | jim mcnamara | C Programming | 2 | 09-12-2008 03:25 PM |
| include question | Wanted420 | C++ Programming | 8 | 10-17-2003 03:49 AM |
| C/C++ standard | confuted | A Brief History of Cprogramming.com | 3 | 07-06-2003 03:22 AM |
| standard language, standard compiler? | doubleanti | A Brief History of Cprogramming.com | 8 | 09-03-2001 04:21 AM |