Code::Blocks Forums

User forums => Help => Topic started by: sethjackson on January 19, 2006, 08:44:01 pm

Title: Weird error
Post by: sethjackson 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
-------------- Build: default in Hello World ---------------
Linking console executable: Hello World.exe
.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.....  :P Happens with RC2 too.

EDIT:

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

Code: cpp
#include <iostream>
#include <limits>

int main(int argc, char* argv[])
{
    std::cout << "The minimum int is ";
    std::cout << std::numeric_limits<int>::min() << std::endl;

    std::cout << "The minimum long is ";
    std::cout << std::numeric_limits<long>::min() << std::endl;

    std::cout << "The maximum long is ";
    std::cout << std::numeric_limits<long>::max() << std::endl;

    std::cout << "Press Enter to exit.";

    std::cin.get();

    return 0;
}
Title: Re: Weird error
Post by: thomas on January 19, 2006, 08:48:10 pm
Weird...

Code
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?
Title: Re: Weird error
Post by: sethjackson on January 19, 2006, 08:52:02 pm
Weird...

Code
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).

[attachment deleted by admin]
Title: Re: Weird error
Post by: thomas on January 19, 2006, 08:59:50 pm
Code
-------------- 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...?
Title: Re: Weird error
Post by: sethjackson on January 19, 2006, 09:05:08 pm
Code
-------------- 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.  :?
Title: Re: Weird error
Post by: sethjackson 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????  :(
Title: Re: Weird error
Post by: sethjackson on January 19, 2006, 10:27:38 pm
Ok It works now I did a rebuild and it works.....  :shock:
Title: Re: Weird error
Post by: davereid20 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
-------------- 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
Title: Re: Weird error
Post by: mandrav 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.
Title: Re: Weird error
Post by: thomas 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... :)
Title: Re: Weird error
Post by: mandrav 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 ;)
Title: Re: Weird error
Post by: sethjackson 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)....
Title: Re: Weird error
Post by: Michael 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? :D

Michael
Title: Re: Weird error
Post by: Der Meister 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.
Title: Re: Weird error
Post by: Michael 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
Title: Re: Weird error
Post by: yop on January 20, 2006, 06:37:55 pm
Who is still using RC2? :D
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.