How would you do this with an IDE ?

This is a discussion on How would you do this with an IDE ? within the Tech Board forums, part of the Community Boards category; I am reading a book, the source code of its chapters come in a directory hierarchy as follows: Source: <>/Src/Chapter_x/Program/ ...

  1. #1
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,499

    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)?
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    22,897
    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
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,499
    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.
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  4. #4
    Registered User
    Join Date
    Aug 2003
    Posts
    1,209
    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
    Posts
    22,897
    Windows supports symbolic links and hard links to files.

  7. #7
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,499
    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.
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



Popular pages Recent additions subscribe to a feed

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