We help IT Professionals succeed at work.

unresolved external __tmaincrtstartup  file = libcmt.lib

norbs101
norbs101 asked
on
3,323 Views
Last Modified: 2010-05-18
I am trying to link a c progam in x64 using VS2005.   This is the error I get.  Any suggestions?

Error      1      error LNK2019: unresolved external symbol main referenced in function __tmainCRTStartup      LIBCMT.lib      
Comment
Watch Question

jkr
CERTIFIED EXPERT
Top Expert 2012

Commented:
You're linking to the static CRT, that might be an issue.  Try to go to "Project|Properties|C/C++|Code generation" and set "Runtime Library" to the appropriate "[Multithreaded] DLL" option (/MDd for the debug configuration, /MD for the release config). If that does not resolve the issue, see what happens if you turn off "Buffer security check" in the same otions page for your project.

Author

Commented:
The runtime library is fine.  /MT which should be for release non-dll, correct me if I'm wrong.  Changing the Buffer Security Check to no didn't fix anything.
jkr
CERTIFIED EXPERT
Top Expert 2012

Commented:
>>/MT which should be for release non-dll

Yes, that's what you should change to "Release, DLL".

Author

Commented:
This would create a .dll...   I need to compile to .exe
CERTIFIED EXPERT
Top Expert 2012
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
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.

OR

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.