### Author Topic: Weird error  (Read 12935 times)

#### sethjackson

• Guest
##### Weird error
« on: January 19, 2006, 08:44:01 pm »
Hmm I tried compiling my (modfied) hello world sample, and one of my own console projects with rev 1813 and lookie what I found....

Code: [Select]
-------------- Build: default in Hello World ---------------
.objs\main.o:locale-misc-inst.cc:(.text+0x220): multiple definition of `mainCRTStartup'
C:/Program Files/CodeBlocks/bin/../lib/gcc/mingw32/3.4.4/../../../crt2.o:crt1.c:(.text+0x220): first defined here
.objs\main.o:locale-misc-inst.cc:(.text+0x240): multiple definition of `WinMainCRTStartup'
C:/Program Files/CodeBlocks/bin/../lib/gcc/mingw32/3.4.4/../../../crt2.o:crt1.c:(.text+0x240): first defined here
.objs\main.o:locale-misc-inst.cc:(.text+0x260): multiple definition of `atexit'
C:/Program Files/CodeBlocks/bin/../lib/gcc/mingw32/3.4.4/../../../crt2.o:crt1.c:(.text+0x260): first defined here
.objs\main.o:locale-misc-inst.cc:(.text+0x270): multiple definition of `_onexit'
C:/Program Files/CodeBlocks/bin/../lib/gcc/mingw32/3.4.4/../../../crt2.o:crt1.c:(.text+0x270): first defined here
.objs\main.o:locale-misc-inst.cc:(.text+0x280): multiple definition of `__do_sjlj_init'
C:/Program Files/CodeBlocks/bin/../lib/gcc/mingw32/3.4.4/crtbegin.o:crtstuff.c:(.text+0x0): first defined here
.objs\main.o:crtstuff.c:(.bss+0x4): multiple definition of `_argc'
C:/Program Files/CodeBlocks/bin/../lib/gcc/mingw32/3.4.4/../../../crt2.o:crt1.c:(.bss+0x4): first defined here
.objs\main.o:crtstuff.c:(.bss+0x0): multiple definition of `_argv'
C:/Program Files/CodeBlocks/bin/../lib/gcc/mingw32/3.4.4/../../../crt2.o:crt1.c:(.bss+0x0): first defined here
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

I did not have this problem before.....  Happens with RC2 too.

EDIT:

Here is the code from one of my console programs...

Code: C++
1. #include <iostream>
2. #include <limits>
3.
4. int main(int argc, char* argv[])
5. {
6.     std::cout << "The minimum int is ";
7.     std::cout << std::numeric_limits<int>::min() << std::endl;
8.
9.     std::cout << "The minimum long is ";
10.     std::cout << std::numeric_limits<long>::min() << std::endl;
11.
12.     std::cout << "The maximum long is ";
13.     std::cout << std::numeric_limits<long>::max() << std::endl;
14.
15.     std::cout << "Press Enter to exit.";
16.
17.     std::cin.get();
18.
19.     return 0;
20. }
21.

#### thomas

• Lives here!
• Posts: 3979
##### Re: Weird error
« Reply #1 on: January 19, 2006, 08:48:10 pm »
Weird...

Code: [Select]
mingw32-g++.exe  -IC:\MinGW\include  -c D:\Desktop\foo.cpp -o D:\Desktop\foo.o
mingw32-g++.exe -LC:\MinGW\lib  -o D:\Desktop\foo.exe D:\Desktop\foo.o
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings

Do you link against anything special?
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

#### sethjackson

• Guest
##### Re: Weird error
« Reply #2 on: January 19, 2006, 08:52:02 pm »
Weird...

Code: [Select]
mingw32-g++.exe  -IC:\MinGW\include  -c D:\Desktop\foo.cpp -o D:\Desktop\foo.o
mingw32-g++.exe -LC:\MinGW\lib  -o D:\Desktop\foo.exe D:\Desktop\foo.o
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings

Do you link against anything special?

AFAIK no here is the C::B project (with code).

#### thomas

• Lives here!
• Posts: 3979
##### Re: Weird error
« Reply #3 on: January 19, 2006, 08:59:50 pm »
Code: [Select]
-------------- Build: default in System Limits ---------------
mingw32-g++.exe  -IC:\MinGW\include  -c main.cpp -o .objs\main.o
mingw32-g++.exe -LC:\MinGW\lib  -o "System Limits.exe" .objs\main.o
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings

Compiler screwed up...?
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

#### sethjackson

• Guest
##### Re: Weird error
« Reply #4 on: January 19, 2006, 09:05:08 pm »
Code: [Select]
-------------- Build: default in System Limits ---------------
mingw32-g++.exe  -IC:\MinGW\include  -c main.cpp -o .objs\main.o
mingw32-g++.exe -LC:\MinGW\lib  -o "System Limits.exe" .objs\main.o
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings

Compiler screwed up...?

Dunno I re-installed C::B RC2 with MinGW and it still doesn't work.  :?

#### sethjackson

• Guest
##### Re: Weird error
« Reply #5 on: January 19, 2006, 09:11:31 pm »
Thomas what do you have in your path var?

EDIT:

Here is some of my path.

C:\Program Files\CodeBlocks\bin;C:\Program Files\CodeBlocks\mingw32\bin;

Is that correct?

Also if I take the above away. C::B svn gives me a error. "mingwm10.dll not found", and the update.bat script goes wacky?
« Last Edit: January 19, 2006, 09:22:35 pm by sethjackson »

#### sethjackson

• Guest
##### Re: Weird error
« Reply #6 on: January 19, 2006, 10:27:38 pm »
Ok It works now I did a rebuild and it works.....  :shock:
« Last Edit: January 19, 2006, 10:30:15 pm by sethjackson »

#### davereid20

• Multiple posting newcomer
• Posts: 16
##### Re: Weird error
« Reply #7 on: January 20, 2006, 04:16:00 am »
I'm having this same error happen to me too. My program compiles fine under UNIX & GCC, and when I compile with MinGW GCC in the command line, but not using Code::Blocks.

Code: [Select]
-------------- Build: default in pretest ---------------
mingw32-g++.exe -Wall  -I- -I. -I"C:\Program Files\MinGW\include" -I -c TestStack.cpp -o .objs\TestStack.o
mingw32-g++.exe -L"C:\Program Files\MinGW\lib"  -o TestStack.exe .objs\TestStack.o
.objs\TestStack.o:locale-misc-inst.cc:(.text+0x270): multiple definition of `mainCRTStartup'
C:/Program Files/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../crt2.o:crt1.c:(.text+0x270): first defined here
.objs\TestStack.o:locale-misc-inst.cc:(.text+0x290): multiple definition of `WinMainCRTStartup'
C:/Program Files/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../crt2.o:crt1.c:(.text+0x290): first defined here
.objs\TestStack.o:locale-misc-inst.cc:(.text+0x2b0): multiple definition of `atexit'
C:/Program Files/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../crt2.o:crt1.c:(.text+0x2b0): first defined here
.objs\TestStack.o:locale-misc-inst.cc:(.text+0x2c0): multiple definition of `_onexit'
C:/Program Files/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../crt2.o:crt1.c:(.text+0x2c0): first defined here
.objs\TestStack.o:locale-misc-inst.cc:(.text+0x2d0): multiple definition of `__do_sjlj_init'
C:/Program Files/MinGW/bin/../lib/gcc/mingw32/3.4.5/crtbegin.o:crtstuff.c:(.text+0x0): first defined here
.objs\TestStack.o:crtstuff.c:(.bss+0x4): multiple definition of `_argc'
C:/Program Files/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../crt2.o:crt1.c:(.bss+0x4): first defined here
.objs\TestStack.o:crtstuff.c:(.bss+0x0): multiple definition of `_argv'
C:/Program Files/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../crt2.o:crt1.c:(.bss+0x0): first defined here
C:\Program Files\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: BFD 2.16.91 20050827 assertion fail ../../src/bfd/cofflink.c:1926
collect2: ld returned 5 exit status
Process terminated with status 1 (0 minutes, 3 seconds)
0 errors, 0 warnings
« Last Edit: January 20, 2006, 04:35:14 am by davereid20 »
Windows XP Pro SP2
Code::Blocks Nightly SVN
wxWidgets 2.6.2 Unicode MinGW 3.4.5 Candidate

#### mandrav

• Lives here!
• Posts: 4305
##### Re: Weird error
« Reply #8 on: January 20, 2006, 08:51:14 am »
I'm having this same error happen to me too. My program compiles fine under UNIX & GCC, and when I compile with MinGW GCC in the command line, but not using Code::Blocks.

Please wait for today's nightly build, or get the last nightly before yesterday's. Yesterday's has a bug that breaks many compilations.
Be patient!
This bug will be fixed soon...

#### thomas

• Lives here!
• Posts: 3979
##### Re: Weird error
« Reply #9 on: January 20, 2006, 10:12:13 am »
What really made me wonder was that:

Quote
Happens with RC2 too.

This kind of excluded the possibility that it was the include path bug. But since it works now...
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

#### mandrav

• Lives here!
• Posts: 4305
##### Re: Weird error
« Reply #10 on: January 20, 2006, 10:22:53 am »
What really made me wonder was that:

Quote
Happens with RC2 too.

This kind of excluded the possibility that it was the include path bug. But since it works now...

Well, he was probably meaning he re-installed the MinGW part of RC2. I can't imagine him wanting to work with RC2
Be patient!
This bug will be fixed soon...

#### sethjackson

• Guest
##### Re: Weird error
« Reply #11 on: January 20, 2006, 05:32:31 pm »
What really made me wonder was that:

Quote
Happens with RC2 too.

This kind of excluded the possibility that it was the include path bug. But since it works now...

Well, he was probably meaning he re-installed the MinGW part of RC2. I can't imagine him wanting to work with RC2

Yeah :lol: I just installed RC2 for the compiler (and so I can help ppl if they have a problem with RC2)....

#### Michael

• Lives here!
• Posts: 1608
##### Re: Weird error
« Reply #12 on: January 20, 2006, 06:20:27 pm »
(and so I can help ppl if they have a problem with RC2)....

Who is still using RC2?

Michael

#### Der Meister

• Regular
• Posts: 307
##### Re: Weird error
« Reply #13 on: January 20, 2006, 06:26:34 pm »
Probably a lot of people because they prefer offical releases that are marked as "stable".  :wink:

Anyway, a current version directly form svn or one of the nightly builds is of course the better choice and these are most of the time at least as stable as RC2 was.
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

#### Michael

• Lives here!
• Posts: 1608
##### Re: Weird error
« Reply #14 on: January 20, 2006, 06:36:46 pm »
Probably a lot of people because they prefer offical releases that are marked as "stable".  :wink:

Hmmm. I think you are right . I have remarked that some people prefer "stable" release, instead of in-development ones. But in the case of C::B, I think that actually a nightly build or do-a-build-by-yourself is a better option that downloading an official release (especially when relatively old).

Michael

#### yop

• Regular
• Posts: 387
##### Re: Weird error
« Reply #15 on: January 20, 2006, 06:37:55 pm »
Who is still using RC2?
Most of the codeblocks users do. If you see the downloads statistics at sf, cb has more than 30 000 downloads since the release of rc2 (and that's only the windows binaries). I've been answering many questions on cb rc2 in other forums.
Life would be so much easier if we could just look at the source code.