Menu

Plotutils and c++ name-mangling in VC 98

Help
2005-02-10
2012-07-26
  • Gavin Conant

    Gavin Conant - 2005-02-10

    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

     
    • GnuWin

      GnuWin - 2005-02-10

      I think that only functions, and not objects or classes, from DLL's created with the Mingw compiler, can be used with Visual C++.

       
MongoDB Logo MongoDB