From: Jan S. <jan...@gm...> - 2012-08-13 05:39:29
|
Hello, I just installed MinGW and added the PATH. I can run gcc and thought everythin is fine. But now I tried to compile hello world #include<iostream> usingnamespacestd; intmain() { cout << "Hello World!"; } with: CC = g++ -g -Wno-deprecated #CFLAGS = -c $(INCLUDES) all : main main : main.o $(CC)main.o -o main main.o : main.cpp $(CC)main.cpp -o main.o clean : rm -f *.o And I am getting linker errors for the main-Part: g++ -g -Wno-deprecated main.o -o main main.o:crt1.c:(.text+0x280): multiple definition of `_mainCRTStartup' c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../crt2.o:crt1.c:(.text+0x280): first defined here main.o:crt1.c:(.text+0x2a0): multiple definition of `_WinMainCRTStartup' c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../crt2.o:crt1.c:(.text+0x2a0): first defined here main.o:crt1.c:(.text+0x2c0): multiple definition of `_atexit' c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../crt2.o:crt1.c:(.text+0x2c0): first defined here main.o:crt1.c:(.text+0x2d0): multiple definition of `__onexit' c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../crt2.o:crt1.c:(.text+0x2d0): first defined here main.o:cygming-crtbegin.c:(.text+0x2e0): multiple definition of `___gcc_register_frame' c:/mingw/bin/../lib/gcc/mingw32/4.7.0/crtbegin.o:cygming-crtbegin.c:(.text+0x0): first defined here main.o:cygming-crtbegin.c:(.text+0x36c): multiple definition of `___gcc_deregister_frame' c:/mingw/bin/../lib/gcc/mingw32/4.7.0/crtbegin.o:cygming-crtbegin.c:(.text+0x8c): first defined here main.o:crt1.c:(.bss+0x4): multiple definition of `__argc' c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../crt2.o:crt1.c:(.bss+0x4): first defined here main.o:crt1.c:(.bss+0x0): multiple definition of `__argv' c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../crt2.o:crt1.c:(.bss+0x0): first defined here main.o:fake:(.idata+0x188): multiple definition of `__imp___ZSt4cout' main.o:fake:(.idata+0x188): first defined here c:/mingw/bin/../lib/gcc/mingw32/4.7.0/crtbegin.o:cygming-crtbegin.c:(.text+0x85): undefined reference to `__Jv_RegisterClasses' What is the reason for that and how can I solve it? Any suggestions? Thanks in anticipation. Jan |