multiple projects

This is a discussion on multiple projects within the Windows Programming forums, part of the Platform Specific Boards category; I want to start a new programming project. In this project I want to use more than one project in ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    61

    multiple projects

    I want to start a new programming project. In this project I want to use more than one project in my workspace, but still let them compile together.
    So I added two projects to my workspace. One project contains a main function, while the other doesn't. I've set the active project to the one that contains the main function. Then I added the other project as a dependency (in Project->Dependencies...).

    Now the problem is that it won't compile, because it can't find a main function in one of the projects :

    Code:
    Linking...
    LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
    Debug/LinkedList.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.
    
    Sky.exe - 2 error(s), 0 warning(s)
    So can anyone help me compile this ? I'm using MSVC++ 6.0 .

    Thanks in advance.

  2. #2
    Chief Code Coloniser!
    Join Date
    Apr 2005
    Posts
    121
    What type of projects have you created?? You need to create a static or dynamic library in one project (not a console application), and you need to link that library into your second project. If you've created two separate console projects then it won't work.

    Good luck.

  3. #3
    Registered User
    Join Date
    Feb 2005
    Posts
    61
    Thanks, creating a static library does it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 06-08-2009, 04:03 PM
  2. How to open multiple projects in Dev C++?
    By asmileguo in forum Tech Board
    Replies: 6
    Last Post: 08-26-2006, 02:14 AM
  3. Linker errors - Multiple Source files
    By nkhambal in forum C Programming
    Replies: 3
    Last Post: 04-24-2005, 03:41 AM
  4. Replies: 1
    Last Post: 05-01-2003, 03:52 PM

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