|
From: C. M. <cos...@gm...> - 2010-01-07 23:25:07
|
Hi, I thank all of you for attempting to help me. I am reading a lot of documentation (really, more than I expect to). By the way,I have found a code sample of a scrensaver, which contains its own WinMain function. So, I have coded a simple code which invokes a rather simple WinMain() function and 'g++ -c mycode.cpp', and then 'g++ -o mycode mycode.o' and, Eureka, it generates an executable, without warnings nor errors! So, I think that is the way. I am working now on writtimg a more elaborated version of that WinMain() function, in order to instruct my program in how parameteers must be read from the cmdline, and how the rest of the program has to interpret them. Of course, it implies more work but it will be worth! On the other hand, we have to be carefull because there is a lot of no-solutions in these forums, and not all what we find is really true, and could lead us to non sense ways, as the '-lSDMain -lSDL -mwindows' 'solution', that I encountered which does not solve the problem at all, mainly when I don't need Simple DirectMedia Layer at all! Taking a positive actitude, those comments make me learn about SDL and other interesting things! Thanks, Markanikoff 2010/1/7 Andrew Fleenor <and...@sb...>: >> From: C. Marcano <cos...@gm...> >> Subject: [Mingw-users] Undefined reference to WinMain@16 >> >> Hi, everybody: >> I am just starting to use cygwin/gcc/mingw environment. So, I am >> a novice. >> I am tryng to compile a simple C++ program, with g++. It compiles >> without error, but when I try to 'g++ -o test test.o', the linker reports: >> "Undefined reference to WinMain@16" > > Depending on what library you are using, you might need to make sure that your main function has exactly the right signature, ie. int main(int, char**). You definitely need to be careful of this if you use SDL. > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > MinGW-users mailing list > Min...@li... > > This list observes the Etiquette found at > http://www.mingw.org/Mailing_Lists. > We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated. > > _______________________________________________ > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > |