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
- Open one of available solutions – projce_lib (static library) or projce_dll – located under following location:
C:\dev\proj\wince\msvc80 - 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.
- 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
- Set wcelibcex_lib as a dependency of projce_dll: Project > Project Dependencies and select projce_dll Depends on: wcelibcex_lib.
- Grab some beer(s) from the fridge :-)
- 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.
I try to compile proj and get the following errors in Visual C++ 2008
Any idea what can resolve this?????
Thanks
Alex
First, ensure that you have added all .c files where reported functions are defined to your project.
Second, disable /GS (Buffer Security Check) option in project settings.
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
Ulf, no worries. I’m sure someone will make use of your hint eventually :-)
Thanks!