none
How to compile and link CE 6.0 with Visual Studio 2008

    Question

  • How do I configure Visual Studio 2008 to compile and link for CE 6.0, using C++ and Win32 API calls?

    Can I configure Visual Studio 2012 to compile and link for CE 6.0, using C++ and Win32 API calls?

    I am trying to compile for a CE 6.0 device.  I was told I needed to use Visual Studio 2008, that 2012 would not work.  It seems to me this would be a configuration issue, where to find headers, included code, and where to find the libraries for the linker.  While I understand these concepts very well, I have not been able to find out how to tell Visual Studio, either 2012 or 2008, were to find and use these resources.

    The Honeywell SDK would not install on Win7 with VS 2008, which was the recommended configuration.  They did provide the lxeapi.h and lxeapi.lib files, however, which I assume should be enough, if I was able to configure Visual Studio to use them, and only these resources.

    I have spent more than a week trying to find documentation and resolve this issue.  Microsoft gets very low marks on documentation.  This type of configuration should not be this difficult.



    • Edited by GBear-BD Sunday, September 22, 2013 1:01 AM
    Sunday, September 22, 2013 12:09 AM

Answers

  • Here is the forum for native development on Windows CE.

    You need to obtain an SDK from your device manufacturer.  The SDK is an MSI file that you install which contains the correct compiler and header files for your device.  Once you install the SDK, Visual Studio will have new project templates that target Windows CE.

    Visual Studio 2012 supports development for Windows Embedded Compact 2013.  You should use VS2008 for Windows Embedded CE 6.0 and Windows Embedded Compact 7.

    I have seen instructions on how to get VS2012 to compile for CE6, but there is no real advantage.  You still need the SDK and it still uses the same very out of date compiler and you cannot debug.

    Sunday, September 22, 2013 12:42 AM
  • For reference:  Have you tried creating a new project/solution against the SDK or are you moving/converting an existing configuration to also target the SDK?

    I find that it can sometimes be a real challenge getting all the pieces right when adding a new, unrelated SDK to a project and can be a huge nightmare when adding a CE SDK to an existing desktop project.

    First make sure that you can create and compile a new Win32 console project that targets only the MX7T_SDK.  If that fails, then I am not sure what to tell you.  If that succeeds, then may be a matter of going through all the build settings in your existing project versus a new one and seeing what is different.

    Also the linker subsystem is selected in the advanced tab of the linker settings page.

    Monday, September 23, 2013 6:51 PM

All replies

  • Here is the forum for native development on Windows CE.

    You need to obtain an SDK from your device manufacturer.  The SDK is an MSI file that you install which contains the correct compiler and header files for your device.  Once you install the SDK, Visual Studio will have new project templates that target Windows CE.

    Visual Studio 2012 supports development for Windows Embedded Compact 2013.  You should use VS2008 for Windows Embedded CE 6.0 and Windows Embedded Compact 7.

    I have seen instructions on how to get VS2012 to compile for CE6, but there is no real advantage.  You still need the SDK and it still uses the same very out of date compiler and you cannot debug.

    Sunday, September 22, 2013 12:42 AM
  • Thanks for your reply Michael.

    I did get the SDK from Honeywell (.msi).  It will not install.  I haven't heard from them 'why' yet, but I suspect they will say because I have both Visual Studio 2012 and 2008 installed on the same machine.

    I assumed that since I also have the header file (.h) and Lib file (.lib) I should be able to tell Visual Studio which header files to use for the compile, and which lib files to use for the link. 

    I have been unable to find proper documentation which describes how to make these Visual Studio configuration changes so I can test this idea.

    Where can I find documentation which describes how I can configure Visual Studio regarding the location of header files for the compile, and library files for the link?  I have looked at configuration manager closely, but none of the documentation I found shows me how to change the VS configuration.  I can see how I might add additional include file or an additional lib file, but not how to replace the defaults.  Any suggestions?

    Currently, I just need to be able to compile and link for CE 6.0, regardless of which version of VS I use.  Ultimately I would be able to use some of the advanced tools in VS 2012 to make it easier to support and enhance my CE applications, and move them to other embedded devices.

    Thanks also for the link to the Embedded Forum.  I'm new to Microsoft Forums, and had difficulty finding a category listing of all the forums so that I might be better able to pick the correct one.

    Thanks again for your help.


    • Edited by GBear-BD Sunday, September 22, 2013 4:52 PM
    Sunday, September 22, 2013 4:33 PM
  • Merely having the correct .h and .lib files is probably not sufficient.  Most Windows CE devices don't use the X86 compiler and VS2008 won't install the ARM or MIPS one without the SDK.  (And I suspect the CE x86 CE compiler may be different from the desktop one, or at least the ABI probably differs).

    Having vs2012 should not be the problem.  I have VS2012 installed, and I can install CE6 SDKs with no problems at all.

    One thing with the CE6 SDKs and VS2008 -- be sure to do a custom install and uncheck the option to install the documentation.  I would say that on roughly 2/3 of the machines I have tried it on, installing the docs causes the install to fail. 

    Sunday, September 22, 2013 8:48 PM
  • Dear SimonRev:

    You hit it on the nose with the installation.  I was able to complete the installation by deselecting the documentation.  Of course, I am a documentation freak, but I will look for other sources.

    My problem now is how to resolve the linker issues.  I have a very small test program I am trying to compile.  Here is the output from the build.

    1>------ Rebuild All started: Project: cetest2, Configuration: CE6 MX7T_SDK (ARMV4I) ------

    1>Deleting intermediate and output files for project 'cetest2', configuration 'CE6|MX7T_SDK (ARMV4I)'

    1>Compiling...

    1>main.cpp

    1>Linking...

    1>LINK : warning LNK4010: invalid subsystem version number 0x600; default subsystem version assumed

    1>corelibc.lib(COREDLL.dll) : fatal error LNK1112: module machine type 'THUMB' conflicts with target machine type 'ARM'

    1>Project : warning PRJ0018 : The following environment variables were not found:

    1>$(PLATFORMDEFINES)

    1>Build log was saved at "file://g:\SRC\Cpp\VS2008\CE6\cetest2\cetest2\MX7T_SDK (ARMV4I)\CE6\BuildLog.htm"

    1>cetest2 - 1 error(s), 1 warning(s)

    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

    It appears I do not have my "subsystem version number" properly defined, although I do not know what a subsystem version number is and how it relates to my link. The warning message says that each subsystem has a minimum version requirement, or it is set to the default.  Although I do not know how to verify the versions of any installed subsystems, and the minimum requirement for each. Since the invalided version number is x600, which is the CE version I for which I am trying to compile, it makes me believe something is not installed or configured correctly.

    I don't know where it is getting a module machine type of "THUMB".  I assume I am not pointing to the correct 'corelibc.lib' library. Although I don't know which configuration tunable controls this.

    I also wonder why the PLATFORMFDEFINES environment variable has not been set. Perhaps I need to do something to set it, although I don't know the proper value.

    I selected "MX7T_SDK (ARMV4I) in the configuration manager. (I am creating an app for the Honeywell Tecton MX7 with CE 6.0.)

    Configuration Properties -> General: The "Use of MFC" is set to "Use Standard Windows Libraries" although I am not using any MFC statements in my code.  I wonder if this is pointing the linker somewhere I don't want.  Perhaps this is why it is finding the 'corelibc.lib' file for the 'THIMB' machine type.

    Configuration Properties -> Deployment: The "Deployment Device" is set to "MX7T_SDK ARMV4I Device", although I don't know how to resolve that device name to the directories which contain the code for that device to be sure everything has been installed properly.

    Target Machine: I have been unable to find a "Target Machine" entry.  I did find "Configuration Properties -> Lilnker -> Command Line" set to "/subsystem:windowsce,$(CEVER) /machine:$(ARCHFAM)".  I confirmed the Macro CEVER is set to "x600", and the macro ARCHFAM is set to "ARM", which seems like it should be correct.

    I'm guessing something required has not been installed, or I have not set a path correctly somewhere in Visual Studio 2008.

    Any suggestions?

    Thanks much for your help.

    GB

    Monday, September 23, 2013 3:51 PM
  • For reference:  Have you tried creating a new project/solution against the SDK or are you moving/converting an existing configuration to also target the SDK?

    I find that it can sometimes be a real challenge getting all the pieces right when adding a new, unrelated SDK to a project and can be a huge nightmare when adding a CE SDK to an existing desktop project.

    First make sure that you can create and compile a new Win32 console project that targets only the MX7T_SDK.  If that fails, then I am not sure what to tell you.  If that succeeds, then may be a matter of going through all the build settings in your existing project versus a new one and seeing what is different.

    Also the linker subsystem is selected in the advanced tab of the linker settings page.

    Monday, September 23, 2013 6:51 PM
  • Dear SimonRev:

    Thanks so much for your assistance, it is much appreciated.

    I found the Target Machine on the advance tab in the Linker as you suggested.  It was not set, but when I set it to ARM, there was no change.  Apparently something else already set that target machine, which was then inherited by that setting.

    I'm a bit fuzzy as to when I created the projects, vs installing the SDK, so I will create new ones, starting with a simple console app as you suggest to further diagnose my problems.

    I will let you know how that goes.

    Thanks again for your assistance,

    GB

    Monday, September 23, 2013 8:21 PM
  • Dear SimonRev:

    That was it.  Apparently I must have been trying to modify a project created before the SDK was installed.  When I created a new project, I was able to get it to compile, link, and execute.  Thanks much.

    Interestingly, there was no Console App for the smart device, only Win32 and MFC.

    Also, the project says it is for CE 5.0.  I'm hoping that is just a labeling error.  I'm not sure what functions are unique to CE 6.0, but I'm sure once I try to port my thin client to this device I will find some.  I will go back to my vendor to try and determine if I actually have the SDK for CE 6.0 loaded or not.

    Thanks again for your help, it was invaluable.

    GB

    Tuesday, September 24, 2013 12:06 AM
  • Well, that means your SDK is probably for CE5 as well.  You may have the wrong SDK.  Many CE5 apps can run unchanged on CE6, but CE6 did add quite a few new APIs and made major changes to the memory model, so you would be better off compiling for CE6 if possible.

    Console app is a sub option within the Win32 project for CE.

    Tuesday, September 24, 2013 3:11 AM
  • I sent an email to Honeywell trying to verify the SDK, but I suspect you are right, that the SDK I have is for CE 5.0.  They have many 5.0 devices, and only a few 6.0 devices.  I'm porting an XP thin client to the CE 6.0 device, so I want as many of the win32 functions as I can get.  This is my first foray into CE.

    The console app under Win32 is not for CE, and there is no console app under Smart Devices.  I suspect that their SDK did not include a template for a console app.  I made a win32 console app, used configuration manager to change the Active Solution Platform to MX7T_ARM, which compiled and linked, but would not run on the MX7 device.  I received a "not a valid CE application" error.

    Thanks much for you help, I will let you know what I hear from Honeywell,

    GB

    Tuesday, September 24, 2013 11:26 AM