|
From: hhh h. <the...@ho...> - 2008-03-30 16:57:08
|
Jan : Hi there :D I'll assume you've read the excellent response by Per Westermark, so your prob is WinMain@16 ? well, this actually is a Linker error... the linker is complaining because PE files do contain, like every other executable formats an Entry Point. This, in C, are main our WinMain functions ( the latter in case, of win32 executables obviously. ) now if you do not provide a entry point for your program then there is no way the linker can calculate the offset of your functions,Data, and ultimatly instructions from the starting address, the latter being *roughfly* the entry point(main/WinMain)... :D Get it ? > From: jan...@vo...> To: dev...@li...> Date: Sun, 30 Mar 2008 03:49:35 +0200> Subject: [Dev-C++] The Winmain function> > Hello,> > maybe it is clear but I am a little bit confused.> > This is the source code:> > #include<stdio.h>> #include<string.h>> > const char *module_name = "conf_proces.c";> > const char *conf_file_name = "..\\conf\\conf.xml";> > int conf_file_read(const char *in_conf_file_name)> {> const char *function_name = "conf_file_read";> const char *err_msg;> int i;> FILE *p_fo;> > /*open and read the conf file*/> if ((p_fo = fopen (conf_file_name, "r")) == NULL)> {> /* ERROR PROCESSING */> err_msg = strcat ("Cannot open the configuration file: ", strcat> (in_conf_file_name, "\n"));> /* write_err (module_name, function_name, err_msg); */> }> > > if ( (i = (fclose (p_fo) != 0)))> {> /* ERROR PROCESSING */> err_msg = strcat ("Cannot close the configuration file: ", strcat> (in_conf_file_name, "\n"));> /* write_err (module_name, function_name, err_msg); */> }> return 0;> }> > And this is the gcc outpput:> C:\Documents and Settings\Jan Mura\_myhome\dev\dialogues\src>gcc > conf_process.c> conf_process.c: In function `conf_file_read':> conf_process.c:27: warning: passing arg 1 of `strcat' discards qualifiers > from p> ointer target type> conf_process.c:36: warning: passing arg 1 of `strcat' discards qualifiers > from p> ointer target type> C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../libmingw32.a(main.o)(.text+0x10> 6):main.c: undefined reference to `WinMain@16'> collect2: ld returned 1 exit status> > It is ok with these warnings, I understand it.> But I don't understand what means the error message about the WinMain > function. There is no main neither WinMain. I don't use windows.h, Win > components or anything like that.> > Jan Mura> jan...@vo...> > > > -------------------------------------------------------------------------> Check out the new SourceForge.net Marketplace.> It's the best place to buy or sell services for> just about anything Open Source.> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace> _______________________________________________> Dev-cpp-users mailing list> Dev...@li...> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
Instale a Barra de Ferramentas com Desktop Search e ganhe EMOTICONS para o Messenger! É GRÁTIS!
http://www.msn.com.br/emoticonpack |