|
|
Home » Extra libraries, Code snippets, applications etc. » Applications created with U++ » why "___main: duplicate" ?
why "___main: duplicate" ? [message #12723] |
Wed, 14 November 2007 11:45 |
alex100
Messages: 118 Registered: November 2007
|
Experienced Member |
|
|
Hi all,
I am new to U++ and I think it is a great TOOL!!
So I am trying my first programs (examples) e for several times when linking the folowing erro appear:
___main: duplicate
-> used: libmingw32.a:gccmain.o:1
-> discarded: libgcc.a:__main.o:1
1 undefined symbol(s):
Why compiling MyUppApp downloaded from the forum it also have this error! see output:
----- CtrlLib ( GUI GCC DEBUG DEBUG_FULL BLITZ WIN32 ) (1 / 9)
----- CtrlCore ( GUI GCC DEBUG DEBUG_FULL BLITZ WIN32 ) (2 / 9)
----- RichText ( GUI GCC DEBUG DEBUG_FULL BLITZ WIN32 ) (3 / 9)
----- Draw ( GUI GCC DEBUG DEBUG_FULL BLITZ WIN32 ) (4 / 9)
----- Core ( GUI GCC DEBUG DEBUG_FULL BLITZ WIN32 ) (5 / 9)
----- plugin/bmp ( GUI GCC DEBUG DEBUG_FULL BLITZ WIN32 ) (6 / 9)
----- plugin\z ( GUI GCC DEBUG DEBUG_FULL BLITZ WIN32 ) (7 / 9)
----- plugin\png ( GUI GCC DEBUG DEBUG_FULL BLITZ WIN32 ) (8 / 9)
----- MyUppApp ( GUI MAIN GCC DEBUG DEBUG_FULL BLITZ WIN32 ) (9 / 9)
Linking...
(option '-O 2' ignored)
___main: duplicate
-> used: libmingw32.a:gccmain.o:1
-> discarded: libgcc.a:__main.o:1
1 undefined symbol(s):
__imp__PathAppendA@8 (referenced from c:\upp\out\myuppapp\mingw.debug_full.gui.main\$blitz.o:1; ___tcf_0; AboutI
mg::Get(char const *); AboutImg::Get(char const*); AboutImg::Find(Upp::String const &); AboutImg::Find(Upp::
String const&); ...)
linking aborted due to fatal errors
collect2: ld returned 1 exit status
There were errors. (0:00.81)
Thank you!
Alex
|
|
|
Re: why "___main: duplicate" ? [message #12760 is a reply to message #12723] |
Wed, 14 November 2007 21:46 |
|
forlano
Messages: 1185 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
alex100 wrote on Wed, 14 November 2007 11:45 | Hi all,
I am new to U++ and I think it is a great TOOL!!
So I am trying my first programs (examples) e for several times when linking the folowing erro appear:
Alex
|
Hi Alex,
which Upp version are you using? Which reference program gives that error? Which operative system and compiler are you using? please do not miss this info the next time you report a problem. This can speed the right answer, at least for me.
Moreover some old package/program downloaded from the forum could have some problem of compilation with the most recent Upp distribution.
You may consider even to zip and post the folder of your program (if it is not a secret and if it is not complex). This is the best way to obtain the wanted answer as quicly as possible.
Luigi
[Updated on: Wed, 14 November 2007 21:55] Report message to a moderator
|
|
|
|
Re: why "___main: duplicate" ? [message #12769 is a reply to message #12723] |
Thu, 15 November 2007 13:47 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
alex100 wrote on Wed, 14 November 2007 05:45 | Hi all,
I am new to U++ and I think it is a great TOOL!!
So I am trying my first programs (examples) e for several times when linking the folowing erro appear:
___main: duplicate
-> used: libmingw32.a:gccmain.o:1
-> discarded: libgcc.a:__main.o:1
1 undefined symbol(s):
Why compiling MyUppApp downloaded from the forum it also have this error! see output:
|
Actually, what is on your listing is a warning and an error.
The warning is normal: unfortanetely, it seems to be a problem in mingw ("main" is defined twice), which U++ linker detects and fixes by "discarding" one of definitions. Please ignore it.
The real error is the one after "1 undefined symbol(s):"
Mirek
[Updated on: Thu, 15 November 2007 13:48] Report message to a moderator
|
|
|
|
Re: why "___main: duplicate" ? [message #12771 is a reply to message #12768] |
Thu, 15 November 2007 14:21 |
|
forlano
Messages: 1185 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
alex100 wrote on Thu, 15 November 2007 10:23 | Hi Luigi
Ok, I, for a moments, forgot that U++ is a great tool and I forgot that is works in many operating systems, it has lost of versions and so one.
So, I am using WinXP, upp-mingw-2007.1.exe
Well, the "__main: duplicate" is happening for me for many times and the compilation of MyUppApp that I downloaded from this forum also presents that link error. There is the 7z file with the application in attachment.
This error cames up also when I try to include database capabilities to the "HelloWorld-Rudimentary HelloWorld application with menu and status bar" example that cames with upp. Please, tell me where can I find information related with:
Which includes are needed to create and open a SQlite database in the HelloWorld Main Window?
Thank you
Alex
|
Hi Alex,
as said Luzr the problem is with the compiler. I got the same error. In particular MyUppApp use some code that doesn't like to mingw compiler and I guess related to the function "PathAppend". In the past I compiled it with MSC8 and worked OK.
Now I commented all the blocks in which appear PathAppend
#ifdef flagWIN32
TCHAR szPath[MAX_PATH];
SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, szPath);
PathAppend(szPath,"MyUppApp");
PathAppend(szPath, cfgfile);
fullpathtocfgfile = szPath;
#else
fullpathtocfgfile = cfgfile;
#endif
and the program compile and run although at runtime signal some problem. Please try yourself. Moreover do not stop to do test other packages and if something is not clear come back and ask.
Luigi
|
|
|
|
|
Goto Forum:
Current Time: Wed Apr 24 18:09:31 CEST 2024
Total time taken to generate the page: 0.01270 seconds
|
|
|