On Saturday, March 29, 2008, at 06:34AM, "Tuomo Latto" <djv@...> wrote:
>> On Mar 28, 2008, at 9:48 PM, John Brown wrote:
>>> Assuming that libXXX.a is in the directory specified by -L, then write
>>> '-lXXX' instead of 'libXXX.a'. If you want, you can also write
>> Amazing, just amazing :) This is an important enough point, that it
>> might be nice to have an errata or FAQ about it, because I seriously
>> spent all of yesterday searching for how to do this. Thank you very
>> much for your prompt response!
>This is sort of assumed to be known, since it belongs to the category
>of "basic gcc usage" rather than to MinGW specifics or common gotchas.
>It is such a basic piece of information that it really isn't even a FAQ.
>That is, I can't remember anyone asking about it before.
Ya true hmm, I just haven't worked much with configure or passing gcc options directly. Well I have it all working from console, and am now trying to integrate this with Xcode. I have done these steps so far to swap mingw in for gcc, and tell Xcode what flags to pass to it:
sudo mv gcc gccBACKUP
sudo ln -s /usr/local/cross-tools/bin/i386-mingw32-g++ gcc
// go into project settings:
Architectures: i386 (might be $(NATIVE_ARCH) on intel)
Valid Architectures: i386 x86_64
Header Search Paths: /Users/zmorris/Development/Windows/DXSDK/include
Library Search Paths: /usr/local/cross-tools/lib
Other Linker Flags: -mwindows -g -o -lmingw32 -lddraw
So far it allllmost works, but I am getting:
ld: warning in /usr/local/cross-tools/lib/libddraw.a, file is not of required architecture
"_main", referenced from:
start in crt1.10.5.o
"_MessageBox", referenced from:
_WinMain in main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
I am still not absolutely certain that Xcode is using mingw. The -mwindows flag should skip the need for main(), and I believe -lmingw32 should provide MessageBox(). I am still missing something, but this whole process seems to still be evolving, with several forums on the web offering different suggestions.
FYI, I understand this is a potentially painful path I am on, but I want to understand what is happening at a low level. I also have MS Visual C++ Express in parallels and am building a project in parallel on both sides. It's just quicker for me to work in my native environment is all, and then debug in the visual c++ IDE when I need to.