Compiling for a mobile device

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
JRowe47
Posts: 55
Joined: Sat Jun 30, 2007 9:09 am

Compiling for a mobile device

Post by JRowe47 »

I'm getting a Samsung Omnia, and I'd like to use irrlicht on it.

I installed the windows mobile SDK, I have VS 9.

After trying to compile the Irrlicht_mobile6 solution, I get these errors:

Code: Select all

fatal error C1083: Cannot open include file: 'signal.h': No such file or directory
fatal error C1083: Cannot open include file: 'errno.h': No such file or directory
fatal error C1083: Cannot open include file: 'io.h': No such file or directory

Pretty sure there's going to be an easy fix (I'm not including something or w/e.)

When I comment those lines out, I get 8 additional errors. Since this is literally my first attempt at building anything for a mobile device, I'm surprised my PC didn't blow up. Anyway, any help will be greatly appreciated! :)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Looks like some setup was made wrong in the first place. At least two of the includes are not used for the CE system. As I don't know if this was only fixed after the official 1.6 release, you might want to check this out with latest SVN/1.6 branch or SVN/trunk. You might also have to disable the Console device, as I don't know if this compiles with CE.
Also, make sure that you include a little more of the error log next time, makes searching ofr the cause somewhat easier.
JRowe47
Posts: 55
Joined: Sat Jun 30, 2007 9:09 am

Post by JRowe47 »

Code: Select all

Linking...
   Creating library ..\..\lib\WinCE-visualstudio\Irrlicht.lib and object ..\..\lib\WinCE-visualstudio\Irrlicht.exp
CFileSystem.obj : error LNK2019: unresolved external symbol CreateFileA referenced in function "public: virtual bool __cdecl irr::io::CFileSystem::existFile(class irr::core::string<char,class irr::core::irrAllocator<char> > const &)const " (?existFile@CFileSystem@io@irr@@UBA_NABV?$string@DV?$irrAllocator@D@core@irr@@@core@3@@Z)
..\..\bin\WinCE-visualstudio\/Irrlicht.dll : fatal error LNK1120: 1 unresolved externals
Everything compiles til the very end, and I get the error above. From reading, I understand its a linker error, but I'm not entirely sure what that means or how to fix it. The text above is the only text dealing with errors. Should I add more?

Thanks very much!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The error says that CreateFileA does not exist, at least not in the libraries linked into the app. I'm not sure how to properly fix this for CE, maybe you can just remove the 'A' and use the generic function, or you have to convert the string to wchar_t and use the 'W' function.
JRowe47
Posts: 55
Joined: Sat Jun 30, 2007 9:09 am

Post by JRowe47 »

Both CreateFile and CreateFileA are defined to be CreateFileW by the mobile SDK. I need to convert one parameter to a wide char, but I can't wrap my head around how exactly to do this.

Code: Select all

error C2664: 'CreateFileW' : cannot convert parameter 1 from 'const irr::c8 *' to 'LPCWSTR'

Code: Select all

HANDLE hFile = CreateFileW(filename.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);

So, I need to change the c_str method to return a wide character array instead of a 1 byte array as it is doing now (I understand the surface of it, but the actual fix is a little beyond me.)

The c_str method is:

Code: Select all

	const T* c_str() const
	{
		return array;
	}
Can anyone show me how to wrap that up/convert that into a w_char array?[/code]
Brainsaw
Posts: 1176
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Maybe

Code: Select all

  stringw(filename).c_str();
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
JRowe47
Posts: 55
Joined: Sat Jun 30, 2007 9:09 am

Post by JRowe47 »

Code: Select all

CFileSystem.cpp
.\CFileSystem.cpp(715) : error C2440: '<function-style-cast>' : cannot convert from 'const irr::io::path' to 'wchar_t'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
.\CFileSystem.cpp(715) : error C2228: left of '.c_str' must have class/struct/union
Returns that error. The Function call is in CFileSystem.cpp, and the c_str method is in irrString.h.

If anyone could walk me through what needs to be done, I'd greatly appreciate it. :)
JRowe47
Posts: 55
Joined: Sat Jun 30, 2007 9:09 am

Post by JRowe47 »

Code: Select all

HANDLE hFile = CreateFileW(irr::core::stringw(filename).c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
Thanks to hybrid, brainsaw, cuteAlien and katya :)

Now on to testing. :D
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, I've comitted this. If someone knows a less involved way of checking for a file on WinCE, please tell me (why is there no access()?)
zhp0260
Posts: 1
Joined: Thu Dec 10, 2009 9:29 am

Post by zhp0260 »

I meet the same problem when complie it for windows Mobile6.
I forbid the define
'//#define _IRR_COMPILE_WITH_CONSOLE_DEVICE_'

but there are still two error messages.


error 1 fatal error C1083: Cannot open include file: 'errno.h': No such file or directory
error 2 fatal error C1083: Cannot open include file: 'io.h': No such file or directory


the 'io.h' just for _acess function, but I check this function in Window Mobile 6SDK, I can not find it.
hankersyan
Posts: 7
Joined: Sun Dec 13, 2009 1:54 am

Post by hankersyan »

In the SDK directory "\Windows Mobile 6 SDK\PocketPC\Include\" and VC8 ce directory "Microsoft Visual Studio 8\VC\ce\include", i can not find "io.h" and "errno.h".
Does WCE support them?
Post Reply