Setup multi project in one solution in VS2005

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jk2l
    New Member
    • Aug 2007
    • 5

    Setup multi project in one solution in VS2005

    Code:
    Solution
    |
    +-- Project 1
    |
    +-- Project 2 (downloaded from somewhere)
    |
    +-- Project 3 (my project)
    
    Project 1 generate exe
    Project 2 and 3 generate dll
    reason of this setup is that I want to make my Project 3 will be able to used in other program. Right now i can create a program but I can't link my Project 1 with Project 2 and Project 3


    error C2065: 'Model_3DS' : undeclared identifier <--- this is the error i am getting

    if i add the header files with #include it report other random error. can anyone give me an idea of how to setup my solution properly?
  • jk2l
    New Member
    • Aug 2007
    • 5

    #2
    http://support.microso ft.com/kb/310674/

    er... actually using Project Refernece should have solved the problem, what's causing problem is that i also need to set the project to Multithreaded, not Multithreaded DLL under "Properties -> Configuration Properties -> C&C++ -> Code Generation -> Runtime Library".

    i really hate the compiler output that can't explain what the hell is going on and wasted so many of my times :S

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      OK. So you create your Project 3.

      Any header files are included by the preprocessor #include and do not need to be part of project 3. You may need to go to Project->Properties->Congiguratio n Properties->C/C++->Preprocessor->Addtional Include Directories and add paths to youe headers. You should use the #include <header> format.

      Any .cpp files from other projects must be added to project 3 as existing itemsby right-clicking on the project name->Add->Add Existing.

      Any libraries (.lib or dll) must be added to project 3 as an addtional linker dependency. Project 3->Properties->Configuratio n Properties->C/C++->Linker->Input->Addtional Dependencies.

      You will need to add a path to the library. Tools->Options->Projects and Solutions->VC++ Directories->Libraries(righ t pane drop doen menu).

      If you are using LoadLibrary() for dynamiuc linking, then you do not need to do anything about adding the library or the path to it in the project properties. LoadLibrary() accepts the path and returns and HMODULE you can use for the duration to refer to the library.

      Comment

      Working...