Problem with PNGWriter
I was doing some experiments with PNGWriter. To verify a sample code, I typed it into the text editor and compiled (Visual C++ ver 6). First it showed several errors saying something.h not found. After doing a bit of googling, I got all the headers which were not being found earlier and it compiled successfully.
Then I tried linking. But it showed 5 errors that I cannot comprehend.
Cpp3.obj : error LNK2001: unresolved external symbol "public: __thiscall pngwriter::~pngwriter(void)" (??1pngwriter@@QAE@XZ)
Cpp3.obj : error LNK2001: unresolved external symbol "public: void __thiscall pngwriter::close(void)" (?close@pngwriter@@QAEXXZ)
Cpp3.obj : error LNK2001: unresolved external symbol "public: void __thiscall pngwriter::plot(int,int,double,double,double)" (?plot@pngwriter@@QAEXHHNNN@Z)
Cpp3.obj : error LNK2001: unresolved external symbol "public: __thiscall pngwriter::pngwriter(int,int,int,char *)" (??0pngwriter@@QAE@HHHPAD@Z)
Debug/Cpp3.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.
Cpp3.exe - 5 error(s), 0 warning(s)
What's going on?
Did you link the lib files?
Actually, I am using Visual C++ to compile my program. It has two options, one is 'compile' and one is 'Build exe'. Compiling does not give any errors, but Building exe does. There is no way to pass some arguments while linking. So I assumed that it automatically links all the header files in the programme while building exe.
Well if you added a path to the compiler include path to pick up the headers, then that would be enough to make it compile.
You also need to add the path to the png library AND the name of the png library in a similar way to the linker library path.