Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | BartC <bc@freeuk.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: PNG coding |
| Date | 2016-11-16 19:38 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <o0iciq$ek$1@dont-email.me> (permalink) |
| References | <o0foak$4cu$1@reader2.panix.com> <efb414a2-37fd-f415-1353-d92dad04592b@verizon.net> <o0fvki$c8n$1@dont-email.me> |
On 15/11/2016 21:45, Richard Heathfield wrote:
> On 15/11/16 20:34, James R. Kuyper wrote:
>> How about looking at libpng itself?
(Sure! IME looking at an open source project that is usually futile.)
....
> Actually, since it's about 900 lines long, I don't think I'll show any
> more of it. It's obviously all quite self-explanatory, and you won't
> need any help at all in understanding it completely. Five minutes should
> do it. Maybe ten if you're having a bad day. For the whole library?
> Perhaps an hour. After all, it's only 40,000 lines.
You might be turning into me with an intolerance of needlessly complex
software!
But I get this all the time. Eg. a 2GB (yes gigabyte) install of Haskell
/that didn't work/.
The most recent was looking again at SDL ("Simple DirectMedia Layer" or
something; note the work 'Simple'). The binary download for Windows was
a single 500KB DLL. Oh! Something actually small and straightforward for
a change?
Except it took the best part of an hour to find a basic hello
world-style tutorial. It was either in C++ (SDL is a C library), or was
the wrong version (there are incompatible 1.2 and 2.0 versions), or I
just followed links until I ended up where I'd started from!
Eventually I found one, and it needed "SDL.h". OK, download all the
include files, of which there are 80, some 35,000 lines' worth (not as
many as your 40,000, but remember these are headers, not code).
(They are placed outside of any C compiler as I wanted this to be
independent of a compiler, so that meant changing <SDL2.h> to "SDL2.h",
which worked for my simple program. But I guess there are more such
includes within the other 79 others.)
So, right version of test program, right version of headers, it
compiles, but doesn't link. There is no 'main()' function. Even this
program:
#include <SDL2.h>
int main (void) {}
doesn't work. It turns out that that header redefines my 'main' as
'SDL_main', and I'm expected to statically link something else that
contains 'main'.
This is no good: I don't want to have to source half a dozen libraries
for the various compilers, and I'm planning to use it from outside C
anyway. However I can just do this:
#undef main
and it seemed to work (but I need to find out what initialisations are
missing).
So that's that, but I need to find out if it's the same pattern on
Linux, except the information available is abysmal. Look at the website:
'For Linux binaries, contain your distributor.'; so I don't even know
what the library is called. What does a Linux user who wants to RUN a
program that uses SDL, not compile and build one, need to download? I
still don't know.
(I believe the library is called libSDL2.so, at least on Ubuntu, and I
got it I think as a result of installing 'libsdl2-dev', all 67MBs'
worth. Would it have killed anyone to have given this basic info on the
website?)
--
Bartc
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
PNG coding ruben safir <ruben@mrbrklyn.com> - 2016-11-15 14:40 -0500
Re: PNG coding "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-11-15 12:02 -0800
Re: PNG coding ruben safir <ruben@mrbrklyn.com> - 2016-11-15 15:20 -0500
Re: PNG coding "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-11-15 12:25 -0800
Re: PNG coding "James R. Kuyper" <jameskuyper@verizon.net> - 2016-11-15 15:34 -0500
Re: PNG coding Popping mad <rainbow@colition.gov> - 2016-11-15 20:57 +0000
Re: PNG coding "James R. Kuyper" <jameskuyper@verizon.net> - 2016-11-15 16:12 -0500
Re: PNG coding jadill33@gmail.com - 2016-11-15 14:00 -0800
Re: PNG coding Jorgen Grahn <grahn+nntp@snipabacken.se> - 2016-11-20 11:14 +0000
Re: PNG coding Richard Heathfield <rjh@cpax.org.uk> - 2016-11-15 21:45 +0000
Re: PNG coding "James R. Kuyper" <jameskuyper@verizon.net> - 2016-11-15 17:15 -0500
Re: PNG coding Richard Heathfield <rjh@cpax.org.uk> - 2016-11-15 22:41 +0000
Re: PNG coding Melzzzzz <mel@zzzzz.com> - 2016-11-15 23:49 +0100
Re: PNG coding Anton Shepelev <anton.txt@g{oogle}mail.com> - 2016-11-16 15:23 +0300
Re: PNG coding Richard Heathfield <rjh@cpax.org.uk> - 2016-11-16 13:57 +0000
Re: PNG coding BGB <cr88192@hotmail.com> - 2016-11-18 01:24 -0600
Re: PNG coding BartC <bc@freeuk.com> - 2016-11-18 11:56 +0000
Re: PNG coding BGB <cr88192@hotmail.com> - 2016-11-18 12:48 -0600
Re: PNG coding BartC <bc@freeuk.com> - 2016-11-19 00:21 +0000
Re: PNG coding BGB <cr88192@hotmail.com> - 2016-11-19 01:50 -0600
Re: PNG coding Melzzzzz <mel@zzzzz.com> - 2016-11-15 23:42 +0100
Re: PNG coding BGB <cr88192@hotmail.com> - 2016-11-15 17:53 -0600
Re: PNG coding "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-11-15 16:25 -0800
Re: PNG coding raltbos@xs4all.nl (Richard Bos) - 2016-11-18 08:15 +0000
Re: PNG coding jameskuyper@verizon.net - 2016-11-18 09:35 -0800
Re: PNG coding supercat@casperkitty.com - 2016-11-20 14:34 -0800
Re: PNG coding BartC <bc@freeuk.com> - 2016-11-16 19:38 +0000
Re: PNG coding Richard Heathfield <rjh@cpax.org.uk> - 2016-11-16 22:16 +0000
Re: PNG coding "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2016-11-16 21:14 +0800
Re: PNG coding Jean-marc Lienher <jean-marc.lienher@bluewin.ch> - 2016-11-16 20:55 +0100
Re: PNG coding BartC <bc@freeuk.com> - 2016-11-16 20:31 +0000
Re: PNG coding Richard Heathfield <rjh@cpax.org.uk> - 2016-11-16 22:24 +0000
csiph-web