I found the problem. It is indeed an SFML CMake script that assumes that
libraries are at <mingw>\lib and has this hard-coded at one point when
building static libraries (it calls `ar x <lib>` to open all the static
libraries and then repackages them as a single static library).
Can you explain further which libs would be in `i686-w64-mingw32\lib` and
which in `lib`, so I can try to fix this? And is the name
`i686-w64-mingw32` fixed for all versions of mingw-w64, or is it only for
32-bit builds, or only for 32-bit-generating builds, and if so what would
it be called in other builds?
On Tue, May 1, 2012 at 4:55 PM, Baruch Burstein <[email protected]>wrote:
> I downloaded the latest SFML source from github (
> https://github.com/LaurentGomila/SFML) and built the makefile with CMake
> and default options. I just tried a small example like you suggested and it
> indeed found no problem. I guess the problem s somewhere in the cmake/sfml
> combo.
> Do you have any experience with CMake so that you may suggest where the
> problem may be? I know nothing about CMake.
>
> Thank you.
>
>
> On Tue, May 1, 2012 at 4:41 PM, Ruben Van Boxem
> <[email protected]>wrote:
>
>> 2012/5/1 Baruch Burstein <[email protected]>
>>
>>> I just downloaded ruben's build of gcc 4.7.0 for 32-bit, but I think
>>> this question applies to other (all?) other builds, too.
>>>
>>> I tried compiling a program that links to opengl32, but got a linker
>>> error that the file wasn't found. In the "old" mingw32, libopengl32.a was
>>> in the lib folder. In this build it isn't. After searching for it I found
>>> it in 'i686-w64-mingw32\lib', along with what looks like many other
>>> important lib files. in 'i686-w64-mingw32' there is also an 'include' dir
>>> and a 'bin' dir with a few of the tools that are also in the main 'bin' dir
>>> such as 'ar', 'as', 'dlltool', 'strip' and a few others.
>>>
>>> What is this 'i686-w64-mingw32' folder, and why are some things
>>> separated/duplicated into it? Can I just merge it into the main
>>> lib/include/bin dirs, so that I can compile with the standard makefiles,
>>> without having to always adjust to add another include and lib folder?
>>>
>>
>> Hi Baruch,
>>
>> The directory structure is determined by binutils and gcc. An explanation:
>> - the i686-w64-mingw32/bin/* tools are part of binutils and placed there
>> for internal use of gcc. Do not use or touch these.
>> - the rest of i686-w64-mingw32 subfolder is a strict difference between
>> MinGW.org and MinGW-w64 toolchains. In both cases, GCC is configured to
>> search these directories automatically, and you should not have to add any
>> library paths manually whatsoever.
>>
>> To better see what I mean, below the output of "gcc -v test.c -lopengl32
>> -o test.exe" for my 4.7.0 (64-bit) build. Note that all the directories
>> containing headers and libraries are searched as appropriate (marked in
>> bold).
>>
>>
>> COLLECT_GCC=gcc
>>
>> COLLECT_LTO_WRAPPER=m:/development/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.7.0/lto-wrapper.exe
>> Target: x86_64-w64-mingw32
>> Configured with: /home/ruben/mingw-w64/toolchain/src/gcc/configure
>> --host=x86_64-w64-mingw32 --build=x86_64-linux-gnu
>> --target=x86_64-w64-mingw32
>> --with-sysroot=/home/ruben/mingw-w64/toolchain/mingw64mingw64/mingw64
>> --prefix=/home/ruben/mingw-w64/toolchain/mingw64mingw64/mingw64
>> --with-libiconv-prefix=/home/ruben/mingw-w64/toolchain/mingw64mingw64/prereq_install
>> --with-gmp=/home/ruben/mingw-w64/toolchain/mingw64mingw64/prereq_install
>> --with-mpfr=/home/ruben/mingw-w64/toolchain/mingw64mingw64/prereq_install
>> --with-mpc=/home/ruben/mingw-w64/toolchain/mingw64mingw64/prereq_install
>> --with-ppl=/home/ruben/mingw-w64/toolchain/mingw64mingw64/prereq_install
>> --with-cloog=/home/ruben/mingw-w64/toolchain/mingw64mingw64/prereq_install
>> --enable-cloog-backend=isl --with-host-libstdcxx='-static -lstdc++
>> -lm' --enable-shared --enable-static --enable-threads=win32
>> --disable-multilib --enable-plugins
>> --enable-languages=c,lto,c++,objc,obj-c++,fortran,java --enable-libgomp
>> --enable-libstdcxx-debug --enable-sjlj-exceptions
>> --enable-fully-dynamic-string --disable-nls --disable-werror
>> --enable-checking=release --with-pkgversion=rubenvb-4.7.0 --with-bug-url=
>> [email protected] --disable-win32-registry
>> --disable-rpath --disable-werror CFLAGS='-O2 -mtune=corei7
>> -fomit-frame-pointer -momit-leaf-frame-pointer -fgraphite-identity
>> -floop-interchange -floop-block -floop-parallelize-all' LDFLAGS=
>> Thread model: win32
>> gcc version 4.7.0 (rubenvb-4.7.0)
>> COLLECT_GCC_OPTIONS='-v' '-o' 'test.exe' '-mtune=generic' '-march=x86-64'
>> m:/development/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.7.0/cc1.exe
>> -quiet -v -iprefix
>> m:\development\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/ -isysroot
>> m:\development\mingw64\bin\../../mingw64 -U_REENTRANT test.c -quiet
>> -dumpbase test.c -mtune=generic -march=x86-64 -auxbase test -version -o
>> R:\cc8IVxCr.s
>> GNU C (rubenvb-4.7.0) version 4.7.0 (x86_64-w64-mingw32)
>> compiled by GNU C version 4.7.0, GMP version 5.0.4, MPFR version
>> 3.1.0, MPC version 0.9
>> GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
>> ignoring duplicate directory
>> "m:/development/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/4.7.0/include"
>> ignoring nonexistent directory
>> "m:\development\mingw64\bin\../../mingw64/home/ruben/mingw-w64/toolchain/mingw64mingw64/mingw64/lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../include"
>> ignoring duplicate directory
>> "m:/development/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/4.7.0/include-fixed"
>> ignoring duplicate directory
>> "m:/development/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/include"
>> ignoring nonexistent directory
>> "m:\development\mingw64\bin\../../mingw64/mingw/include"
>> #include "..." search starts here:
>> *#include <...> search starts here:
>> m:\development\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/include
>>
>> m:\development\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/include-fixed
>>
>>
>> m:\development\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/include
>> *
>> End of search list.
>> GNU C (rubenvb-4.7.0) version 4.7.0 (x86_64-w64-mingw32)
>> compiled by GNU C version 4.7.0, GMP version 5.0.4, MPFR version
>> 3.1.0, MPC version 0.9
>> GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
>> Compiler executable checksum: 234639675d8fe06d0df04426513490c4
>> COLLECT_GCC_OPTIONS='-v' '-o' 'test.exe' '-mtune=generic' '-march=x86-64'
>>
>> m:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/as.exe
>> -o R:\ccW8aWgR.o R:\cc8IVxCr.s
>>
>> COMPILER_PATH=m:/development/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.7.0/;m:/development/mingw64/bin/../libexec/gcc/;m:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/
>> *LIBRARY_PATH=*
>> m:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/;m:/development/mingw64/bin/../lib/gcc/;
>> *
>> m:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/lib/../lib/
>> *
>> ;m:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../lib/;m:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/lib/;m:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../
>> COLLECT_GCC_OPTIONS='-v' '-o' 'test.exe' '-mtune=generic' '-march=x86-64'
>>
>> m:/development/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.7.0/collect2.exe
>> --sysroot=m:\development\mingw64\bin\../../mingw64 -m i386pep -Bdynamic -o
>> test.exe
>> m:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o
>> m:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/lib/../lib/crtbegin.o
>> -Lm:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0
>> -Lm:/development/mingw64/bin/../lib/gcc *
>> -Lm:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/lib/../lib
>> *-Lm:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../lib
>> -Lm:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/lib
>> -Lm:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../..
>> R:\ccW8aWgR.o *-lopengl32* -lmingw32 -lgcc_eh -lgcc -lmoldname -lmingwex
>> -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_eh
>> -lgcc -lmoldname -lmingwex -lmsvcrt
>> m:/development/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/lib/../lib/crtend.o
>>
>>
>> Note the "M:\Development\..." part is specific to the location where you
>> unzipped the package, and all paths were constructed relative to this path.
>>
>> Do you have a small test file and the exact command you used that caused
>> the error, along with the complete error message?
>>
>> Thanks,
>>
>> Ruben
>>
>>
>>>
>>> --
>>> Programming today is a race between software engineers striving to build
>>> bigger and better idiot-proof programs, and the Universe trying to produce
>>> bigger and better idiots. So far, the Universe is winning. - Rich Cook
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Live Security Virtual Conference
>>> Exclusive live event will cover all the ways today's security and
>>> threat landscape has changed and how IT managers can respond. Discussions
>>> will include endpoint security, mobile security and the latest in malware
>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>> _______________________________________________
>>> Mingw-w64-public mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Mingw-w64-public mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>>
>>
>
>
> --
> Programming today is a race between software engineers striving to build
> bigger and better idiot-proof programs, and the Universe trying to produce
> bigger and better idiots. So far, the Universe is winning. - Rich Cook
>
>
--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. - Rich Cook
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public