Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: [NOOB] How do I use these packages?  (Read 1393 times)

0 Members and 1 Guest are viewing this topic.

Xiphirx

wat
[NOOB] How do I use these packages?
« on: March 22, 2010, 02:19:47 am »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
I have not been having trouble programming with SDL and C++, but I need a function to save PNGs, and I have found this function apparently at http://encelo.netsons.org/_download/savesurf.tar.gz .
Now, I un-tar (lal) the archive and I get a bunch of files with a makefile.

This is where I don't know what to do. How do I implement these into my project?

I am pretty sure I have to use the makefile, but I always though they were for Linux, and I am on Windows...
Logged
  • For The Swarm
Re: [NOOB] How do I use these packages?
« Reply #1 on: March 22, 2010, 02:50:11 am »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
In honesty, I would recommend SFML over SDL, but..

Makefiles aren't only for Linux, they're used for a number of compiler systems to allow a programmer to set up the steps for various project builds. They're simply used more commonly on Linux machines than they are on Windows.

Still, you won't have to worry about the makefile - you should only have to add pngfuncs.c and pngfuncs.h to your project, then include "pngfuncs.h" in any of your source files that need to implement the functionality it provides. Look in savescreen.c and savesurf.c for examples of how to use it.
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog

Xiphirx

wat
Re: [NOOB] How do I use these packages?
« Reply #2 on: March 22, 2010, 05:57:31 pm »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
Ok, I have done what you told me, and I included libpng as well, but now I am stuck with
Code: [Select]
error LNK2019: unresolved external symbol "int __cdecl png_save_surface(char *,struct SDL_Surface *)"

and I think I am missing a library... or if the makefile was supposed to generate a .lib file...

EDIT:
so it turns out that I am using two different versions of libPNG...

Code: [Select]
libpng: warning: Application was compiled with png.h from libpng-1.0.5
libpng: warning: Application  is  running with png.c from libpng-1.2.29
libpng: error: Incompatible libpng version in application and library
libpng error: Incompatible libpng version in application and library

Now, I have to update my libraries and headers, so I have to get http://downloads.sourceforge.net/libpng/libpng-1.2.29.tar.bz2 right?

Now when I open that archive, I know that I have to produce a .lib and a few .h's out of it... how do I do this on Windows?
« Last Edit: March 22, 2010, 06:53:09 pm by Xiphirx »
Logged
  • For The Swarm

Antidote

>.>
Re: [NOOB] How do I use these packages?
« Reply #3 on: March 24, 2010, 04:01:16 am »
  • In all seriousness who's serious?
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1485
Header files (*.h) are not "generated" (unless we're talking about Qt but that's a whole other creature) and the LIB would be outputted by Visual Studio when compiling a dynamic or static library.
Logged
  • Axiomatic Data Laboratories
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.397 seconds with 43 queries.