Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
alex100 is currently offline  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 Go to previous messageGo to next message
forlano is currently offline  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 #12768 is a reply to message #12760] Thu, 15 November 2007 10:23 Go to previous messageGo to next message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
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

Re: why "___main: duplicate" ? [message #12769 is a reply to message #12723] Thu, 15 November 2007 13:47 Go to previous messageGo to next message
mirek is currently offline  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 #12770 is a reply to message #12769] Thu, 15 November 2007 14:05 Go to previous messageGo to next message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
What about

Which includes are needed to create and open a SQlite database in the HelloWorld Main Window?

Any information, help file, tutorial?

ALex
Re: why "___main: duplicate" ? [message #12771 is a reply to message #12768] Thu, 15 November 2007 14:21 Go to previous messageGo to next message
forlano is currently offline  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
Re: why "___main: duplicate" ? [message #12772 is a reply to message #12771] Thu, 15 November 2007 14:25 Go to previous messageGo to next message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
Ok,

But The main reason I put the first message in this forum was about:


Which includes are needed to create and open a SQlite database in the HelloWorld Main Window?

Any information, help file, tutorial, source code?

Alex
Re: why "___main: duplicate" ? [message #12773 is a reply to message #12770] Thu, 15 November 2007 14:27 Go to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
alex100 wrote on Thu, 15 November 2007 14:05

What about

Which includes are needed to create and open a SQlite database in the HelloWorld Main Window?

Any information, help file, tutorial?

ALex


Perhaps this post should be better stay in this forum
http://www.ultimatepp.org/forum/index.php?t=thread&frm_i d=24& There you can find some useful information about sql. Moreover in the assemblies Reference and Example there are some programs using SQL. I'm not clever with SQL but I thing it is easier to start with these examples and modify them inserting a hello world rather than viceversa.

luigi
Previous Topic: RegComFiles tool...
Next Topic: Vega 5 RR
Goto Forum:
  


Current Time: Fri Apr 19 18:26:37 CEST 2024

Total time taken to generate the page: 0.04733 seconds