We help IT Professionals succeed at work.

Occasional LINK error: Entry Point Not Defined

De_Wagter asked
Last Modified: 2012-06-22
I'm getting a very weird linking error in Visual Studio 6 Sp2.

LINK : fatal error LNK1561: entry point must be defined

The weird thing is it happens while linking a library. (simple own lib with few douzen functions, not exe, not dll, no MFC, ...)

Even more weird is that when I try again (continue compiling) ... everything suddenly works fine...

Following link was of NO help:
http://support.microsoft.com/kb/140597 (looks exactly like my problem)

I'm using following linker options:

/nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\StdUtils" /I "..\..\FDC\include" /I "..\..\fltk" /I "..\..\OpenCV\cv\include" /I "..\..\OpenCV\cxcore\include" /I "..\..\OpenCV\otherlibs\highgui" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /Fo"Debug/" /Fd"Debug/" /FD /GZ
Watch Question

Top Expert 2009

Check the project settings : is it correctly set to build a lib ?

That will happen if you do a "build" and the build target is a main program.  Be sure you're building a library.

This one is on us!
(Get your first solution completely free - no credit card required)


The project was nicely set up to make a static /lib and never imported from an exe or dll ...

but itsmeandnobodyelse gave the solving tip. I had a hard time convincing myself to make the library over again due to the high number of files involved and the numerous subfolders but ... as it seemed to be the only option left, I copied a good library from an other part of the project, alled all files again, and.... guess waht:  "problem solved"

A quick diff against the bad library revealed that a /c got lost at some point in the project: so the linking arguments missed the final /c, which probably for the compiler means that he has to make an executable object instead of a library. At least that's what I think it is since it is the only difference between the working and non-working libraries:

/nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\StdUtils" /I "..\..\FDC\include" /I "..\..\fltk" /I "..\..\OpenCV\cv\include" /I "..\..\OpenCV\cxcore\include" /I "..\..\OpenCV\otherlibs\highgui" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /Fo"Debug/" /Fd"Debug/" /FD /GZ

 ----- should be ----->

/nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\StdUtils" /I "..\..\FDC\include" /I "..\..\fltk" /I "..\..\OpenCV\cv\include" /I "..\..\OpenCV\cxcore\include" /I "..\..\OpenCV\otherlibs\highgui" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /Fo"Debug/" /Fd"Debug/" /FD /GZ /c

you /c?

Thanks for the help guys
/c is the /COMMENT link option. I don't think that is the reason for the error.

You may compare the .dsp files to find out the differences. Or there was  .def file that had a wrong entry point definition. VC6 stores a lot of stuff in the .ncb file. I experienced every month that throwing away all temporary files like .ncb, .aps, .def, .dep, .ilk, .opt, .prj  solves strange error like 'internal compiler error' or a cillion of linker errors. And sometimes creating a new project is the only way to solve strange issues ;-)

Regards, Alex
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.