Qt and Toradex libraries on WEC7

Hi,

I am using VS2008 as primary IDE for development
I have compiled and executed most examples for VC++(using GpioLib, pwmLib, I2cLib etc)

I also followed the article
Setting up Qt framework with VS2008 for WinCE with Toradex modules
to setup Qt development in VS2008, building basic GUI application in Qt

Now, the issue is with using Qt and the GPIOlib from Toradex.
When I include the gpio.h file in my main.cpp, the project compiles and I can use the GPIO API in main.cpp

But when I include it in the Qt main file (eg.gpiomain.cpp, the class implementing QMainWindow), I get compilation errors.
This is the BuildLog.htm for reference

My question is simple: How can we include the Toradex libs into Qt when using VS2008 as IDE?

@adwaitpatil ,

Could you please wait for a couple of days, we are looking into it. We will get back you soon.

Ok, I will wait for your reply

@rajat.tx
Could you please take over this?

Hello Everyone We also have same situation with WinCE library and the Qt library .

Can we use both of them simultaneously?

Dear @adwaitpatil

The Qt framework and the the Toradex CE Libraries can work together without any problems. Let me explain the steps by example:

Building the original hellogl_es2

I followed the steps described in the article
Setting up Qt framework with VS2008 for WinCE with Toradex modules
to build the project _C:\Qt\4.8.4\examples\opengl\hellogl_es2\ _

In addition to the instructions I had to do the following modifications in order to build the example:

  • After opening the project in VS2008, I needed to change the SDK name from SDK2wince7 (ARMv4I) to Toradex_CE700 (ARMv4I):
    • VS2008 Menu →Build→Configuration Manager →Active solution platform →<New…>
      new Platform = “Toradex_CE700”, copy settings from “SDK2wince7”

I built the example and verified that it was working properly on my target device.

Adding the Toradex Ce Libraries

After the basic example was running, I did the following steps to add the Toradex CE libraries to the project

  • I downloaded the latest version of the libraries and unzipped the libraries to the folder _C:\Qt\4.8.4\examples\opengl\TdxLibs\ _
  • In VS2008 I added the path to the header files and the binary libraries to the project settings:
    • Project →hellogl_es2 project Properties →Configuration Properties →C/C++ →General →Additional Include Directories
      add …\TdxLibs\inc; to the existing directories. Make sure you do this for both the Release and Debug configuration.
    • Project →hellogl_es2 project Properties →Configuration Properties →Linker →General →Additional Library Directories
      add “…\TdxLibs\libs\lib\Toradex_CE600 (ARMv4I)Debug”; to the existing directories for the debug configuration,
      add “…\TdxLibs\libs\lib\Toradex_CE600 (ARMv4I)Release”; to the existing directories for the release configuration.

Adding code to use the libraries

I modified the hellogl_es2 example to indicate on a GPIO (SODIMM135) whether bubbles are shown or not:

  • I added the GPIO header file to the project
    c:\Qt\4.8.4\examples\opengl\TdxLibs\inc\gpio.h
    This step is not required, but helps to navigate through the source code

  • In the file glwidget.cpp I included the header file:
    #include "gpio.h"

  • I modified the function GLWidget::showBubbles() as follows:

    void GLWidget::showBubbles(bool bubbles)
    {
    HANDLE hGpio;
    uIo ext_io_0 = COLIBRI_PIN(135);

      m_showBubbles = bubbles;
      
      hGpio = Gpio_Init(NULL);
      Gpio_SetConfigString(hGpio, ext_io_0, NULL, L"altfn=-1,dir=out", StoreVolatile);
      if (bubbles)
          Gpio_SetConfigString(hGpio, ext_io_0, NULL, L"lvl=1", StoreVolatile);
      else    
          Gpio_SetConfigString(hGpio, ext_io_0, NULL, L"lvl=0", StoreVolatile);
      Gpio_Deinit(hGpio);
    

    }
    I built the modified example and tested successfully that the GPIO is getting toggled as soon as bubbles were enabled/disabled from the GUI.

Regards, Andy