Menu

link an external library

2002-11-07
2012-09-26
  • Angelo Massimo Figundio

    Hello to all, I'm moving first step with dev-c++ and I want use dislin library to plot graph in a console mode.
    What I have to do to link this external library?
    I've inserted the directory in "compiler option>directories>library and include, but in the gcc command line doesn't appear the address of the library.
    Can you help me by explain how I've to do?
    Thanks to all
    Angelo M. Figundio
    figundio@inwind.it

     
    • Trev L Nunes

      Trev L Nunes - 2002-11-08

      Yes Dev-C++ is a pain with DLL's I think. So if you hunt around you'll come across a great web-site which will provide all the answers and tools:

      http://webclub.kcom.ne.jp/ma/colinp/win32/tools/

      Sadly Dev-CPP doesn't pickup the .lib files when you specifiy -l<my_library> you have to supply the full path to the .lib file like so:

      -lbass  -lc:/ball_breaking/bass.lib

      The .lib will provide the linker with information for the offset into the dll when you link the .o file. When you see the above site, you should read up on the following tools:

      1. impdef
      2.  dlltool

      Collectively with these 2 tools you can:

      a) build a static library *.a
      b) export an interface .lib file for linking.

      Now can someone please tell me why I need the full path to .lib for DLL linking. 

      Checkout Bass.dll it's awesome!

      Trev.

       
    • Angelo Massimo Figundio

      well, dislin comes with a compiled static library (dismgc.a) and I put these command line in Project>option>
      Linker option> -l"c:\dislin\dismgc.a"
                            -L"c:\dislin\dismgc.a"
                            "c:\dislin\dismgc.a"

      But never works!!
      The compiler log don't find the inner routines.
      Is someone that, trying dislin (www.dislin.de), can help me?
      Thanks
      Angelo M. Figundio
      figundioam@tiscali.it

       
    • Trev L Nunes

      Trev L Nunes - 2002-11-09

      Okay so static library's should be okay..when you link drop the .a and .dll so you should be specifying the following:

      -ldismgc

      You are telling the linker to look for the following:

      dismgc.a.a 

      That's it.  In the library directories make sure it references the dev-cpp/lib directory or wherever the static library is found.

       
    • Angelo Massimo Figundio

      Thanks
      now works all :-)

       

Log in to post a comment.

MongoDB Logo MongoDB