How to build PROJ.4 for Windows CE

Recently, I’ve been asked for some help in building PROJ.4 library for Windows CE systems, like Windows Mobile 5.0 for Pocket PC. So, I decided to write down all steps required to get this task done with success.

Ingredients

  • Sources of PROJ.4
    cvs -d :pserver:cvsanon@cvs.maptools.org:/cvs/maptools/cvsroot login
    Password:
    cvs -d :pserver:cvsanon@cvs.maptools.org:/cvs/maptools/cvsroot co proj
  • Sources of WCELIBCEX
    svn co https://wcelibcex.svn.sourceforge.net/svnroot/wcelibcex/trunk wcelibcex
  • Compiler – Microsoft Visual C++ 2005 (equal to or higher than the Standard Edition)

…and Grandmother’s Recipe

I assume the following directories structure is used:

C:\dev
C:\dev\proj
C:\dev\wcelibcex

  1. Open one of available solutions – projce_lib (static library) or projce_dll – located under following location:
    C:\dev\proj\wince\msvc80
  2. Add project of WCELIBCE library to the loaded solution:
    • Go to the Solution Explorer
    • Select File > Add > Existing Project…
    • Navigate to C:\dev\wcelibcex\msvc80 and select wcelibcex_lib.vcproj file. OK.
  3. Set WCELIBCEX_PATH macro in the Property Sheet of PROJ.4 project (projce_common.vcproj):
    • Go to the Property Manager (in the View menu)
    • Double-click on projce_common leaf in the tree (it doesn’t matter if you expand Debug or Release node)
    • Go to Common Properties > User Macros
    • Double-click on WCELIBCEX_DIR macro and set proper location: C:\dev\wcelibcex\src.
    • Apply and OK
  4. Set wcelibcex_lib as a dependency of projce_dll: Project > Project Dependencies and select projce_dll Depends on: wcelibcex_lib.
  5. Grab some beer(s) from the fridge :-)
  6. Run Build > Build Solution (F7)

For example, if you’re building PROJ.4 as DLL for Windows Mobile 5.0 for Pocket PC, and you select debug configuration, you will find PROJ.4 binaries – proj.dll and proj_i.lib in following location:

C:\dev\proj\wince\msvc80\projce_dll\Windows Mobile 5.0 Pocket PC SDK (ARMV4I)\Debug

I hope someone will find this guide helpful. If there is anything unclear, put your questions as a comment below

BTW, there is README file in proj/wince/msvc80 including helpful information about how to build and use PROJ.4 under Windows CE platforms.

4 thoughts on “How to build PROJ.4 for Windows CE

  1. I try to compile proj and get the following errors in Visual C++ 2008
    Any idea what can resolve this?????
    Thanks
    Alex

    Error	1	error LNK2019: unresolved external symbol pj_insert_initcache referenced in function get_init	pj_init.obj	projce_dll
    Error	2	error LNK2019: unresolved external symbol pj_search_initcache referenced in function get_init	pj_init.obj	projce_dll
    Error	3	error LNK2001: unresolved external symbol pj_s_gstmerc	pj_list.obj	projce_dll
    Error	4	error LNK2001: unresolved external symbol pj_gstmerc	pj_list.obj	projce_dll
    Error	5	error LNK2019: unresolved external symbol __security_cookie referenced in function wceex_GetEnvironmentVariable	wcelibcex.lib	projce_dll
    Error	6	error LNK2019: unresolved external symbol __security_check_cookie referenced in function wceex_GetEnvironmentVariable	wcelibcex.lib	projce_dll
    Error	7	error LNK2001: unresolved external symbol __security_check_cookie	MSVCRT.lib	projce_dll
    Error	8	fatal error LNK1120: 6 unresolved externals	Pocket PC 2003	projce_dll
    
  2. A year too late:

    Add PJ_gstmerc.c to the project (contained in the directory, no need to check it out) and you will get rid of the
    external symbol pj_s_gstmerc and
    external symbol pj_gstmerc

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>