CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2007
    Location
    Scotland
    Posts
    137

    organizing code files in a .lib

    I'm trying to organize the code files on a project I am working on just now, currently I have all the files in the same directory and these files are in different 'filters' in my visual c++ project (visual c++ express 2008) seperating them into there different modules.

    It's not that big of a problem them being all in the same directory but when I want to use the library I need all the headers of the project in one directory and all the source files in another, is there any way to do this in visual c++ or whats the normal way of doing this?

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

    Re: organizing code files in a .lib

    I have no idea why you'd need all the source files in the same directory. That shouldn't matter. Headers you can put wherever you like, just adjust the Additional Include Directories accordingly. Similar for .libs and the Additional Library Directories.

  3. #3
    Join Date
    Oct 2007
    Location
    Scotland
    Posts
    137

    Re: organizing code files in a .lib

    but when I goto Filter->Add New Item->... it will place the file in the project folder rather than the corresponding directory?

    and I now have a LOT of .cpp files in the project directory, when I try to move them to a directory for the 'module' they should be in
    it gives me a linker error.
    Last edited by staticVoid; January 20th, 2009 at 08:35 AM.

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

    Re: organizing code files in a .lib

    You have two options....

    1) Open the .vcproj file in a text editor and manually edit the file paths, or
    2) Remove all files from the project, put them where you want, and then re-add them using "Add Existing Item".

    Note this will only work for source files. Adding an include file is just for convenience, it doesn't actually modify the Include Directories.

  5. #5
    Join Date
    Oct 2007
    Location
    Scotland
    Posts
    137

    Re: organizing code files in a .lib

    thanks for your reply, would I be better to just leave all the files in the project directory until I've finished the project or would it be better to separate them? say I wanted to change a directory name, would it mean I would have to reload all the files again?

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured