Sorry to ask a question regarding the visual c++ environment, but I've come across something that seems straight-forward and yet doesn't work.
I downloaded the latest developer binaries for the plotutils package and installed it (XP Pro, if it matters). I would like to call classes from the libplotter library, but even very simple calls fail to link. Thus (with PSPlotter plotter in a header):
Draw_graph::Draw_graph (char outputfile, Graph<Gene_node> *graph)
{
plotter = new PSPlotter (cin, cout, cerr); // create Plotter
The linker points to the correct library (libplotter.lib) and include dirs seem ok. Moreover, if I replace the plotter functions with c functions from libplot, that compiles fine. Is it possible that it has something to do w/ how the names are mangled between g++ (used to create libplotter) and vc++? I have recreated the link library using lib.exe without curing the problem. Thanks for any help.
Gavin Conant
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry to ask a question regarding the visual c++ environment, but I've come across something that seems straight-forward and yet doesn't work.
I downloaded the latest developer binaries for the plotutils package and installed it (XP Pro, if it matters). I would like to call classes from the libplotter library, but even very simple calls fail to link. Thus (with PSPlotter plotter in a header):
Draw_graph::Draw_graph (char outputfile, Graph<Gene_node> *graph)
{
plotter = new PSPlotter (cin, cout, cerr); // create Plotter
}
gives an:
error LNK2001: unresolved external symbol "public: __thiscall PSPlotter::PSPlotter(class istream &,class ostream &,class ostream &)" (??0PSPlotter@@QAE@AAVistream@@AAVostream@@1@Z)
The linker points to the correct library (libplotter.lib) and include dirs seem ok. Moreover, if I replace the plotter functions with c functions from libplot, that compiles fine. Is it possible that it has something to do w/ how the names are mangled between g++ (used to create libplotter) and vc++? I have recreated the link library using lib.exe without curing the problem. Thanks for any help.
Gavin Conant
I think that only functions, and not objects or classes, from DLL's created with the Mingw compiler, can be used with Visual C++.