LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-04-2013, 07:15 PM   #1
wombatman
LQ Newbie
 
Registered: Aug 2003
Distribution: Linux Mint 15 / MinGW (Win XP)
Posts: 29

Rep: Reputation: 0
ld.exe error with MinGW-w64 and Windows 7


I'm trying to compile 64-bit versions of various software (GMP-ECM, MSieve, etc) using MinGW-w64 on Windows 7. Everything configures without issue, but when I get to the linking step, ld.exe crashes with an exception code of c0000374. I've no idea where to begin trying to fix this.

Any help is greatly appreciated.

To provide a specific example, I can successfully configure MPIR 2.6.0 with "--enable-cxx --enable-gmpcompat --prefix=/c/mingw64" and run make clean, make, and make install without issue. If I try to run "make check", however, I encounter the ld.exe error when it tries to generate the various exe binaries to run tests on.

Quote:
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I.. -m64 -O2 -march=corei7-avx -mtune=corei7-avx -c t-bswap.c
/bin/sh ../libtool --tag=CC --mode=link gcc -std=gnu99 -m64 -O2 -march=corei7-avx -mtune=corei7-avx -o t-bswap.exe t-bswap.o libtests.la ../libmpir.la
libtool: link: gcc -std=gnu99 -m64 -O2 -march=corei7-avx -mtune=corei7-avx -o t-bswap.exe t-bswap.o ./.libs/libtests.a /c/mpir-2.6.0/.libs/libmpir.a ../.libs/libmpir.a
collect2.exe: error: ld returned 116 exit status
make[4]: *** [t-bswap.exe] Error 1

Last edited by wombatman; 09-05-2013 at 03:24 PM.
 
Old 09-07-2013, 03:53 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,455

Rep: Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601
/c/mpir-2.6.0/.libs/libmpir.a
so you are putting everything on the windows C:\\ drive
and not in the mingw unix tree
( mingw/ msys -- using msys sets up msys as / and mingw as /usr )
i had it installed to - the 32 bit
Code:
c:\\gnuwin32\msys
c:\\gnuwin32\msys\bin
c:\\gnuwin32\Mingw 
c:\\gnuwin32\Mingw\bin
c:\\gnuwin32\Mingw\lib
c:\\gnuwin32\Mingw\include
c:\\gnuwin32\Mingw\share
and used "/c/gnuwin32/Mingw" as the "prefix" for installing all mingw built software
( aliased / to /c/gnuwin32/Mingw )
this kept all the libs in
/c/gnuwin32/Mingw/lib


otherwise you are going to need to ADD EVERY and i do mean EVERY c:/WhateverProgram/bin ,c:/WhateverProgram/include , c:/WhateverProgram/lib, c:/WhateverProgram/share
to the MS windows $PATH
and EVERY c:/WhateverProgram/lib to the MS windows "LD_LIBRARY_PATH"
and set EVERY c:/WhateverProgram/lib/pkgconfig folder to
PKG_CONFIG_PATH in mingw
and that is going to be ONE huge and very LONG list

Last edited by John VV; 09-07-2013 at 04:02 PM.
 
Old 09-09-2013, 11:38 AM   #3
wombatman
LQ Newbie
 
Registered: Aug 2003
Distribution: Linux Mint 15 / MinGW (Win XP)
Posts: 29

Original Poster
Rep: Reputation: 0
I'm using /mingw as my prefix as well to ensure that everything gets installed to the appropriate place. I don't encounter the issue until I'm trying to actually do the linking step--I can run "./configure --prefix=/c/mingw64 --enable-cxx" (and so with other options), I can run "make" (which goes without any error, and I can run "make install" which also completes with any issue. The only time I hit the error is when I run "make check" and the script attempts to make exe files to test out everything. Then, and only then, does the error come up.

Running "which ld" provides:
Code:
/mingw/bin/ld.exe
mingw here does refer to the 64-bit version of MinGW.

I can compile in 32-bit from the exact same MPIR folder location without any issue, so I don't think the directory structure is the issue. Any other suggestions?
 
Old 09-09-2013, 02:12 PM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,455

Rep: Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601
mingw uses a LOT , and i do mean A LOT of predefined text files that have predefined and set $PATH's in them

it is possible that the autotools and m4 are putting in the wrong locations in the "check" section of the makefile

have you read through the makefile ?

i have not used the 32bit AND 64 bit mingw , but i am betting that there is also a /lib64 folder
the check section might not be seeing that .
 
Old 09-09-2013, 02:35 PM   #5
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.2
Posts: 7,809
Blog Entries: 58

Rep: Reputation: Disabled
As far as I can remember, the recommended install path is C:\MinGW and C:\MinGW\msys. GnuWin32 is a different project, but compatible with MinGW and msys.
 
Old 09-09-2013, 06:04 PM   #6
wombatman
LQ Newbie
 
Registered: Aug 2003
Distribution: Linux Mint 15 / MinGW (Win XP)
Posts: 29

Original Poster
Rep: Reputation: 0
There is no /lib64 folder. The standard /lib folder is present with 64-bit files (as checked by file [name]). Same for /bin. One additional piece of information--if I continue to run "make check", I can iterate through the 1st 9 tests that MPIR runs. Seven of them fail, but 2 of them successfully build. They are listed (with pass/fail) below:
Code:
FAIL: t-bswap.exe
FAIL: t-constants.exe
FAIL: t-count_zeros.exe
PASS: t-gmpmax.exe
PASS: t-hightomask.exe
FAIL: t-modlinv.exe
FAIL: t-parity.exe
FAIL: t-popc.exe
FAIL: t-sub.exe
I guess I'll look and see what the two that pass (are successfully built) are not using that the rest do.
 
Old 09-09-2013, 06:39 PM   #7
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,455

Rep: Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601
at this point i am at a loss , it has been sometime since i used mingw / msys and gnuwin32 or cygwin

other than look for an error in the "check" section of the makefile and trace it back the the m4 macro that was used for that part of the makefile

i do know that some programs can mess them up
Cinepaint is one example the build process adds a m4 macro to the system that is in conflict with other things

or

you might need to run "autoreconfig - iv " to remake the configure file
or run the ( if there ) automake.sh or autocong.sh or build.sh

Last edited by John VV; 09-09-2013 at 06:42 PM.
 
Old 09-09-2013, 06:44 PM   #8
wombatman
LQ Newbie
 
Registered: Aug 2003
Distribution: Linux Mint 15 / MinGW (Win XP)
Posts: 29

Original Poster
Rep: Reputation: 0
Ok. Thanks for all the help! If I can get it figured out, I'll certainly post back what I did.
 
Old 09-11-2013, 11:31 AM   #9
wombatman
LQ Newbie
 
Registered: Aug 2003
Distribution: Linux Mint 15 / MinGW (Win XP)
Posts: 29

Original Poster
Rep: Reputation: 0
I got it! At least for MPIR 2.6.0, I have to configure it with "--enable-static" explicitly. So it's some kind of issue with trying to build shared libraries. But static building works fine.
 
  


Reply

Tags
mingw


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Swfdec issues on MinGW (Windows) c0d3d Programming 18 08-18-2012 06:55 PM
MinGW/Msys: how to run PWD from Windows command line? Dims Other *NIX 0 06-29-2011 09:41 AM
Error when building m4 under cygwin with mingw? elinuxqs General 4 07-20-2007 04:16 AM
Link error with mingw-gcc FLLinux Programming 0 07-28-2006 09:38 PM
MingW and Windows Libraries bobwall Programming 0 09-22-2004 04:25 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration