how do you instill a library?

This is a discussion on how do you instill a library? within the C++ Programming forums, part of the General Programming Boards category; i downloaded a math library from www.swox.com/gmp and i am not quite sure how to install it so i can ...

  1. #1
    ima n00b, ok? orion-'s Avatar
    Join Date
    Aug 2005
    Location
    alberta, canada
    Posts
    55

    how do you instill a library?

    i downloaded a math library from www.swox.com/gmp and i am not quite sure how to install it so i can use it in my applications. could someone tell me please? the compiler i am using is bloodshed dev-c++ (version 4.9.9.2). thank you.

  2. #2
    Registered User
    Join Date
    Dec 2006
    Posts
    15
    well, its not so much an install process. Do you have the .lib file? that is all you need.
    You drop it into your project folder.. or if you want it in multiple projects you could set dev c++ to use that file as a standard library or something.
    But simplest way is to drop it in your project folder, then include it in your project, and in a header file of ur main file put this code

    Code:
    #pragma comment ( lib, "libraryname.lib" )
    Thats all, then you can use the functions of the library in any page includeing the header file the pragma is in.

  3. #3
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,435
    Have you read the manual? It is explained there how to install and use it.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  4. #4
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Code:
    #pragma comment ( lib, "libraryname.lib" )
    I don't think it works in Dev-C++.
    In project options, put "-llibraryname" to the linker parameters box.
    "The Internet treats censorship as damage and routes around it." - John Gilmore

  5. #5
    Registered User
    Join Date
    Jan 2005
    Location
    Estonia
    Posts
    131
    btw. dev-c++ is not a compiler. dev-c++ is an IDE (it's just a graphical window where you can enter your code and process it and stuff like that). the compiler that comes with dev-c++ is gcc (I don't know the version of it).
    Programming is a form of art.

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,588
    You will need to compile GMP. If you are impatient, this can be done with the dance:
    Code:
    ./configure
    make
    make check
    make install
    You will need MSYS, and might well just install MinGW too. The MinGW port of GCC is the default compiler in Dev-C++ 4.9.9.2.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What's an import library?
    By chiefmonkey in forum C++ Programming
    Replies: 1
    Last Post: 06-19-2009, 05:00 PM
  2. Property Set Library (PSL) - Announcement
    By vultur_gryphus in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 05-29-2008, 06:04 AM
  3. Makefile for a library
    By sirmoreno in forum Linux Programming
    Replies: 5
    Last Post: 06-04-2006, 04:52 AM
  4. very weird .h problem
    By royuco77 in forum C++ Programming
    Replies: 1
    Last Post: 09-11-2005, 07:55 AM
  5. better c string functions
    By samps005 in forum C Programming
    Replies: 8
    Last Post: 11-04-2003, 12:28 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21