Thread: How would you do this with an IDE ?

  1. #1
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657

    How would you do this with an IDE ?

    I am reading a book, the source code of its chapters come in a directory hierarchy as follows:

    Source:
    <>/Src/Chapter_x/Program/

    Build and makefile:
    <>/Linux/Chapter_x/Program/

    Special Includes:
    <>/Src/GLTools/include/
    <>/Src/GLTools/include/GL

    Opening a project for each chapter and specifying the extra include directories is too much manual work.(to get code completion for the extra classes provided)

    Is there a way I can point at the root of the build directory and have an IDE (Eclipse, Kdevelop, QtCreator, a text editor.. anything) load the appropriate source files on demand (based on the makefiles, which also lists the extra includes)?

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    What? I don't get it.
    If there are files included locally with every project, it should already contain references to those include directories, no?
    If it's a global include directory, why don't you just configure a global path in your IDE?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by Elysia View Post
    What? I don't get it.
    If there are files included locally with every project, it should already contain references to those include directories, no?
    If it's a global include directory, why don't you just configure a global path in your IDE?
    They are global..(with some rather irregular exceptions, but those can be ignored for another 10 or so chapters).
    Thank for the suggestion, I'm definitely going to do it.

    I was looking for a more 'script'-ic solution, which parses the makefiles in the subdirs and automatically open a project for each, configuring the include and shared object paths from the makefiles.

  4. #4
    Registered User
    Join Date
    Aug 2003
    Posts
    1,218
    Make a script that creates a qtcreator project file based on the Makefile for you

  5. #5
    Registered User
    Join Date
    Nov 2009
    Location
    Maryland, USA
    Posts
    46
    What platform are you working on?

    Almost every popular file system (except the ones Windows uses) supports symbolic links.
    So if you're lucky (i.e. not using Windows) you can go into a directory the IDE knows about and create symbolic links to each sample code directory. That way, they'll look like subdirectories from the IDE's directory.

    If you have to use Windows, Microsoft has a junction tool that makes something very similar to a symbolic link, though it only works for directories.

  6. #6
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Windows supports symbolic links and hard links to files.

  7. #7
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by KenJackson View Post
    What platform are you working on?

    Almost every popular file system (except the ones Windows uses) supports symbolic links.
    So if you're lucky (i.e. not using Windows) you can go into a directory the IDE knows about and create symbolic links to each sample code directory. That way, they'll look like subdirectories from the IDE's directory.

    If you have to use Windows, Microsoft has a junction tool that makes something very similar to a symbolic link, though it only works for directories.
    Well, my sig says that I do not use Windows. (Lucky me... :P )
    The idea has merit...thank you. If I create soft links for the include folder (of the separate files) in /usr/include , that would make them accessible from many places without having to create messy makefiles.

Popular pages Recent additions subscribe to a feed