Thread: Where do you install your libs? (Windows)

  1. #1
    pwns nooblars
    Join Date
    Oct 2005
    Location
    Portland, Or
    Posts
    1,094

    Where do you install your libs? (Windows)

    Was recently getting my build enviornment back up and running and realized I haven't used many third party libs on Windows, and never when I was running VS (Used to be diehard Code::Blocks). I am curious how the majority of you organize your third party libs.

    On my linux systems usually they installed to the same area that gcc/g++ had it's includes/libs but on windows it seems that is a frowned on practice (to taint your compiler's default includes/libs) so I was thinking I may just make their own folders under an includes/libs directory on the root of my music/videos/storage/development drive.

    I mainly interested in Windows solutions, but other OS's can chime in as well .

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    On linux: /usr/lib
    On Windows: C:\code\lib

  3. #3
    Making mistakes
    Join Date
    Dec 2008
    Posts
    476
    C:\Dev\<Compiler>\lib

    Some libraries might not work for all compilers

  4. #4
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    I think my question here is similarly concerned
    Visual Studio

    I have most of my code, libraries, sdks, installed to c:\hell
    I've also started using cygwin -- naively filling up /home/me with everything (everything!)

  5. #5
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    I use the following structure:
    Code:
    X:
       mingw
          // mingw's sub directories
          msys
          addons
             bin // dlls
             include // .h
             lib // .a
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

  6. #6
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    When I last used Windows for development (a long time ago) I always just put everything in C:\Windows\System32 or wherever those thousands of DLLs go. But that's because the only DLLs I needed were about ten related to the SDL.

    On Linux now I'm very organized in comparison. I have a ~/bin directory for executables (there are about 80 in there at the moment). Usually I install .so libraries through my package management system, and they go in the standard places, but if I build a library myself I leave its .so files in some place or another.

    One very useful environment variable: LD_LIBRARY_PATH. (PATH doesn't work, you need to use LD_LIBRARY_PATH.) If (in bash) you run a command like this, e.g.,
    Code:
    LD_LIBRARY_PATH=../lib ./executable
    then the loader (run "man ld.so", it's interesting) will look there as well as in the standard places for .so files. Of course, you can also add something like that to your .bashrc to make it global. Oh, and ldd is useful to figure out exactly which libraries you're using.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  7. #7
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    I put each library in its own directory.

    Code:
    /libstash/foolib/include|lib
    /libstash/barlib/include|lib
    etc
    Throwing all the includes and libraries into a central location leads to:

    1. A huge directory
    2. The possibility of name conflicts between libraries and, more importantly, headers
    3. The possibility of using the wrong library

    IMHO the include and lib paths for each library should be explicitly spelled out in the build process (except system or SDK libs which obviously live in their own locations).

    The user should be able to switch between versions of a library by a minor tweak to a path in the build system. They shouldn't have to swap files in and out of a monolithic directory.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to make a windows application
    By crvenkapa in forum C++ Programming
    Replies: 3
    Last Post: 03-26-2007, 09:59 AM
  2. Script errors - bool unrecognized and struct issues
    By ulillillia in forum Windows Programming
    Replies: 10
    Last Post: 12-18-2006, 04:44 AM
  3. Network Programming in C for Windows
    By m.mixon in forum C Programming
    Replies: 7
    Last Post: 06-19-2006, 08:27 PM
  4. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 09:37 AM