I beleive the issue is that the pre-compiled headers are missing from the project. As a Console App does not need WinUser and such include files, just stdio headers not even the libs.
Its complaining about not being able to find the external libraries not that it can find the definition for it. The symbol is missing from it....
Problem with Windows API
quote:Original post by SiCrane
You don''t have a complete program with just those lines. For a console project you need to define a function main() in order for the program to link.
Not sure you understand windows API in the underlying code there is a winMainCTR function that is called when the program exits. However its not a window program rather a DOS. Which means that it can not find the exit functions.
The main function part is correct but thats an entry point after windows gets a thread/process ID. again that is done in WinMainStartupCRT, this is where it allocates the correct memory for globals. Take a better look at the underlying API structure every compiler will allow you to see this function call after you step past the last line of your code.
quote:Original post by Anonymous Posterquote:Original post by SiCrane
You don't have a complete program with just those lines. For a console project you need to define a function main() in order for the program to link.
Not sure you understand windows API in the underlying code ...
I don't think you were following the thread properly. He was compiling a source file with those three lines and only those three lines.
edit: for that matter, I think you're the one who does understand the API correctly. The function you list is not part of the Windows API, it's a design artifact based on the compiler's choice of entry point, specifically it refers to a function inside the C runtime implementation. Furthermore, it's not trying to find an exit function, it's trying to find the runtime library defined entry point. Also, the C runtime startup function doesn't allocate memory for globals, that's done by the loader when it loads the executable image into the virtual memory space.
[edited by - SiCrane on March 9, 2004 3:53:07 PM]
Sorry for leaving this up here unposted, but I did figure it out.. Actually the only problem was that it wasn''t in a main function like someone said. I was just trying to keep it simple, guess I overdid it.
But, it is not a DOS program, it is a console windows program, so it does work with the Windows API.
But, it is not a DOS program, it is a console windows program, so it does work with the Windows API.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement