I've downloaded the CodeSourcery stuff (the free stuff if that makes a difference) and tried compiling Ares. There is only one compile error (now) and that is on the select command which works on my other Linux G++ compilers.
Here is the error:
compmov.cpp:170:63: error: 'select' was not declared in this scope.
At the top of compmov.cpp, I have these:
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <iostream>
#include <time.h>
#include "headers.h"
So, what is different about this compiler than G++ for Linux x86 64 bit that makes it not work?
Compiling C++ for Android: select command
Moderators: hgm, Rebel, chrisw
-
- Posts: 2056
- Joined: Mon Mar 13, 2006 2:31 am
- Location: North Carolina, USA
-
- Posts: 859
- Joined: Mon Aug 10, 2009 10:05 pm
- Location: Italy
- Full name: Stefano Gemma
Re: Compiling C++ for Android: select command
I suggest to find in witch of the headers is included "select" in G++ and then search for the correspondent one in android compiler.
Can you post the line of code where "select" is used?
Can you post the line of code where "select" is used?
-
- Posts: 2056
- Joined: Mon Mar 13, 2006 2:31 am
- Location: North Carolina, USA
Re: Compiling C++ for Android: select command
The online GNU manuals claim it is in <sys/types.h>. In their manual, they have a sample program. I cut/pasted it in a file and get the same error.stegemma wrote:I suggest to find in witch of the headers is included "select" in G++ and then search for the correspondent one in android compiler.
Can you post the line of code where "select" is used?
The example is on this page:
http://www.gnu.org/savannah-checkouts/g ... or-I_002fO
My code is:
select(32, &readfds, (fd_set *) 0,(fd_set *) 0, &timeout);
-
- Posts: 4052
- Joined: Thu May 15, 2008 9:57 pm
- Location: Berlin, Germany
- Full name: Sven Schüle
-
- Posts: 2056
- Joined: Mon Mar 13, 2006 2:31 am
- Location: North Carolina, USA
Re: Compiling C++ for Android: select command
#include <sys/select.h>
The compiler says no such file or directory.
-
- Posts: 4052
- Joined: Thu May 15, 2008 9:57 pm
- Location: Berlin, Germany
- Full name: Sven Schüle
Re: Compiling C++ for Android: select command
Hmm. Maybe you try something like "man -M <directory of Sourcery G++ man pages> select"?CRoberson wrote:#include <sys/select.h>
The compiler says no such file or directory.
Or could there be some offending code included in your "headers.h" that confuses the compiler?
Sven
-
- Posts: 2056
- Joined: Mon Mar 13, 2006 2:31 am
- Location: North Carolina, USA
Re: Compiling C++ for Android: select command
I also tried the example on the page you referenced. It fails the same way.Sven Schüle wrote:Hmm. Maybe you try something like "man -M <directory of Sourcery G++ man pages> select"?CRoberson wrote:#include <sys/select.h>
The compiler says no such file or directory.
Or could there be some offending code included in your "headers.h" that confuses the compiler?
Sven
-
- Posts: 4052
- Joined: Thu May 15, 2008 9:57 pm
- Location: Berlin, Germany
- Full name: Sven Schüle
Re: Compiling C++ for Android: select command
I am not sure whether this thread covers a somewhat related topic. But at least it shows that there are some "standard" things not implemented in that toolchain.CRoberson wrote:I also tried the example on the page you referenced. It fails the same way.Sven Schüle wrote:Hmm. Maybe you try something like "man -M <directory of Sourcery G++ man pages> select"?CRoberson wrote:#include <sys/select.h>
The compiler says no such file or directory.
Or could there be some offending code included in your "headers.h" that confuses the compiler?
Sven
Sven
-
- Posts: 838
- Joined: Thu Jul 05, 2007 5:03 pm
- Location: British Columbia, Canada
Re: Compiling C++ for Android: select command
My guess is that "select" is a socket function, and I guess Ares is trying to use it to detect if there is input available to be read.
But the uCLinux platform that compiler is for has been stripped down, and perhaps it does not include that function.
[Edit: the things removed from uCLinux are mostly things that can't be implemented without an MMU. Such as fork(). Sockets could probably be supported, but I don't know if it does.]
But the uCLinux platform that compiler is for has been stripped down, and perhaps it does not include that function.
[Edit: the things removed from uCLinux are mostly things that can't be implemented without an MMU. Such as fork(). Sockets could probably be supported, but I don't know if it does.]
-
- Posts: 2056
- Joined: Mon Mar 13, 2006 2:31 am
- Location: North Carolina, USA
Re: Compiling C++ for Android: select command
It is testing for input on stdin.wgarvin wrote:My guess is that "select" is a socket function, and I guess Ares is trying to use it to detect if there is input available to be read.
But the uCLinux platform that compiler is for has been stripped down, and perhaps it does not include that function.
[Edit: the things removed from uCLinux are mostly things that can't be implemented without an MMU. Such as fork(). Sockets could probably be supported, but I don't know if it does.]
If this can't be accomplished then that explains all the missing functionality in Android based Chess programs compared to the PC Chess programs.