add source files to embedded VC 4.0

This is a discussion on add source files to embedded VC 4.0 within the C++ Programming forums, part of the General Programming Boards category; Hello everyone, I am going to add some source files (.c, .cpp and .h) to a project in Microsoft embedded ...

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    add source files to embedded VC 4.0

    Hello everyone,


    I am going to add some source files (.c, .cpp and .h) to a project in Microsoft embedded VC++ 4.0. There are a lot of source files and they are organized in their source tree file structure. I am wondering what is the most convenient way to add them all to an embedded VC++ project. Currently, I have to add them one by one (by "Add files to project" context menu of a project), which will break original source tree structure (which adds all the source files to "Source Files" folder in FileView).


    thanks in advance,
    George

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    >>Currently, I have to add them one by one
    you don't have to add them one at a time -- just select all the files in the filelist provided.

    Before adding any files, create the tree that you want to see in FileView. Just right-click on the SourceFiles folder and select "New Folder" option.

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    1,579
    Hi Ancient,


    Quote Originally Posted by Ancient Dragon
    >>Currently, I have to add them one by one
    you don't have to add them one at a time -- just select all the files in the filelist provided.

    Before adding any files, create the tree that you want to see in FileView. Just right-click on the SourceFiles folder and select "New Folder" option.
    We have to create the folders one by one? I can not import a file structure which may contain several levels of folders?


    regards,
    George

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,592
    If the IDE lacks an "import a tree" kind of function to create a project out of a source tree, then you could make your own.

    Most IDE project files are text files, basically containing lists of text files and some other stuff. Create a few small project files and study them to get a feel of the format.

    Then try and create your own, starting with the output of say
    dir /b/s *.c *.cpp *.h

    Even if the IDE can't import a directory, it may be able to import that file list

    Personally, I'd use perl for this, but you make have other ideas.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    Quote Originally Posted by George2
    Hi Ancient,

    We have to create the folders one by one? I can not import a file structure which may contain several levels of folders?

    regards,
    George
    Yes, you have to manually create the directory tree, then right-click on each folder you created, one by one, and select the files you want to include in that folder. Do that separately for source and header files. That works identical to all other Microsoft compilers.
    Last edited by Ancient Dragon; 06-13-2006 at 03:32 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Multiple Source Files, make files, scope, include
    By thetinman in forum C++ Programming
    Replies: 13
    Last Post: 11-05-2008, 10:37 PM
  2. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 01:30 PM
  3. using a class in multiple source files???
    By Crossbow in forum C++ Programming
    Replies: 9
    Last Post: 06-18-2002, 07:42 PM
  4. linking source files
    By estranged in forum C Programming
    Replies: 9
    Last Post: 04-03-2002, 05:38 PM
  5. How to implement several source files?
    By Gades in forum C Programming
    Replies: 3
    Last Post: 11-21-2001, 01:44 PM

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