error in compiling/linking a C program

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

error in compiling/linking a C program

Ricardo Viegas
Hello there!

This is my first posting to this forum; so if it is not the appropriate one, excuse me, and please, if possible inform me the appropriate one.

I am at the very begining of learning the C language ("hello world" step...!) and I am trying to use GCC with MinGW, but every time I try to compile I get the message:

"collect2.exe: error: ld returned 1 exit status"

I googled the message and got lots of web sites addresses in return. I checked most of them, but always is something related to another kind of error or some kind of explanation related to the message, but never could find a precise and objective explanation on how to *solve* the problem.

Where can I find a precise, objective and complete (step by step) explanation on how to solve this problem? (or could somebody just send it to me?)

Thanks in advance!
 

Try IM ToolPack Try FREE IM ToolPack at www.imtoolpack.com
Capture screenshots, upload images, edit and send them to your friends
through IMs, post on Twitter®, Facebook®, MySpace, LinkedIn® – FAST!

------------------------------------------------------------------------------

_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: error in compiling/linking a C program

Manolo
ld is the GNU linker. Likely you are not telling the right parameters or
libraries to link with.

If you show your code, the command you use to compile and link it,
perhaps some one may help you.


------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: error in compiling/linking a C program

Ricardo Viegas
The code (file "teste1.c"):

#include <stdio.h>
main() {
         printf("Olah!\n");
         printf("Bom dia\n");  
        }


The command to compile and link it:

gcc teste1.c


Thanks!

> -----Original Message-----
> From: [hidden email]
> Sent: Fri, 07 Nov 2014 13:55:05 +0100
> To: [hidden email]
> Subject: Re: [Mingw-users] error in compiling/linking a C program
>
> ld is the GNU linker. Likely you are not telling the right parameters or
> libraries to link with.
>
> If you show your code, the command you use to compile and link it,
> perhaps some one may help you.
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> MinGW-users mailing list
> [hidden email]
>
> This list observes the Etiquette found at
> http://www.mingw.org/Mailing_Lists.
> We ask that you be polite and do the same.  Disregard for the list
> etiquette may cause your account to be moderated.
>
> _______________________________________________
> You may change your MinGW Account Options or unsubscribe at:
> https://lists.sourceforge.net/lists/listinfo/mingw-users
> Also:
> mailto:[hidden email]?subject=unsubscribe

____________________________________________________________
Can't remember your password? Do you need a strong and secure password?
Use Password manager! It stores your passwords & protects your account.
Check it out at http://mysecurelogon.com/manager



------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: error in compiling/linking a C program

Paul Moore
On 7 November 2014 13:28, Ricardo Viegas <[hidden email]> wrote:

> The code (file "teste1.c"):
>
> #include <stdio.h>
> main() {
>          printf("Olah!\n");
>          printf("Bom dia\n");
>         }
>
>
> The command to compile and link it:
>
> gcc teste1.c

Works for me. So I suggest that your installation is somehow
incorrect. You probably need to describe how you installed gcc, how
you set up your PATH, that sort of thing.

Paul

------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: error in compiling/linking a C program

Eli Zaretskii
In reply to this post by Ricardo Viegas
> Date: Fri, 7 Nov 2014 05:28:53 -0800
> From: Ricardo Viegas <[hidden email]>
>
> The code (file "teste1.c"):
>
> #include <stdio.h>
> main() {
>          printf("Olah!\n");
>          printf("Bom dia\n");  
> }
>
>
> The command to compile and link it:
>
> gcc teste1.c

Try this instead:

  gcc -v teste1.c

Then post here everything that the compiler prints in response.

------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: error in compiling/linking a C program

Ricardo Viegas
Here goes the output:

D:\Programas\C>gcc -v teste1.c
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32 --build=m
ingw32 --without-pic --enable-shared --enable-static --with-gnu-ld --enable-lto
--enable-libssp --disable-multilib --enable-languages=c,c++,fortran,objc,obj-c++
,ada --disable-sjlj-exceptions --with-dwarf2 --disable-win32-registry --enable-l
ibstdcxx-debug --enable-version-specific-runtime-libs --with-gmp=/usr/src/pkg/gm
p-5.1.2-1-mingw32-src/bld --with-mpc=/usr/src/pkg/mpc-1.0.1-1-mingw32-src/bld --
with-mpfr= --with-system-zlib --with-gnu-as --enable-decimal-float=yes --enable-
libgomp --enable-threads --with-libiconv-prefix=/mingw32 --with-libintl-prefix=/
mingw --disable-bootstrap LDFLAGS=-s CFLAGS=-D_USE_32BIT_TIME_T
Thread model: win32
gcc version 4.8.1 (GCC)
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
 c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/cc1.exe -quiet -v -iprefix c:\mingw\b
in\../lib/gcc/mingw32/4.8.1/ teste1.c -quiet -dumpbase teste1.c -mtune=generic -
march=pentiumpro -auxbase teste1 -version -o d:\Temp\ccq2ZZRc.s
GNU C (GCC) version 4.8.1 (mingw32)
        compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2,
MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/inclu
de"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/../..
/../../include"
ignoring nonexistent directory "/mingw/include"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/inclu
de-fixed"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/../..
/../../mingw32/include"
ignoring nonexistent directory "/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
 c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include
 c:\mingw\bin\../lib/gcc/mingw32/4.8.1/../../../../include
 c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include-fixed
 c:\mingw\bin\../lib/gcc/mingw32/4.8.1/../../../../mingw32/include
End of search list.
GNU C (GCC) version 4.8.1 (mingw32)
        compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2,
MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 767202a405449496e68a54c4eee91a28
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
 c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/as.exe -v -o d:\T
emp\ccprPQtF.o d:\Temp\ccq2ZZRc.s
GNU assembler version 2.24 (mingw32) using BFD version (GNU Binutils) 2.24
COMPILER_PATH=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/;c:/mingw/bin/../libexec
/gcc/;c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/
LIBRARY_PATH=c:/mingw/bin/../lib/gcc/mingw32/4.8.1/;c:/mingw/bin/../lib/gcc/;c:/
mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/lib/;c:/mingw/bin/../lib/
gcc/mingw32/4.8.1/../../../
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
 c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/collect2.exe -Bdynamic c:/mingw/bin/.
./lib/gcc/mingw32/4.8.1/../../../crt2.o c:/mingw/bin/../lib/gcc/mingw32/4.8.1/cr
tbegin.o -Lc:/mingw/bin/../lib/gcc/mingw32/4.8.1 -Lc:/mingw/bin/../lib/gcc -Lc:/
mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/lib -Lc:/mingw/bin/../lib
/gcc/mingw32/4.8.1/../../.. d:\Temp\ccprPQtF.o -lmingw32 -lgcc -lgcc_eh -lmoldna
me -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -
lgcc_eh -lmoldname -lmingwex -lmsvcrt c:/mingw/bin/../lib/gcc/mingw32/4.8.1/crte
nd.o
collect2.exe: error: ld returned 1 exit status

D:\Programas\C>



> -----Original Message-----
> From: [hidden email]
> Sent: Fri, 07 Nov 2014 15:47:58 +0200
> To: [hidden email]
> Subject: Re: [Mingw-users] error in compiling/linking a C program
>
>> Date: Fri, 7 Nov 2014 05:28:53 -0800
>> From: Ricardo Viegas <[hidden email]>
>>
>> The code (file "teste1.c"):
>>
>> #include <stdio.h>
>> main() {
>>          printf("Olah!\n");
>>          printf("Bom dia\n");
>> }
>>
>>
>> The command to compile and link it:
>>
>> gcc teste1.c
>
> Try this instead:
>
>   gcc -v teste1.c
>
> Then post here everything that the compiler prints in response.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> MinGW-users mailing list
> [hidden email]
>
> This list observes the Etiquette found at
> http://www.mingw.org/Mailing_Lists.
> We ask that you be polite and do the same.  Disregard for the list
> etiquette may cause your account to be moderated.
>
> _______________________________________________
> You may change your MinGW Account Options or unsubscribe at:
> https://lists.sourceforge.net/lists/listinfo/mingw-users
> Also:
> mailto:[hidden email]?subject=unsubscribe

____________________________________________________________
Can't remember your password? Do you need a strong and secure password?
Use Password manager! It stores your passwords & protects your account.
Check it out at http://mysecurelogon.com/password-manager



------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: error in compiling/linking a C program

Eli Zaretskii
> Date: Fri, 7 Nov 2014 06:25:57 -0800
> From: Ricardo Viegas <[hidden email]>
>
> Here goes the output:
>
> D:\Programas\C>gcc -v teste1.c
> Using built-in specs.
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/lto-wrapper.exe
> Target: mingw32
> Configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32 --build=m
> ingw32 --without-pic --enable-shared --enable-static --with-gnu-ld --enable-lto
> --enable-libssp --disable-multilib --enable-languages=c,c++,fortran,objc,obj-c++
> ,ada --disable-sjlj-exceptions --with-dwarf2 --disable-win32-registry --enable-l
> ibstdcxx-debug --enable-version-specific-runtime-libs --with-gmp=/usr/src/pkg/gm
> p-5.1.2-1-mingw32-src/bld --with-mpc=/usr/src/pkg/mpc-1.0.1-1-mingw32-src/bld --
> with-mpfr= --with-system-zlib --with-gnu-as --enable-decimal-float=yes --enable-
> libgomp --enable-threads --with-libiconv-prefix=/mingw32 --with-libintl-prefix=/
> mingw --disable-bootstrap LDFLAGS=-s CFLAGS=-D_USE_32BIT_TIME_T
> Thread model: win32
> gcc version 4.8.1 (GCC)
> COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
>  c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/cc1.exe -quiet -v -iprefix c:\mingw\b
> in\../lib/gcc/mingw32/4.8.1/ teste1.c -quiet -dumpbase teste1.c -mtune=generic -
> march=pentiumpro -auxbase teste1 -version -o d:\Temp\ccq2ZZRc.s
> GNU C (GCC) version 4.8.1 (mingw32)
>         compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2,
> MPC version 1.0.1
> GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
> ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/inclu
> de"
> ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/../..
> /../../include"
> ignoring nonexistent directory "/mingw/include"
> ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/inclu
> de-fixed"
> ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/../..
> /../../mingw32/include"
> ignoring nonexistent directory "/mingw/include"
> #include "..." search starts here:
> #include <...> search starts here:
>  c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include
>  c:\mingw\bin\../lib/gcc/mingw32/4.8.1/../../../../include
>  c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include-fixed
>  c:\mingw\bin\../lib/gcc/mingw32/4.8.1/../../../../mingw32/include
> End of search list.
> GNU C (GCC) version 4.8.1 (mingw32)
>         compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2,
> MPC version 1.0.1
> GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
> Compiler executable checksum: 767202a405449496e68a54c4eee91a28
> COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
>  c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/as.exe -v -o d:\T
> emp\ccprPQtF.o d:\Temp\ccq2ZZRc.s
> GNU assembler version 2.24 (mingw32) using BFD version (GNU Binutils) 2.24
> COMPILER_PATH=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/;c:/mingw/bin/../libexec
> /gcc/;c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/
> LIBRARY_PATH=c:/mingw/bin/../lib/gcc/mingw32/4.8.1/;c:/mingw/bin/../lib/gcc/;c:/
> mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/lib/;c:/mingw/bin/../lib/
> gcc/mingw32/4.8.1/../../../
> COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
>  c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/collect2.exe -Bdynamic c:/mingw/bin/.
> ./lib/gcc/mingw32/4.8.1/../../../crt2.o c:/mingw/bin/../lib/gcc/mingw32/4.8.1/cr
> tbegin.o -Lc:/mingw/bin/../lib/gcc/mingw32/4.8.1 -Lc:/mingw/bin/../lib/gcc -Lc:/
> mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/lib -Lc:/mingw/bin/../lib
> /gcc/mingw32/4.8.1/../../.. d:\Temp\ccprPQtF.o -lmingw32 -lgcc -lgcc_eh -lmoldna
> me -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -
> lgcc_eh -lmoldname -lmingwex -lmsvcrt c:/mingw/bin/../lib/gcc/mingw32/4.8.1/crte
> nd.o
> collect2.exe: error: ld returned 1 exit status

Sounds like some problem with the linker.  What does this tell you:

  gcc -v -Wl,--verbose teste1.c

This will output a lot of info from the linker; please post all of it
here.

------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: error in compiling/linking a C program

Eli Zaretskii
In reply to this post by Ricardo Viegas
[Why private email?]

> Date: Sat, 8 Nov 2014 07:49:52 -0800
> From: Ricardo Viegas <[hidden email]>
>
> Hi Eli!
> Here comes output 2.
> Thanks for your patience and interest!
> Regards, Ricardo
> -------------------------------------------
>
> C:\Users\Ricardo>LINGC
>
> D:\Programas\C>gcc -v -Wl,--verbose teste1.c
> Using built-in specs.
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/lto-wrapper.exe
> Target: mingw32
> Configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32 --build=m
> ingw32 --without-pic --enable-shared --enable-static --with-gnu-ld --enable-lto
> --enable-libssp --disable-multilib --enable-languages=c,c++,fortran,objc,obj-c++
> ,ada --disable-sjlj-exceptions --with-dwarf2 --disable-win32-registry --enable-l
> ibstdcxx-debug --enable-version-specific-runtime-libs --with-gmp=/usr/src/pkg/gm
> p-5.1.2-1-mingw32-src/bld --with-mpc=/usr/src/pkg/mpc-1.0.1-1-mingw32-src/bld --
> with-mpfr= --with-system-zlib --with-gnu-as --enable-decimal-float=yes --enable-
> libgomp --enable-threads --with-libiconv-prefix=/mingw32 --with-libintl-prefix=/
> mingw --disable-bootstrap LDFLAGS=-s CFLAGS=-D_USE_32BIT_TIME_T
> Thread model: win32
> gcc version 4.8.1 (GCC)
> COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
>  c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/cc1.exe -quiet -v -iprefix c:\mingw\b
> in\../lib/gcc/mingw32/4.8.1/ teste1.c -quiet -dumpbase teste1.c -mtune=generic -
> march=pentiumpro -auxbase teste1 -version -o d:\Temp\cc64nzje.s
> GNU C (GCC) version 4.8.1 (mingw32)
>         compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2,
> MPC version 1.0.1
> GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
> ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/inclu
> de"
> ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/../..
> /../../include"
> ignoring nonexistent directory "/mingw/include"
> ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/inclu
> de-fixed"
> ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/../..
> /../../mingw32/include"
> ignoring nonexistent directory "/mingw/include"
> #include "..." search starts here:
> #include <...> search starts here:
>  c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include
>  c:\mingw\bin\../lib/gcc/mingw32/4.8.1/../../../../include
>  c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include-fixed
>  c:\mingw\bin\../lib/gcc/mingw32/4.8.1/../../../../mingw32/include
> End of search list.
> GNU C (GCC) version 4.8.1 (mingw32)
>         compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version 3.1.2,
> MPC version 1.0.1
> GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
> Compiler executable checksum: 767202a405449496e68a54c4eee91a28
> COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
>  c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/as.exe -v -o d:\T
> emp\ccABlV1b.o d:\Temp\cc64nzje.s
> GNU assembler version 2.24 (mingw32) using BFD version (GNU Binutils) 2.24
> COMPILER_PATH=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/;c:/mingw/bin/../libexec
> /gcc/;c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/
> LIBRARY_PATH=c:/mingw/bin/../lib/gcc/mingw32/4.8.1/;c:/mingw/bin/../lib/gcc/;c:/
> mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/lib/;c:/mingw/bin/../lib/
> gcc/mingw32/4.8.1/../../../
> COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
>  c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/collect2.exe -Bdynamic c:/mingw/bin/.
> ./lib/gcc/mingw32/4.8.1/../../../crt2.o c:/mingw/bin/../lib/gcc/mingw32/4.8.1/cr
> tbegin.o -Lc:/mingw/bin/../lib/gcc/mingw32/4.8.1 -Lc:/mingw/bin/../lib/gcc -Lc:/
> mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/lib -Lc:/mingw/bin/../lib
> /gcc/mingw32/4.8.1/../../.. --verbose d:\Temp\ccABlV1b.o -lmingw32 -lgcc -lgcc_e
> h -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw
> 32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt c:/mingw/bin/../lib/gcc/mingw32/
> 4.8.1/crtend.o
> collect2.exe: error: ld returned 1 exit status

This is the same as without -Wl,--verbose switch.  If you posted the
correct output, I'd say you don't have ld.exe on your PATH.  What does
the following command print?

  ld --version


------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: error in compiling/linking a C program

Ricardo Viegas
"ld.exe" is at "C:\MinGW\bin", that is in the path system variable:

D:\Programas\C>ld --version
GNU ld (GNU Binutils) 2.24
Copyright 2013 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.


[In the previous email I used "Reply", instead of "Reply All". Sorry about that]


> -----Original Message-----
> From: [hidden email]
> Sent: Sat, 08 Nov 2014 19:32:54 +0200
> To: [hidden email]
> Subject: Re: [Mingw-users] error in compiling/linking a C program
>
> [Why private email?]
>
>> Date: Sat, 8 Nov 2014 07:49:52 -0800
>> From: Ricardo Viegas <[hidden email]>
>>
>> Hi Eli!
>> Here comes output 2.
>> Thanks for your patience and interest!
>> Regards, Ricardo
>> -------------------------------------------
>>
>> C:\Users\Ricardo>LINGC
>>
>> D:\Programas\C>gcc -v -Wl,--verbose teste1.c
>> Using built-in specs.
>> COLLECT_GCC=gcc
>> COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/lto-wrapper.exe
>> Target: mingw32
>> Configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32
>> --build=m
>> ingw32 --without-pic --enable-shared --enable-static --with-gnu-ld
>> --enable-lto
>> --enable-libssp --disable-multilib
>> --enable-languages=c,c++,fortran,objc,obj-c++
>> ,ada --disable-sjlj-exceptions --with-dwarf2 --disable-win32-registry
>> --enable-l
>> ibstdcxx-debug --enable-version-specific-runtime-libs
>> --with-gmp=/usr/src/pkg/gm
>> p-5.1.2-1-mingw32-src/bld
>> --with-mpc=/usr/src/pkg/mpc-1.0.1-1-mingw32-src/bld --
>> with-mpfr= --with-system-zlib --with-gnu-as --enable-decimal-float=yes
>> --enable-
>> libgomp --enable-threads --with-libiconv-prefix=/mingw32
>> --with-libintl-prefix=/
>> mingw --disable-bootstrap LDFLAGS=-s CFLAGS=-D_USE_32BIT_TIME_T
>> Thread model: win32
>> gcc version 4.8.1 (GCC)
>> COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
>>  c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/cc1.exe -quiet -v -iprefix
>> c:\mingw\b
>> in\../lib/gcc/mingw32/4.8.1/ teste1.c -quiet -dumpbase teste1.c
>> -mtune=generic -
>> march=pentiumpro -auxbase teste1 -version -o d:\Temp\cc64nzje.s
>> GNU C (GCC) version 4.8.1 (mingw32)
>>         compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version
>> 3.1.2,
>> MPC version 1.0.1
>> GGC heuristics: --param ggc-min-expand=100 --param
>> ggc-min-heapsize=131072
>> ignoring duplicate directory
>> "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/inclu
>> de"
>> ignoring duplicate directory
>> "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/../..
>> /../../include"
>> ignoring nonexistent directory "/mingw/include"
>> ignoring duplicate directory
>> "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/inclu
>> de-fixed"
>> ignoring duplicate directory
>> "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.8.1/../..
>> /../../mingw32/include"
>> ignoring nonexistent directory "/mingw/include"
>> #include "..." search starts here:
>> #include <...> search starts here:
>>  c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include
>>  c:\mingw\bin\../lib/gcc/mingw32/4.8.1/../../../../include
>>  c:\mingw\bin\../lib/gcc/mingw32/4.8.1/include-fixed
>>  c:\mingw\bin\../lib/gcc/mingw32/4.8.1/../../../../mingw32/include
>> End of search list.
>> GNU C (GCC) version 4.8.1 (mingw32)
>>         compiled by GNU C version 4.8.1, GMP version 5.1.2, MPFR version
>> 3.1.2,
>> MPC version 1.0.1
>> GGC heuristics: --param ggc-min-expand=100 --param
>> ggc-min-heapsize=131072
>> Compiler executable checksum: 767202a405449496e68a54c4eee91a28
>> COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
>>  c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/as.exe -v
>> -o d:\T
>> emp\ccABlV1b.o d:\Temp\cc64nzje.s
>> GNU assembler version 2.24 (mingw32) using BFD version (GNU Binutils)
>> 2.24
>> COMPILER_PATH=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/;c:/mingw/bin/../libexec
>> /gcc/;c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/
>> LIBRARY_PATH=c:/mingw/bin/../lib/gcc/mingw32/4.8.1/;c:/mingw/bin/../lib/gcc/;c:/
>> mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/lib/;c:/mingw/bin/../lib/
>> gcc/mingw32/4.8.1/../../../
>> COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=pentiumpro'
>>  c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/collect2.exe -Bdynamic
>> c:/mingw/bin/.
>> ./lib/gcc/mingw32/4.8.1/../../../crt2.o
>> c:/mingw/bin/../lib/gcc/mingw32/4.8.1/cr
>> tbegin.o -Lc:/mingw/bin/../lib/gcc/mingw32/4.8.1
>> -Lc:/mingw/bin/../lib/gcc -Lc:/
>> mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/lib
>> -Lc:/mingw/bin/../lib
>> /gcc/mingw32/4.8.1/../../.. --verbose d:\Temp\ccABlV1b.o -lmingw32 -lgcc
>> -lgcc_e
>> h -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32
>> -lmingw
>> 32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt
>> c:/mingw/bin/../lib/gcc/mingw32/
>> 4.8.1/crtend.o
>> collect2.exe: error: ld returned 1 exit status
>
> This is the same as without -Wl,--verbose switch.  If you posted the
> correct output, I'd say you don't have ld.exe on your PATH.  What does
> the following command print?
>
>   ld --version
>

____________________________________________________________
FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family!
Visit http://www.inbox.com/photosharing to find out more!



------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: error in compiling/linking a C program

Eli Zaretskii
> Date: Sat, 8 Nov 2014 13:49:10 -0800
> From: Ricardo Viegas <[hidden email]>
> Cc: [hidden email]
>
> "ld.exe" is at "C:\MinGW\bin", that is in the path system variable:
>
> D:\Programas\C>ld --version
> GNU ld (GNU Binutils) 2.24
> Copyright 2013 Free Software Foundation, Inc.
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License version 3 or (at your option) a later version.
> This program has absolutely no warranty.

Well, somehow collect2 cannot invoke it, or maybe the LTO wrapper, to
link your program.  Make sure these all came from a MinGW distribution
(and not from MSYS, for example).

------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: error in compiling/linking a C program

Peter Rockett
On 09/11/14 03:41, Eli Zaretskii wrote:

>> Date: Sat, 8 Nov 2014 13:49:10 -0800
>> From: Ricardo Viegas <[hidden email]>
>> Cc: [hidden email]
>>
>> "ld.exe" is at "C:\MinGW\bin", that is in the path system variable:
>>
>> D:\Programas\C>ld --version
>> GNU ld (GNU Binutils) 2.24
>> Copyright 2013 Free Software Foundation, Inc.
>> This program is free software; you may redistribute it under the terms of
>> the GNU General Public License version 3 or (at your option) a later version.
>> This program has absolutely no warranty.
>
I may be missing something obvious here but why does the DOS box prompt
in the posted example appear to be "D:\Programas\C>"? Doesn't this imply
that ld is being invoked from somewhere other than C:\MinGW\bin,
regardless of the path variable?

P.


------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Fwd: Re: error in compiling/linking a C program

Peter Rockett
-------- Forwarded Message --------
Subject: Re: [Mingw-users] error in compiling/linking a C program
Date: Sun, 09 Nov 2014 09:56:08 +0000
From: Peter Rockett [hidden email]
To: [hidden email]


On 09/11/14 03:41, Eli Zaretskii wrote:
>> Date: Sat, 8 Nov 2014 13:49:10 -0800
>> From: Ricardo Viegas [hidden email]
>> Cc: [hidden email]
>>
>> "ld.exe" is at "C:\MinGW\bin", that is in the path system variable:
>>
>> D:\Programas\C>ld --version
>> GNU ld (GNU Binutils) 2.24
>> Copyright 2013 Free Software Foundation, Inc.
>> This program is free software; you may redistribute it under the terms of
>> the GNU General Public License version 3 or (at your option) a later version.
>> This program has absolutely no warranty.
>
I may be missing something obvious here but why does the DOS box prompt 
in the posted example appear to be "D:\Programas\C>"? Doesn't this imply 
that ld is being invoked from somewhere other than C:\MinGW\bin, 
regardless of the path variable?


Sorry. Ignore this!  Just read the post properly!  :-[ 

P.



------------------------------------------------------------------------------

_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: error in compiling/linking a C program

Ricardo Viegas
In reply to this post by Eli Zaretskii
I don't know how to check what you mentioned ("Make sure these all came from a MinGW distribution (and not from MSYS, for example)"), so I deleted the "C:\MinGW" directory and reinstalled MinGW again, but this time only with the "mingw32-base" option (without "mingw-developer-toolkit" and "msys-base").
The problem ocurred again, exactly the same.

> -----Original Message-----
> From: [hidden email]
> Sent: Sun, 09 Nov 2014 05:41:58 +0200
> To: [hidden email]
> Subject: Re: [Mingw-users] error in compiling/linking a C program
>
>> Date: Sat, 8 Nov 2014 13:49:10 -0800
>> From: Ricardo Viegas <[hidden email]>
>> Cc: [hidden email]
>>
>> "ld.exe" is at "C:\MinGW\bin", that is in the path system variable:
>>
>> D:\Programas\C>ld --version
>> GNU ld (GNU Binutils) 2.24
>> Copyright 2013 Free Software Foundation, Inc.
>> This program is free software; you may redistribute it under the terms
>> of
>> the GNU General Public License version 3 or (at your option) a later
>> version.
>> This program has absolutely no warranty.
>
> Well, somehow collect2 cannot invoke it, or maybe the LTO wrapper, to
> link your program.  Make sure these all came from a MinGW distribution
> (and not from MSYS, for example).

____________________________________________________________
FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your desktop!
Check it out at http://www.inbox.com/marineaquarium



------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: error in compiling/linking a C program

Ricardo Viegas
Additional point: A minute ago, I just moved the "C:\MinGW\bin" entry to be the very first one at the "PATH" system variable.
Again, same results.

> -----Original Message-----
> From: [hidden email]
> Sent: Sun, 9 Nov 2014 06:01:06 -0800
> To: [hidden email]
> Subject: Re: [Mingw-users] error in compiling/linking a C program
>
> I don't know how to check what you mentioned ("Make sure these all came
> from a MinGW distribution (and not from MSYS, for example)"), so I
> deleted the "C:\MinGW" directory and reinstalled MinGW again, but this
> time only with the "mingw32-base" option (without
> "mingw-developer-toolkit" and "msys-base").
> The problem ocurred again, exactly the same.
>
>> -----Original Message-----
>> From: [hidden email]
>> Sent: Sun, 09 Nov 2014 05:41:58 +0200
>> To: [hidden email]
>> Subject: Re: [Mingw-users] error in compiling/linking a C program
>>
>>> Date: Sat, 8 Nov 2014 13:49:10 -0800
>>> From: Ricardo Viegas <[hidden email]>
>>> Cc: [hidden email]
>>>
>>> "ld.exe" is at "C:\MinGW\bin", that is in the path system variable:
>>>
>>> D:\Programas\C>ld --version
>>> GNU ld (GNU Binutils) 2.24
>>> Copyright 2013 Free Software Foundation, Inc.
>>> This program is free software; you may redistribute it under the terms
>>> of
>>> the GNU General Public License version 3 or (at your option) a later
>>> version.
>>> This program has absolutely no warranty.
>>
>> Well, somehow collect2 cannot invoke it, or maybe the LTO wrapper, to
>> link your program.  Make sure these all came from a MinGW distribution
>> (and not from MSYS, for example).
>
> ____________________________________________________________
> FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on
> your desktop!
> Check it out at http://www.inbox.com/marineaquarium
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> MinGW-users mailing list
> [hidden email]
>
> This list observes the Etiquette found at
> http://www.mingw.org/Mailing_Lists.
> We ask that you be polite and do the same.  Disregard for the list
> etiquette may cause your account to be moderated.
>
> _______________________________________________
> You may change your MinGW Account Options or unsubscribe at:
> https://lists.sourceforge.net/lists/listinfo/mingw-users
> Also:
> mailto:[hidden email]?subject=unsubscribe

____________________________________________________________
Can't remember your password? Do you need a strong and secure password?
Use Password manager! It stores your passwords & protects your account.
Check it out at http://mysecurelogon.com/manager



------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: error in compiling/linking a C program

Renato Silva
2014-11-09 12:25 GMT-02:00 Ricardo Viegas <[hidden email]>:
> Additional point: A minute ago, I just moved the "C:\MinGW\bin" entry to be the very first one at the "PATH" system variable.
> Again, same results.

Maybe an obvious question, but do you have write permissions in the directory? Didn't ld output any error message? This is what I get for a permission error:

c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot open output file a.exe: Permission denied
collect2.exe: error: ld returned 1 exit status


------------------------------------------------------------------------------

_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: error in compiling/linking a C program

Eli Zaretskii
In reply to this post by Ricardo Viegas
> Date: Sun, 9 Nov 2014 06:25:07 -0800
> From: Ricardo Viegas <[hidden email]>
>
> Additional point: A minute ago, I just moved the "C:\MinGW\bin" entry to be the very first one at the "PATH" system variable.
> Again, same results.

What does the following command display, when invoked from a cmd.exe
window:

  c:\mingw\libexec\gcc\mingw32\4.8.1\collect2 --help


------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: error in compiling/linking a C program

Ricardo Viegas
In reply to this post by Renato Silva
I just used Kedit to create a "bat" file, saved it and executed it and it worked fine, meaning the directory is not write protected:

D:\Programas\C>KEDITW32 TEST.BAT
D:\Programas\C>TEST
D:\Programas\C>REM HELLO! HELLO! HELLO!
D:\Programas\C>

-----Original Message-----
From: [hidden email]
Sent: Mon, 10 Nov 2014 00:40:58 -0200
To: [hidden email]
Subject: Re: [Mingw-users] error in compiling/linking a C program

2014-11-09 12:25 GMT-02:00 Ricardo Viegas <[hidden email]>:
> Additional point: A minute ago, I just moved the "C:\MinGW\bin" entry to be the very first one at the "PATH" system variable.
> Again, same results.

Maybe an obvious question, but do you have write permissions in the directory? Didn't ld output any error message? This is what I get for a permission error:

c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot open output file a.exe: Permission denied
collect2.exe: error: ld returned 1 exit status


3D Earth Screensaver Preview
Free 3D Earth Screensaver
Watch the Earth right on your desktop! Check it out at www.inbox.com/earth

------------------------------------------------------------------------------

_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: error in compiling/linking a C program

Ricardo Viegas
In reply to this post by Eli Zaretskii
Output for the "help" option for the "collect2" program:

C:\Users\Ricardo>lingc

D:\Programas\C>c:\mingw\libexec\gcc\mingw32\4.8.1\collect2 --help
Usage: collect2 [options]
 Wrap linker and generate constructor code if needed.
 Options:
  -debug          Enable debug output
  --help          Display this information
  -v, --version   Display this program's version number

Overview: http://gcc.gnu.org/onlinedocs/gccint/Collect2.html
Report bugs: <http://gcc.gnu.org/bugs.html>


D:\Programas\C>


> -----Original Message-----
> From: [hidden email]
> Sent: Mon, 10 Nov 2014 07:03:23 +0200
> To: [hidden email]
> Subject: Re: [Mingw-users] error in compiling/linking a C program
>
>> Date: Sun, 9 Nov 2014 06:25:07 -0800
>> From: Ricardo Viegas <[hidden email]>
>>
>> Additional point: A minute ago, I just moved the "C:\MinGW\bin" entry to
>> be the very first one at the "PATH" system variable.
>> Again, same results.
>
> What does the following command display, when invoked from a cmd.exe
> window:
>
>   c:\mingw\libexec\gcc\mingw32\4.8.1\collect2 --help

____________________________________________________________
FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family!
Visit http://www.inbox.com/photosharing to find out more!



------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: error in compiling/linking a C program

Eli Zaretskii
> Date: Mon, 10 Nov 2014 04:47:23 -0800
> From: Ricardo Viegas <[hidden email]>
> Cc: [hidden email]
>
> D:\Programas\C>c:\mingw\libexec\gcc\mingw32\4.8.1\collect2 --help
> Usage: collect2 [options]
>  Wrap linker and generate constructor code if needed.
>  Options:
>   -debug          Enable debug output
>   --help          Display this information
>   -v, --version   Display this program's version number
>
> Overview: http://gcc.gnu.org/onlinedocs/gccint/Collect2.html
> Report bugs: <http://gcc.gnu.org/bugs.html>

That's much less that should have been printed.  Your collect2.exe is
for some reason unable to invoke ld.exe, the linker.  Perhaps
re-install Binutils, or maybe install a previous version of them.

------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: error in compiling/linking a C program

Ricardo Viegas
How should I proceed to "re-install Binutils" or to "install a previous version of them"? Sorry, but my knowledge does not reach as deeply - I only know how to install MinGW using the "mingw-get-setup.exe" program, from SourceForge .
Thx!
(just as a additional info: For the 3rd time, I have just deleted and installed MinGW)

> -----Original Message-----
> From: [hidden email]
> Sent: Mon, 10 Nov 2014 15:50:50 +0200
> To: [hidden email]
> Subject: Re: [Mingw-users] error in compiling/linking a C program
>
>> Date: Mon, 10 Nov 2014 04:47:23 -0800
>> From: Ricardo Viegas <[hidden email]>
>> Cc: [hidden email]
>>
>> D:\Programas\C>c:\mingw\libexec\gcc\mingw32\4.8.1\collect2 --help
>> Usage: collect2 [options]
>>  Wrap linker and generate constructor code if needed.
>>  Options:
>>   -debug          Enable debug output
>>   --help          Display this information
>>   -v, --version   Display this program's version number
>>
>> Overview: http://gcc.gnu.org/onlinedocs/gccint/Collect2.html
>> Report bugs: <http://gcc.gnu.org/bugs.html>
>
> That's much less that should have been printed.  Your collect2.exe is
> for some reason unable to invoke ld.exe, the linker.  Perhaps
> re-install Binutils, or maybe install a previous version of them.

____________________________________________________________
FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!
Check it out at http://www.inbox.com/earth



------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
12