----- Original Message ----- 
From: "NightStrike" <[EMAIL PROTECTED]>
.
.
>> C:\_64>gcc -o try.exe try.c -v
>> Using built-in specs.
>> Target: x86_64-pc-mingw32
>> Configured with: 
>> ../build/gcc-svn/gcc/configure --target=x86_64-pc-mingw32
>> --pre
>> fix=/var/tmp/w64 --with-sysroot=/var/tmp/w64 --host=x86_64-pc-mingw32
>> Thread model: win32
>> gcc version 4.4.0 20080507 (experimental) (GCC)
>> COLLECT_GCC_OPTIONS='-o' 'try.exe' '-v' '-mtune=generic'
>> cc1 -quiet -v -iprefix
>> c:\_64\../lib/gcc/x86_64-pc-mingw32/4.4.0/ try.c -quiet
>> -dumpbase try.c -mtune=generic -auxbase try -version -o ./ccX0Z06C.s
>> ignoring nonexistent directory
>> "c:\_64\../lib/gcc/x86_64-pc-mingw32/4.4.0/include"
>> ignoring nonexistent directory
>
> This looks wrong.

Agreed.

>
> The zip file that you downloaded should be extracted into some
> directory (say c:\win64).  Then the /bin directory off of that needs
> to be put into your PATH: PATH=C:\win64\bin;%PATH%
>
> Is that what you did?

I unzipped into C:\_64\mingw64 - which is not a top level folder as you have 
recommended.

I don't know if that's significant, but let's give it a try.

Firstly I remove the C:\_64\mingw64 folder entirely.

Then unzip mingw-w64-bin_x86_64-mingw_20080507.zip into C:\mingw64.

===================================
C:\C>path
PATH=c:\ruby\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\batch

C:\C>type hello.c
#include <stdio.h>

int main(void) {
    printf("Hello World\n");
}

C:\C>gcc -o hello.exe hello.c
'gcc' is not recognized as an internal or external command,
operable program or batch file.

C:\C>set PATH=C:\mingw64\bin;%PATH%

C:\C>gcc -v
Using built-in specs.
Target: x86_64-pc-mingw32
Configured with: 
../build/gcc-svn/gcc/configure --target=x86_64-pc-mingw32 --pr
fix=/var/tmp/w64 --with-sysroot=/var/tmp/w64 --host=x86_64-pc-mingw32
Thread model: win32
gcc version 4.4.0 20080507 (experimental) (GCC)

C:\C>gcc -o hello.exe hello.c
gcc: CreateProcess: No such file or directory

===================================

Yep - we're on Windows Vista (oh, joy !!). But I can fix that error:

===================================
C:\C>set PATH=C:\mingw64\libexec\gcc\x86_64-pc-mingw32\4.4.0;%PATH%

C:\C>gcc -o hello.exe hello.c
hello.c:1:19: error: no include path in which to search for stdio.h
hello.c: In function 'main':
hello.c:4: warning: incompatible implicit declaration of built-in function 
'printf'

C:\C>
===================================

I can fix that, too, by setting the CPATH environment variable.
Only problem is there are 2 instances of the standard headers - one instance 
in C:\mingw64\mingw\include, and one in 
C:\mingw64\x86_64-pc-mingw32\include.
Which instance needs to be found ? I'll try putting the latter first:
===================================
C:\C>set CPATH=C:\mingw64\x86_64-pc-mingw32\include;C:\mingw64\include

C:\C>gcc -o hello.exe hello.c
ld: crt2.o: No such file: No such file or directory

C:\C>
===================================

Need to set the LIBRARY_PATH environment variable, too:

===================================
C:\C>set LIBRARY_PATH=C:\mingw64\x86_64-pc-mingw32\lib

C:\C>gcc -o hello.exe hello.c
ld: cannot find -lgcc

C:\C>set 
LIBRARY_PATH=%LIBRARY_PATH%;C:\mingw64\lib\gcc\x86_64-pc-mingw32\4.4.0

C:\C>gcc -o hello.exe hello.c

C:\C>hello
Hello World

C:\C>
===================================

Ok - let's return to try.c:

===================================
C:\C>type try.c
#include <windows.h>

int main(void) {
    return 1;
}

C:\C>
===================================

First attempt at building that produces a mass of errors beginning with:

C:\mingw64\x86_64-pc-mingw32\include/intrin.h:13:23: error: emmintrin.h: No 
such file or directory
C:\mingw64\x86_64-pc-mingw32\include/intrin.h:14:23: error: xmmintrin.h: No 
such file or directory
C:\mingw64\x86_64-pc-mingw32\include/intrin.h:15:22: error: mmintrin.h: No 
such file or directory

So let's add the location of those includes to the CPATH environment 
variable:

===================================
C:\C>set CPATH=%CPATH%;C:\mingw64\lib\gcc\x86_64-pc-mingw32\4.4.0\include

C:\C>gcc -o try.exe try.c -v
Using built-in specs.
Target: x86_64-pc-mingw32
Configured with: 
../build/gcc-svn/gcc/configure --target=x86_64-pc-mingw32 --pre
fix=/var/tmp/w64 --with-sysroot=/var/tmp/w64 --host=x86_64-pc-mingw32
Thread model: win32
gcc version 4.4.0 20080507 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-o' 'try.exe' '-v' '-mtune=generic'
 cc1 -quiet -v -iprefix c:\c\../lib/gcc/x86_64-pc-mingw32/4.4.0/ 
try.c -quiet -d
umpbase try.c -mtune=generic -auxbase try -version -o ./ccQicx1L.s
ignoring nonexistent directory 
"c:\c\../lib/gcc/x86_64-pc-mingw32/4.4.0/include"

ignoring nonexistent directory 
"c:\c\../lib/gcc/x86_64-pc-mingw32/4.4.0/include-
fixed"
ignoring nonexistent directory 
"c:\c\../lib/gcc/x86_64-pc-mingw32/4.4.0/../../..
/../x86_64-pc-mingw32/include"
ignoring nonexistent directory 
"/var/tmp/w64/var/tmp/w64/lib/gcc/x86_64-pc-mingw
32/4.4.0/../../../../include"
ignoring nonexistent directory "c:/lib/gcc/x86_64-pc-mingw32/4.4.0/include"
ignoring nonexistent directory 
"c:/lib/gcc/x86_64-pc-mingw32/4.4.0/include-fixed
"
ignoring nonexistent directory "c:/x86_64-pc-mingw32/include"
ignoring nonexistent directory "/var/tmp/w64/mingw/include64"
#include "..." search starts here:
#include <...> search starts here:
 C:\mingw64\x86_64-pc-mingw32\include
 C:\mingw64\include
 C:\mingw64\lib\gcc\x86_64-pc-mingw32\4.4.0\include
End of search list.
GNU C (GCC) version 4.4.0 20080507 (experimental) (x86_64-pc-mingw32)
        compiled by GNU C version 4.4.0 20080507 (experimental), GMP version 
4.2
.2, MPFR version 2.3.1.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 0f40953745fdef6c54a0febc9b9d5e92
COLLECT_GCC_OPTIONS='-o' 'try.exe' '-v' '-mtune=generic'
 as -o ./ccY4h6Um.o ./ccQicx1L.s
COMPILER_PATH=
LIBRARY_PATH=C:/mingw64/x86_64-pc-mingw32/lib/;C:/mingw64/lib/gcc/x86_64-pc-ming
w32/4.4.0/
COLLECT_GCC_OPTIONS='-o' 'try.exe' '-v' '-mtune=generic'
 ld --sysroot=/var/tmp/w64 -Bdynamic -o try.exe 
C:/mingw64/x86_64-pc-mingw32/lib
/crt2.o 
C:/mingw64/x86_64-pc-mingw32/lib/crtbegin.o -LC:/mingw64/x86_64-pc-mingw
32/lib -LC:/mingw64/lib/gcc/x86_64-pc-mingw32/4.4.0 
./ccY4h6Um.o -lmingw32 -lgcc
 -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw3
2 -lgcc -lmoldname -lmingwex -lmsvcrt 
C:/mingw64/x86_64-pc-mingw32/lib/crtend.o
===================================

That seems to have compiled ok. I guess those "ignoring nonexistent 
directory" messages might arise from having set the CPATH and LIBRARY_PATH 
variables.

We'll just rewrite try.c so that it produces some output:

===================================
C:\C>type try.c
#include <stdio.h>
#include <windows.h>

int main(void) {
    printf("At last !!\n");
}

C:\C>gcc -o try.exe try.c

C:\C>try
At last !!

C:\C>
===================================

Beautiful !!

As to what the problem *was* is now a little unclear to me. Perhaps it was 
because I originally unzipped into C:\_64\mingw64 instead of a top level 
folder. Or perhaps it was something to do with the way I had jumped through 
all those hoops.
In the process of the re-installation, I've rewritten the batch file that 
sets up the environment - so I can't even go back and take a look at how it 
was. (Well, not easily, anyway.)

Is the order in which the various (CPATH and LIBRARY_PATH) locations are 
listed going to be of importance ?

One way or another, progress has been made. Thanks for the assistance.

Cheers,
Rob


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to