From: Frédéric L. <F.L...@hi...> - 2013-01-18 14:11:22
|
Hello, I was trying to do some unsual things (using mingw as a compiler and using Labwindows/CVI as a linker) and, as I would expect, strange things happened. I'm doing this just because it's more convenient if I can make it work well. I could avoid, but... Anyway I want to try ;) For those who don't know, Labwindows/CVI is some kind of proprietary IDE provided by National Instruments. All that stuff is related to building a "Windows graphical application". Here are some messages I get from that CVI at linking time: Undefined symbol '___chkstk_ms' referenced in "some_file.c". Undefined symbol '___main' referenced in "Main.c". Doing some (many in fact) searches on the web gave me some solutions: - use "-mno-stack-arg-probe" at compile time - define "int __main(void) { return 0; }" Here are my questions: - is this the only way to solve my problem ? - should I worry about potential future problems using the presented solutions ? - are there some hidden problems I've not already discovered ? - is this the good way to solve my problem, or is there some other way which are more... nice/beautiful/clever ? - why such errors ? My guess is that libgcc has to do something with those errors, which may rise another question "is it possible/wise to avoid this dependency ?". The most magical solution is to define a __main function. That one is quite... surprising I'd say. I'm not a C/gcc/crt/kernel guru but I'm aware of some of the processes hidden. Feel free to provide links if you don't have time to give a full explanation. Thanks in advance. Frédéric Lochon PS: did I already mention that I could just do linking using mingw but it's just not as practical as I would like ? |