Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi,
1> I am using Red hat EL.4. I want to display any BMP image (using C) at stdout. I have already used fread(). fwrite() and able to copy a image but yet to print at stdout.
when I am using the function 'fwrite(&file_structure,sizeof(file_structure),1,s tdout)' its giving me the corresponding characters at stdout.
2> I also want to know, how to use the graphics mode under linux using C. Is there any header file and function like windows '#include<graphics.h>' and 'initgraph()'
1) see as stdout is text, and its outputting characters, i say its working perfectly. What exactly where you trying to do, actually display the image?
2) Nope, well, there is the framebuffer, but really, there is little reason to use it, unless of course you need display graphics as a command line only program. You should look up graphical libraries. There are quite a few, the choice will mostly depend upon what type of graphics you are trying to display.
3) As a side note, if you where actually trying to display the image on the screen in question 1, then you need a graphical output to do that, not text based. A graphics library is the best way to go about it, as already mentioned.
1) see as stdout is text, and its outputting characters, i say its working perfectly. What exactly where you trying to do, actually display the image?
2) Nope, well, there is the framebuffer, but really, there is little reason to use it, unless of course you need display graphics as a command line only program. You should look up graphical libraries. There are quite a few, the choice will mostly depend upon what type of graphics you are trying to display.
3) As a side note, if you where actually trying to display the image on the screen in question 1, then you need a graphical output to do that, not text based. A graphics library is the best way to go about it, as already mentioned.
Thanks for your help.
I have downloaded and install g2-0.72 and trying to run a small
program. When compiled with gcc giving me errors as bellow...
any help?????????
#include <g2.h>
#include <g2_PS.h>
main()
{
int id;
id = g2_open_PS("rect.ps", g2_A4, g2_PS_land);
g2_rectangle(id, 20, 20, 150, 150);
g2_close(id);
}
[root@localhost C Programs]# gcc test.c
/tmp/cc8u4Gof.o(.text+0x29): In function `main':
: undefined reference to `g2_open_PS'
/tmp/cc8u4Gof.o(.text+0x6a): In function `main':
: undefined reference to `g2_rectangle'
/tmp/cc8u4Gof.o(.text+0x78): In function `main':
: undefined reference to `g2_close'
collect2: ld returned 1 exit status
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.