Help A Windows Os User


Rockthesmurf

Advanced Member
Joined
Jul 18, 2003
Messages
1,114
Age
38
Location
Manchester, UK
Website
Visit site
Hi there,

So, I asked a while ago if there was a way to build for Pandora target from Windows, and the answer was check out CodeSourcery and take it from there. Well I have been doing just that, and have run into some problems, I hoped someone here might be able to help out. I'm hoping by the end of this I'll be able to post full instructions for others to get up and running on Windows.

My first step has been to download CodeSourcery, the version I have grabbed is:

arm-2010q1-188-arm-none-linux-gnueabi.exe

I have installed that into it's default location (for a 64 bit OS):

Code:
C:\Program Files (x86)\CodeSourcery\Sourcery G++ Lite

I have then tried to compile one of my projects with the tools (gcc for .c files, g++ for .cpp files, ar for archiving objects to a library, ranlib for optimising the library):

Code:
C:\Program Files (x86)\CodeSourcery\Sourcery G++ Lite\bin\arm-none-eabi-ar.exe
C:\Program Files (x86)\CodeSourcery\Sourcery G++ Lite\bin\arm-none-eabi-g++.exe
C:\Program Files (x86)\CodeSourcery\Sourcery G++ Lite\bin\arm-none-eabi-gcc.exe
C:\Program Files (x86)\CodeSourcery\Sourcery G++ Lite\bin\arm-none-eabi-ranlib.exe

I have not set up any system include paths, I am just using the ones the compiler knows about by default, initially I have got this bunch of compiler flags, which may well be wrong, they are just taken from flags I use to build on Android (same project):

Code:
-march=armv5te 
-mtune=xscale 
-msoft-float 
-fpic 
-mthumb-interwork 
-ffunction-sections 
-funwind-tables 
-fstack-protector 
-fno-short-enums 
-mthumb 
-fomit-frame-pointer 
-fno-strict-aliasing 
-finline-limit=64 
-fsigned-char 
-Os
-Wno-deprecated
-Wno-psabi

And this added for C++ files (I don't use exceptions/rtti - and they aren't supported on Android NDK either):

Code:
-fno-exceptions
-fno-rtti

I am passing these defines in (again, taken from Android - except the _PANDORA define, which I use in my engine to know what the target platform is):

Code:
__ARM_ARCH_5__ 
__ARM_ARCH_5T__ 
__ARM_ARCH_5E__ 
__ARM_ARCH_5TE__ 
__NEW__ 
__SGI_STL_INTERNAL_PAIR_H 
_PANDORA
TCHAR=char

And for the main game code, it appears to compile successfully - which is somewhat good news. But when I try to compile engine projects, I do not get so far. For example, one of my projects: 'StdioFileSystem' has a file: 'StdioFileSystem.cpp' that contains an implementation of my engines file system, using the stdio routines. It has two other include dependencies:

Code:
#include <dirent.h>
#include <utime.h>

CodeSourcery does come with these two files, but they don't contain anything useful. For example, utime.h just #includes <sys/utime.h> and sys/utime.h contains:

Code:
#ifndef _SYS_UTIME_H
#define _SYS_UTIME_H

/* This is a dummy <sys/utime.h> file, not customized for any
   particular system.  If there is a utime.h in libc/sys/SYSDIR/sys,
   it will override this one.  */

#ifdef __cplusplus
extern "C" {
#endif

struct utimbuf 
{
  time_t actime;
  time_t modtime; 
};

#ifdef __cplusplus
};
#endif

#endif /* _SYS_UTIME_H */

It is a similar story for dirent.h. I asked on IRC if anyone could point me in the right direction to resolve this, and aTc suggested I grab this linux toolchain:

20100611-i686-linux-armv7a-linux-gnueabi-toolchain-openpandora.tar.bz2

As that should contain the header/libs I need, including things like GLES. So I have grabbed that, and extracted it somewhere. I have taken a look at what's inside, and there are versions of dirent.h and utime.h that actually contain the prototypes etc. I require, so that's good, but I don't know what I am meant to do to get this to play nice with CodeSourcery. I tried setting up the following include paths (in order, where $(i686-linux-armv7a-linux-gnueabi-toolchain_root) resolves to where I extracted the above to):

Code:
INC_DIR_1	= "$(i686-linux-armv7a-linux-gnueabi-toolchain_root)/usr/local/angstrom/arm/include" ;
INC_DIR_2	= "$(i686-linux-armv7a-linux-gnueabi-toolchain_root)/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include" ;
INC_DIR_3	= "$(i686-linux-armv7a-linux-gnueabi-toolchain_root)/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/linux" ;
INC_DIR_4	= "$(i686-linux-armv7a-linux-gnueabi-toolchain_root)/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/include/c++/4.3.3" ;
INC_DIR_5	= "$(i686-linux-armv7a-linux-gnueabi-toolchain_root)/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/include/c++/4.3.3/arm-angstrom-linux-gnueabi" ;
INC_DIR_6	= "$(i686-linux-armv7a-linux-gnueabi-toolchain_root)/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/include/c++/4.3.3/backward" ;
INC_DIR_7	= "$(i686-linux-armv7a-linux-gnueabi-toolchain_root)/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/include/c++/4.3.3/tr1" ;

And I also told the compiler not to use any of it's default include paths (as they just get used first) via:

Code:
-nostdinc

And when I compile I now get a whole load of errors, a bunch from the top:

Code:
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:50: warning: 'malloc' initialized and declared 'extern'
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:50: error: 'size_t' was not declared in this scope
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:50: error: expected ',' or ';' before 'throw'
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:53: warning: 'calloc' initialized and declared 'extern'
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:53: error: 'size_t' was not declared in this scope
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:53: error: 'size_t' was not declared in this scope
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:53: error: initializer expression list treated as compound expression
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:53: error: expected ',' or ';' before 'throw'
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:61: error: 'size_t' has not been declared
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:71: warning: 'memalign' initialized and declared 'extern'
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:71: error: 'size_t' was not declared in this scope
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:71: error: 'size_t' was not declared in this scope
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:71: error: initializer expression list treated as compound expression
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:71: error: expected ',' or ';' before 'throw'
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:75: warning: 'valloc' initialized and declared 'extern'
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:75: error: 'size_t' was not declared in this scope
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:75: error: expected ',' or ';' before 'throw'
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:80: warning: 'pvalloc' initialized and declared 'extern'
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:80: error: 'size_t' was not declared in this scope
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:80: error: expected ',' or ';' before 'throw'
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:85: warning: '__morecore' initialized and declared 'extern'
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:85: error: 'ptrdiff_t' was not declared in this scope
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:88: warning: '__default_morecore' initialized and declared 'extern'
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:88: error: 'ptrdiff_t' was not declared in this scope
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:88: error: expected ',' or ';' before 'throw'
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:136: warning: 'malloc_trim' initialized and declared 'extern'
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:136: error: 'size_t' was not declared in this scope
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:136: error: expected ',' or ';' before 'throw'
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:140: error: 'size_t' does not name a type
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:159: warning: '__malloc_hook' initialized and declared 'extern'
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:159: error: 'size_t' was not declared in this scope
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:159: error: expected primary-expression before 'const'
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:159: error: initializer expression list treated as compound expression
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:161: error: 'size_t' has not been declared
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:163: warning: '__memalign_hook' initialized and declared 'extern'
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:163: error: 'size_t' was not declared in this scope
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:163: error: 'size_t' was not declared in this scope
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:163: error: expected primary-expression before 'const'
1>usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/malloc.h:163: error: initializer expression list treated as compound expression
1>In file included from usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/include/c++/4.3.3/bits/stl_algobase.h:66,
1>                 from usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/include/c++/4.3.3/bits/stl_tree.h:67,
1>                 from usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/include/c++/4.3.3/map:65,
1>                 from C:/Projects/Kami/Code/PiEngine/Base/Pi.h:39,
1>                 from C:/Projects/Kami/Code/PiEngine/Base/PiEngine.h:15,
1>                 from C:/Projects/Kami/Code/PiEngine/SharedEngine/StdioFileSystem.cpp:1,
1>                 from C:/Projects/Kami/Build/KamiChallenge/pandora-debug/PiRoot/PiEngine/SharedEngine/!StdioFileSystemAll!.cpp:2:

The rest can be seen here: pastebin.

Does anyone have any ideas where I should go from here? It doesn't feel like I am a million miles away from getting this working, but I don't really know what to do next. I am probably using incorrect c/c++ flags, and incorrect defines, so hopefully someone can put me right on that front. It's the whole include path situation that leaves me confused about. I am guessing CodeSourcery provide a basic set of headers/libs to do as much as possible for the target platform, but then there will be a bunch of things functionality wise that have to be implemented by the final target, which it provides stubs for, but expects to be filled in (by something?) so by time one comes to compile you see the proper versions of those headers/libs. Does that sound right? I'm not very familiar with how toolchains get put together and all that sort of business. As I say, if I just use CodeSourcery, with no fancy include paths, I can actually compile massive amounts of my projects code, but things that require dirent/utime/gl/al currently are a no go.

If you are still reading now, I very much appreciate you taking the time to read through all of the above (even if you just skimmed through), and very much welcome any help/advice anyone can give to get me up and running.

Steve
 

Rockthesmurf

Advanced Member
Joined
Jul 18, 2003
Messages
1,114
Age
38
Location
Manchester, UK
Website
Visit site
I might have made a mistake, I think I have installed:

arm-2010q1-188-arm-none-eabi.exe

Instead of:

arm-2010q1-202-arm-none-linux-gnueabi.exe

Which might explain the lack of stuff like dirent/utime as that is probably coming from the Linux layer. I'm just downloading (hopefully the right) one now, and will report my results...

Steve
 
Top