Cross-Compiling

What do you want to see in Armagetron soon? Any new feature ideas? Let's ponder these ground breaking ideas...
User avatar
Infa(mous)
Round Winner
Posts: 255
Joined: Thu Aug 14, 2008 11:27 pm

Cross-Compiling

Post by Infa(mous) »

I've been working on cross-compiling with mingw32...
I got well into it, and the configure was going smoothly until it said I need library xml2. Which I already have. Any ideas as to what may have gone wrong?
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6711
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

I believe it checks that by whether or not you have libxml2 by running a test binary. Have you installed/compiled a libxml2 in mingw32 environment?
Image
User avatar
Infa(mous)
Round Winner
Posts: 255
Joined: Thu Aug 14, 2008 11:27 pm

Post by Infa(mous) »

No...
What I *have* done is gotten libSDL and libxml2, and configured them both... just haven't compiled them.
The commands I used were:
For libSDL - ./configure --host=i586-mingw32msvc --prefix=/usr/i586-mingw32msvc
And for libxml2 - ./configure --host=i586-mingw32msvc --prefix=/usr/i586-mingw32msvc --with-python=no
With those, should i finish compiling libSDL and libxml2? :lol:
User avatar
Infa(mous)
Round Winner
Posts: 255
Joined: Thu Aug 14, 2008 11:27 pm

Post by Infa(mous) »

Actually... it seems to be working... it'll prolly take a LONG time to compile on my 2.4ghz single-core machine though. :roll:
EDIT: Scratch That. I seem to be getting some errors.
engine/ePath.cpp:37: error: ‘tHeap<eHalfEdge> open’ redeclared as different kind of symbol
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/include/io.h:295: error: previous declaration of ‘int open(const char*, int, ...)’
engine/ePath.cpp: In static member function ‘static void eHalfEdge::ClearPathData()’:
engine/ePath.cpp:113: error: request for member ‘Len’ in ‘open’, which is of non-class type ‘int ()(const char*, int, ...)’
engine/ePath.cpp:115: error: request for member ‘Remove’ in ‘open’, which is of non-class type ‘int ()(const char*, int, ...)’
engine/ePath.cpp: In static member function ‘static void eHalfEdge::FindPath(const eCoord&, const eFace*, const eCoord&, const eFace*, const eGameObject*, ePath&)’:
engine/ePath.cpp:167: error: no matching function for call to ‘eHalfEdge::SetMinPathLength(REAL, int (&)(const char*, int, ...), ePATH_ORIGIN)’
engine/ePath.cpp:140: note: candidates are: void eHalfEdge::SetMinPathLength(REAL, tHeapBase&, ePATH_ORIGIN)
engine/ePath.cpp:176: error: request for member ‘Len’ in ‘open’, which is of non-class type ‘int ()(const char*, int, ...)’
engine/ePath.cpp:182: error: request for member ‘Remove’ in ‘open’, which is of non-class type ‘int ()(const char*, int, ...)’
engine/ePath.cpp: In member function ‘void eHalfEdge::PossiblePath(ePATH_ORIGIN, REAL)’:
engine/ePath.cpp:323: error: no matching function for call to ‘eHalfEdge::SetMinPathLength(REAL&, int (&)(const char*, int, ...), ePATH_ORIGIN&)’
engine/ePath.cpp:140: note: candidates are: void eHalfEdge::SetMinPathLength(REAL, tHeapBase&, ePATH_ORIGIN)
engine/ePath.cpp:333: error: no matching function for call to ‘eHalfEdge::SetMinPathLength(REAL&, int (&)(const char*, int, ...), ePATH_ORIGIN&)’
engine/ePath.cpp:140: note: candidates are: void eHalfEdge::SetMinPathLength(REAL, tHeapBase&, ePATH_ORIGIN)
engine/ePath.cpp: In member function ‘virtual tHeapBase* eHalfEdge::Heap() const’:
engine/ePath.cpp:351: error: cannot convert ‘int (*)(const char*, int, ...)’ to ‘tHeapBase*’ in return
make[3]: *** [libengine_a-ePath.o] Error 1
make[3]: Leaving directory `/home/tron/0.2.8/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/tron/0.2.8/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/tron/0.2.8'
make: *** [all] Error 2
pavelo
Average Program
Posts: 70
Joined: Sun Apr 23, 2006 4:05 pm

Post by pavelo »

F! Infamous wrote:No...
What I *have* done is gotten libSDL and libxml2, and configured them both... just haven't compiled them.
The commands I used were:
For libSDL - ./configure --host=i586-mingw32msvc --prefix=/usr/i586-mingw32msvc
And for libxml2 - ./configure --host=i586-mingw32msvc --prefix=/usr/i586-mingw32msvc --with-python=no
With those, should i finish compiling libSDL and libxml2? :lol:
I'm not sure about the switches but you definitely need to compile the libraries, just configuring them is not enough.

the error you're getting is caused by you having two identifiers with the same name: the libc function open() and the heap object thingy
there are a couple of ways to solve that:
1) change all occurrences of open that refer to the object to something else -- probably The right thing to do (tm)
2) try to prevent io.h from getting included -- the error doesn't appear on linux, so i guess that file doesn't use any of the C io functions
3) place #define open open_foo just above the open object declaration -- hackish, but chances are it will work
4) something else i haven't thought of...
User avatar
Infa(mous)
Round Winner
Posts: 255
Joined: Thu Aug 14, 2008 11:27 pm

Post by Infa(mous) »

k. I fixed that. New Errors!

tron/gGame.cpp: In member function ‘ePlayerNetID* gHighscoresBase::online(int)’:
tron/gGame.cpp:634: error: ‘class ePlayerNetID’ has no member named ‘GetUserNameA’
tron/gGame.cpp: In member function ‘virtual void gHighscoresBase::greet_this(ePlayerNetID*, tOutput&)’:
tron/gGame.cpp:749: error: ‘class ePlayerNetID’ has no member named ‘GetUserNameA’
tron/gGame.cpp: In member function ‘void highscores<T>::Add(ePlayerNetID*, T)’:
tron/gGame.cpp:913: error: ‘class ePlayerNetID’ has no member named ‘GetUserNameA’
tron/gGame.cpp: In member function ‘void highscores<T>::Check(const ePlayerNetID*, T)’:
tron/gGame.cpp:935: error: ‘const class ePlayerNetID’ has no member named ‘GetUserNameA’
tron/gGame.cpp: In member function ‘void ladder::winner(eTeam*)’:
tron/gGame.cpp:1113: error: ‘class ePlayerNetID’ has no member named ‘GetUserNameA’
tron/gGame.cpp:1149: error: ‘class ePlayerNetID’ has no member named ‘GetUserNameA’
tron/gGame.cpp:1153: error: ‘class ePlayerNetID’ has no member named ‘GetUserNameA’
User avatar
Z-Man
God & Project Admin
Posts: 11587
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Post by Z-Man »

That's because one of the braindead windows headers has a
#define GetUserName GetUserNameA
in it. Solution: always include "windows.h".
User avatar
Infa(mous)
Round Winner
Posts: 255
Joined: Thu Aug 14, 2008 11:27 pm

Post by Infa(mous) »

what windows.h? (sorry for the noobish question) Is there supposed to be one included with the source, or use the one from (i think) mingW32?
/me is confuzzled about this one...
Last edited by Infa(mous) on Thu Dec 25, 2008 5:00 am, edited 1 time in total.
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

You did check the wiki for notes on cross-compiling, right? I've been down this route before...
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
Infa(mous)
Round Winner
Posts: 255
Joined: Thu Aug 14, 2008 11:27 pm

Post by Infa(mous) »

I got my start on the cross-compile from the page on the wiki for cross-compilation... so... :D
/me wishes Lucifer had answered his question... oh well... :cry:
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

Heh, just checking basics. I thought that page said something about where to get the windows headers and libraries.

It's in the mingw distribution, but you have to look over what's there. If you're in a debian distribution, you can apt-get a cross-compiler.

Mingw is distributed kinda funky, it's a bunch of small packages taht aren't really released in one big package anymore.
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
Infa(mous)
Round Winner
Posts: 255
Joined: Thu Aug 14, 2008 11:27 pm

Post by Infa(mous) »

I don't think you have a full grasp on my situation.
I have mingw32 set up and working fully. I have libxml2 and libSDL compiled with mingw32. and I have the code compiling most of the way through. and I just found the windows header, and included it, but it didn't fix the error I'm getting.
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

F! Infamous wrote:I don't think you have a full grasp on my situation.
Then you can figure out by yourself. Sorry I tried to help, have a good day.
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
Infa(mous)
Round Winner
Posts: 255
Joined: Thu Aug 14, 2008 11:27 pm

Post by Infa(mous) »

Just saying what I thought you should know :o
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

No, you asked where windows.h was, and I tried to answer your question. Then you bitched at me because you'd already found windows.h on your own.

So, I figure I've got better things to do tonight.
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
Post Reply