Thread: multiple projects

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