PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Setting up a project in VS2005

Hello,

With all the information floating around in various threads on how to set up PocketHAL, Hekkus etc in VS2005 I was wondering if anyone who went through the procedure would be kind enought to post some detailed steps in getting set-up.

Points I would be particularly interested in:

1. Getting PocketHAL projects to compile for WM5 AND OLDER from within VS2005
2. Getting emulators to run when debugging
3. Downloading to device & debugging
4. Converting eVC4 projects etc.

I haven't received a copy of VS2005 yet, so I don't exactly know what's involved but from other threads there seem to be steps that need to be taken to get a good mobile development environment going.

Alex
Hi Alex, If you are getting the release VS2005 then your steps are few and easy. I expect to order the release version this week and load onto a new laptop but that may not arrive for another few days.

I'm using the beta so much of what was required won't be needed. I will post when I get time, probably linking the various posts already made which are relevant.
Thanks Conan!
Perhaps I'm just being paranoid, but if the procedure is less than trivial I'm sure a lot of us would benefit from some instructions.

Alex
I think it's best for me to wait till I have the release version of VS2005 installed & do a nice clean guide.

For now just remember to install everything and ensure you have the No (/Zc:wchar_t-) set in the C++ language settings item treat wchar_t as builtin type for both PF and your own app. Also bear in mind that you have to ensure your display is set prior to any update, don't just set once.
Ok I got some time today to fiddle with VS 2005.
Here are the things I had to do to get the Minimal sample to work.

Trivial Steps:
1. Set the "Additional Include Directories" field to point to the directory where you installed PocketHAL (e.g. C:\PocketHAL)
2. Add the path to the PocketHAL ARM lib under "Additional Dependencies"

If you compile at this point you get some errors as follows:
Code:
------ Build started: Project: Minimal, Configuration: Debug Pocket PC 2003 (ARMV4) ------
Compiling...
minimal.cpp
game.cpp
GameBase.cpp
utility.cpp
Generating Code...
Linking...
minimal.obj : error LNK2019: unresolved external symbol __security_cookie referenced in function WinMain
GameBase.obj : error LNK2001: unresolved external symbol __security_cookie
minimal.obj : error LNK2019: unresolved external symbol __security_check_cookie referenced in function WinMain
GameBase.obj : error LNK2001: unresolved external symbol __security_check_cookie
minimal.obj : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
game.obj : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
GameBase.obj : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
...- 8 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


The __security_cookie issue is discussed on the MSDN forums:
http://forums.microsoft.com/MSDN/ShowPo ... 2&SiteID=1

The solutions are either removing the /GS flag or including the secchk.lib (I went with the latter).

The vftable stumped me for quite a while. This error generally arises if you have exception handling code that uses throw/catch constructs or if you use dynamic casting. The simple solution is to download the Ccrtrtti.lib & include it in the project: http://support.microsoft.com/default.as ... %5D;830482

This is what I have so far. The minimal sample compiles and runs on my WM2003 device.

I don't think any exception handling or dynamic casting occurs in the minimal sample, so there should be a way to get rid of the Ccrtrtti.lib dependency. Perhaps it's somewhere in the PocketHAL lib? Also is it preferable to simply disable buffer overrun checks (/GS flag) for games to gain some performace, or is the gain insignificant?

Any input will be greatly appreciated!
I did not get these errors but I'm only building for Windows Mobile 5. I've started to use exception handling to catch new memory failures and it's all working fine.
Yeah, those errors are for WM2003 only. For WM5 steps 1 & 2 are sufficient.
Doh! Forgot to log in...
madvox · 26 Feb 2006, 21:10 UTC — Did you finish the procedure?
Conan or Alex,

Did you guys finish the procedure?

Despite an apparently flawless conversion of my projects from VC6 to VS2005, rebuilding the code throws quite a few CE_ACTIVEX errors.

Trying to recompile the ARM LIB files (PocketFrog/HAL source) in VS2005 still throws quite a few CE_ACTIVEX errors. I wonder how you guys got around this one...

There must be something obvious in my project configuration that I am missing...

Thanks for the info.
Madvox
I completed the conversion of Space Treker III to VS2005 / WM5 and also converted most of the samples along the way. The config screens are so different that they can be confusing.

Do you want to post the error messages you get so I can see?
(ps: I only have VS2005 at home so can't always respond immediately)
madvox · 28 Feb 2006, 00:49 UTC — Sample error output
Sure! Thanks for looking into this.

This is the only error I am seeing:

_CE_ACTIVEX was not defined because this Windows CE SDK does not have DCOM.
_CE_ACTIVEX could be caused to be defined by defining _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA, but it is recommended that this be done only for single-threaded apps.
_ATL_NO_HOSTING was defined because _CE_ACTIVEX was not defined.
If you check the earliest post here about VS2005 there are a few compiler/linker settings. I think your problem is related to one of them. I will look tonight when I'm home.
I found this post http://blogs.msdn.com/jeffabraham/archive/2005/10/10/479390.aspx which talks about this error & resolution