Linking to library problems.

I am trying to put some resources and C++ files into a library so that I can easily add this library to mulitiple MFC projects.

After adding the library to my solution, and moving the files accordingly, I get the message:

error LNK2001: unresolved external symbol __CorExeMain@0

upon linking of the MFC project. I don't have "CorExeMain" anywhere in my project.. it must be a VS thing.

Both the library I've created and my MFC project  depend upon a second library (codejock library)
Could this be causing the problem?

My MFC project is set as the "Single Startup Project" and is set to be the "Application (.exe)" type. My library and codejock library are set as "Static Library (.lib)" type.

I've re-built several times. Any sugestions would be most appreciated.

Thank you!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sounds like you're missing a *.lib file from your linking command.

Check the documents for your codejock library, and see what *.lib files have to be added to your project.
JoyBurkeAuthor Commented:
There are only two libraries that need to be added -- and I've added them both.

Why do you think it is missing a lib file? Do you understand that error message?
Are you sure your project contains mscoree.lib?
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

JoyBurkeAuthor Commented:
Well, it compiled and linked just fine before I added the new library I created to the solution.

Where should I look for mscoree.lib?
>>Well, it compiled and linked just fine before I added the new library I created to the solution.

Look at your new library requirements.  The linker error is indicating your missing a library.

Exactly what is the new library?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JoyBurkeAuthor Commented:
jkr - Adding mscoree.lib allowed it to link, but caused failures at run time.

Axter - the library was a .Net class library. I guess this was the wrong thing to create.

To fix my problem, I created instead a MFC DLL project and change the type to a .lib.

Thank you both for your suggestions.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.