How to compile c++ program with pngwriter
<p>I'm trying to make a png file using <a href="http://pngwriter.sourceforge.net/" rel="nofollow">"pngwriter"</a>. I'm using Ubuntu as my OS. I've put these following files in /home/ediamin/png/ folder
1.png.h, 2.pngconf.h, 3.pngwriter.h, 4.test.cpp, 5.zconf.h, 6.zlib.h</p>

<p>my test.cpp contains this codes</p>

<pre><code>#include&lt;iostream&gt;
#include "pngwriter.h"
using namespace std;

int main() {
int i;
int y;

pngwriter png(300,300,0,"test.png");

for(i = 1; i &lt; 300;i++) {
    y = 150+100*sin((double)i*9/300.0);
    png.plot(i,y, 0.0, 0.0, 1.0);
}

png.close();

return 0;
}
</code></pre>

<p>Now I'm trying to compile with this command,</p>

<pre><code>g++ -o test test.cpp -DNO_FREETYPE
</code></pre>

<p>and it gives me following errors,</p>

<pre><code>/tmp/ccLr9Szo.o: In function `main':
test.cpp:(.text+0x30): undefined reference to `pngwriter::pngwriter(int, int, double, char const*)'
test.cpp:(.text+0x72): undefined reference to `pngwriter::filledcircle(int, int, int, double, double, double)'
test.cpp:(.text+0x7e): undefined reference to `pngwriter::close()'
test.cpp:(.text+0x8f): undefined reference to `pngwriter::~pngwriter()'
test.cpp:(.text+0xa4): undefined reference to `pngwriter::~pngwriter()'
collect2: ld returned 1 exit status
</code></pre>

<p>What should I do? Please note that, I don't want to install any library file, that's why I put the header files in the same folder.</p>
