none
wrong objects will be deleted while rebuilding a project. RRS feed

  • Question

  • There ist a Project named "Project A".

    I will copy it to "Project A V2". (Using the Explorer)

    Then I compile "Project A V2".

    After that most off all objects (*.obj) from "Project A" are deleted.

    What ist the reason and how can I stop it?

    Is there someone can help me?


    Axel


    • Edited by Axel60 Tuesday, March 15, 2016 1:24 PM
    Tuesday, March 15, 2016 1:16 PM

Answers

  • Hi Axel60,

    >>I compile "Project A V2" with the option "build new".

    build new means delete all the old things and create new things instead.

    >>If there are missing, you must compile your whole project new.

    According to your description, I suggest you remove the Project Dependencies for your projects. Then you won't need to build all your projects.

    Best Regards,
    Li Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, March 25, 2016 6:41 AM

All replies

  • Hi Axel60,

    >>After that most off all objects (*.obj) from "Project A" are deleted.

    According to your above description I assume your project is a C++ or C project. If I’m wrong, please clarify what type your project.

    If so, you could first have a look at below threads. As they say, the .obj files are compiled source files and they are not needed at runtime, they are used only by linker. They are some temporary files. So, when you build the project and if the program could be successfully compiled, the .obj files would be generated again.
    http://stackoverflow.com/questions/21140021/why-are-c-obj-files-important [C++ Project]
    http://stackoverflow.com/questions/7718299/whats-an-object-file-in-c [C project]

    Best Regards,
    Li Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, March 17, 2016 1:29 AM
  • How do you compile "Project A V2": do you open it in Visual Studio (which version?), or do you run MSBuild from a Command Prompt window?

    What is the value of the Intermediate Directory setting on the General property page? (It is saved as the IntDir property in the *.vcxproj file.) If you have an absolute path there, that could explain the problem.

    The C# build system saves the absolute paths of produced files to the *.FileListAbsolute file in the obj directory, and deletes those files during the next build if they are not produced again. Thus, if you build a C# project in one directory, copy it to a different directory, and build it in that directory too, I think it is by design that MSBuild deletes some files from the original directory. However, I don't think C or C++ projects use that kind of incremental-clean mechanism; the CppClean target instead searches for files in $(IntDir).

    Thursday, March 17, 2016 5:48 PM
  • Thanks for your answer.

    You are right. It is a C++ Project with more than 1000 *.obj files.

    These files are very important. If there are missing, you must compile your whole project new.

    Second problem: not only the *.obj - files are missing, also the generated *.dll, *.lib and *.exe - files.

    So I can't build a setup without new compiling all my project files.


    Axel

    Friday, March 18, 2016 2:12 PM
  • I use VisualStudio 2010 and C++ language. <o:p></o:p>

    I compile "Project A V2" with the option "build new".<o:p></o:p>

    The Settings of the macros "InDir" and so on are correct. <o:p></o:p>

    I have looked for that. <o:p></o:p>

    Is it possible that a Database created from VS inhibits pathnames from the old project?<o:p></o:p>



    Axel

    Friday, March 18, 2016 2:18 PM
  • Hi Axel60,

    >>I compile "Project A V2" with the option "build new".

    build new means delete all the old things and create new things instead.

    >>If there are missing, you must compile your whole project new.

    According to your description, I suggest you remove the Project Dependencies for your projects. Then you won't need to build all your projects.

    Best Regards,
    Li Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, March 25, 2016 6:41 AM