dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 20

Thread: C++ and 'Make'

  1. #1
    Join Date
    Feb 2008
    Posts
    53

    [UNRESOLVED] C++ and 'Make' - how to install new libraries in Windows?

    I'm still a novice at C++, and could use some assistance here.

    Every time I download a new API, Toolkit, Library, etc. I get a folder, (usually with the name of the library) that typically contains the following subfolders:

    "builds", "devel", "docs", "include", "objs", "src" and sometimes other folders like "tools", and "resources"

    The folder also typically includes some files with the 'make' prefix, usually one is an exe. I understand these can somehow be used to compile the source files and move the headers, dll's, and obj files to their appropriate locations, but i'm not quite sure how to use them.

    If someone can either give me, or link me to, an explanation for how you typically install a new library, and a little about whats going on, I'd be most appreciative!
    Last edited by Mikau; June 29th, 2008 at 02:50 AM.

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: C++ and 'Make'

    You aren't likely to find an exe, because that's a Windows extension, and Windows software usually isn't packaged in that manner. Did you mean a Unix executable?

    Often libraries come with readmes that explain what you need to do. Typically, however, they'll have a configure script---they test your system to make compilation decisions, then run Makefiles to build the library, then copy it to the appropriate place (usually /usr/lib/).

  3. #3
    Join Date
    Feb 2008
    Posts
    53

    Re: C++ and 'Make'

    thanks for the response!

    A configure script, huh? Well I do have a 'configure' file here, of type 'File', also a file called "modules" of type 'cfg' but i have no idea how to use them. Do I access them from the command line or something?

    The particular library I'm currently trying to install, does not appear to have a readme. Well it does, but its of type File, and only says a sentence or two if opened in notepad.
    Last edited by Mikau; June 28th, 2008 at 12:50 AM.

  4. #4
    Join Date
    May 2008
    Posts
    96

    Re: C++ and 'Make'

    That is a typical *nix software setup. If you are trying to compile under Windows, you will need to get MSYS and MinGW and compile it under the bash command shell that comes with msys.

    To do it, unpack the downloaded stuff into a directory, change to that directory (in the msys shell), and type the following three commands:
    Code:
    ./configure
    make
    make install
    You will likely have to wait a bit between each one. Once done you can delete the unpacked directory if you like (don't forget the html documentation though). The executable file will be in the "release" directory (if you haven't deleted it) and after "make install" it will also be in the /usr/bin/ directory (which on Windows is probably C:\Msys\1.0\bin).

    Hope this helps.

    Msys isn't a perfect solution, and won't compile everything you find on the net.

    Hope this helps.

  5. #5
    Join Date
    Feb 2008
    Posts
    53

    Re: C++ and 'Make'

    Well I installed MinGW okay. (though i can't say i know what it is)

    but MSys has been a problem.

    on their download page at sourceforge:
    http://sourceforge.net/project/showf...?group_id=2435

    I am given 3 options between MSYS Base System, MSYS Supplementary Tools, and MSYS System Builder. Furthermore, each of these catagories contains several files available for download, and i'm unable to distinguish which I need.

  6. #6
    Join Date
    Feb 2008
    Posts
    53

    Re: C++ and 'Make'

    isn't there a way I can copy the library into my project folder and compile it exclusively with that project?

    I've been trying to gain proficiency with C++ for a while. I'm learning more and more about the language, but I still am always lost when trying to install new libraries. I've been hunting for good articles to explain the process without success. Its really frustrating and discouraging.

  7. #7
    Join Date
    Jul 2003
    Location
    Linköping, Sweden
    Posts
    261

    Re: C++ and 'Make'

    Installing Unix/Linux libraries on Windows can be a hassle, especially if you are a beginner. Chances are that whatever functionality you need already exists as a Windows library with either a VS project file, a proprietary make subsitute or as precompiled binaries.

    What functionality is it you want from the library in question? Perhaps we can help you find a precompiled Windows library.
    Errare humanum est, ergo non sum humanus.

  8. #8
    Join Date
    May 2008
    Posts
    96

    Re: C++ and 'Make'

    @Mikau
    Yeah, the MSYS/MinGW downloads are confusing.

    For MinGW, make sure you get the following packages:
    • GCC Version 4
    • GNU Binutils
    • GNU Make
    • MinGW API for MS-Windows
    • MinGW Runtime
    • MinGW Utilities

    I also like the user-contributed packages:
    • PDCurses
    • RegEx


    You want the MSYS Base System, then the MSYS Supplementary Tools packages. Install them after installing MinGW, in that order.

    When installing, make sure you don't use any pathnames that contain spaces. If you install in the default location you don't have to worry about it. (I like to keep everything under Program Files, so when installing I specified "C:\PROGRA~1\MinGW". If you ever plan to use Boost, be aware that bjam won't like that.)


    C++ is a breeze compared to configuring your system and libraries etc. Alas.

    @Hnefi
    Many library venders are (fortunately) aware of that and provide precompiled binaries. Unfortunately they still require proper installation... And most cross-platform libraries avoid Visual-Studio specific stuff.

    Alas. (Mikau, Hnefi asks a good question: what is it you are trying to do? There is still a good chance that we can find you something precompiled...)

  9. #9
    Join Date
    Feb 2008
    Posts
    53

    Re: C++ and 'Make'

    Thanks so much, to both of you. I've really been struggling with this over the past week.

    Well I learned recently that there are special precompiled packages available for dev C++, and i actually downloaded a dev C++ compiler just so I can use it. But I don't like the editor it came with, and have found a few bugs in the compiler. >.<

    Now as for what I am currently trying to do, I'm trying to install two libraries, for use with OpenGL. One is called FreeType 2, the other is called Quesogic, which is built on top of FreeType 2. They're libraries to enable easy font drawing in OpenGL.

    And what do I want to do with these libraries? Well... be able to include the header files and use the functionality they provide in the C++ programs I write . I honestly don't know what else one could do with them! I am trying to compile them on windows only, if thats what you mean.

    So I am currently interested in these two libraries in particular, HOWEVER, I feel it is in my best interest to know how to learn the general process of library installation, as complex as it may be. I'm a second year Comp Sci major, and if this is to be my profession, I need to learn to do these things for myself.

  10. #10
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: C++ and 'Make'

    When trying to find libraries for Windows, always see if there are binaries available, or at least a prepared Visual Studio project. It's much easier than messing around with Cygwin and make.

    FreeType for Windows binaries:
    http://gnuwin32.sourceforge.net/packages/freetype.htm

    You may have more trouble with the other one. Some quick Googling reveals that some people have gotten it compiled under Windows, but it's not set up to do that easily. I'd say find another library if you can.

  11. #11
    Join Date
    Feb 2008
    Posts
    53

    Re: C++ and 'Make'

    wouldn't you recommend that I learn how to use Cygwin and Make sooner or later?

    In any case, I WOULD like to install these libraries now. Looking through the readme, I found the location of two prepard project folders, one named 'visualc' and one named 'visualce'

    I'm not sure if this has to do with Visual C++ or Visual Studio, both of which I'm unfamiliar with. I use Borland C++BuilderX.

  12. #12
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: C++ and 'Make'

    Quote Originally Posted by Mikau
    wouldn't you recommend that I learn how to use Cygwin and Make sooner or later?
    If you're planning to become a Linux developer, absolutely. Or even if you're looking to write cross-platform.

    There's little reason to learn those if you want to be Windows-exclusive.

  13. #13
    Join Date
    Feb 2008
    Posts
    53

    Re: C++ and 'Make'

    I'm not sure I want to be windows exclusive, but I'd certainly rather focus on Windows for now. I didn't know Make was primarily a Linux thing. Is there no standard method of installing these things on windows?

    In any case, I just read up on Visual Studio, and how Visual C++ is created for it. So it looks like this does indeed come with a prepared Visual Studio Project. The "visualc" folder.

    Looks like I need to install Visual Studio and or Visual C++....

  14. #14
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: C++ and 'Make'

    Visual C++ is just C++ in Visual Studio. The language isn't any different than normal C++.

    Well, that's not quite true. Visual Studio supports a number of language extensions. Still, best not to use them if you want your code to compile anywhere else.

    There's no "standard" way of installing these things on Windows, no, which is unfortunate. You can create one, of course. Just stash the .lib and the .dll (if any) in a standard location relating to the package, and add those paths to your project search path. (In the case of dlls, you may need to add the location to your PATH user environment variable.)

    Linux systems have /usr/include, /usr/lib, and /usr/bin for these things. Windows doesn't really have an equivalent "default" directory for each type of thing, but you can create them if you wish.

  15. #15
    Join Date
    May 2008
    Posts
    96

    Re: C++ and 'Make'

    The windows equivalents to those directories are:

    /usr/include
    C:\<compiler's base directory>\include

    /usr/lib
    C:\<compiler's base directory>\lib

    /usr/bin
    C:\WINDOWS\system32
    (This is where you stick DLLs.)

    For example, my C++ Turbo Explorer include and lib directories are
    C:\Program Files\Borland\BDS\4.0\include
    C:\Program Files\Borland\BDS\4.0\lib

    Hope this helps.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)