Build errors when adding WIP to project


#1

Using DS 1.2, I have a very simple C++ app built from the Hello_World example. It compiles and runs on the target.

I then open the project properties, add the WIP library, and add

#include "wip.h"

to the top of my source file, and when I compile it I get:

C:/DevTools/Sierra Wireless/Embedded Software/com.wavecom.openat.ide.spm.lib.plugin.model.WIP.5.40.0.201007290812_5.40.0.201007290812/resources/WIP/itf/wip_file.h:76: error: declaration of 'u32 wip_fileInfo_t::wip_fileInfo_entry_t::u32'
C:/DevTools/Sierra Wireless/Embedded Software/com.wavecom.openat.ide.spm.lib.os.model.6.34.0.201007281407_6.34.0.201007281407/resources/ADL/basic/wm_types.h:42: error: changes meaning of 'u32' from 'typedef uint32_t u32'
C:/DevTools/Sierra Wireless/Embedded Software/com.wavecom.openat.ide.spm.lib.plugin.model.WIP.5.40.0.201007290812_5.40.0.201007290812/resources/WIP/itf/wip_file.h:76: error: declaration of 's32 wip_fileInfo_t::wip_fileInfo_entry_t::s32'
C:/DevTools/Sierra Wireless/Embedded Software/com.wavecom.openat.ide.spm.lib.os.model.6.34.0.201007281407_6.34.0.201007281407/resources/ADL/basic/wm_types.h:43: error: changes meaning of 's32' from 'typedef int32_t s32'
C:/DevTools/Sierra Wireless/Embedded Software/com.wavecom.openat.ide.spm.lib.plugin.model.WIP.5.40.0.201007290812_5.40.0.201007290812/resources/WIP/itf/wip_file.h:77: error: declaration of 'ascii* wip_fileInfo_t::wip_fileInfo_entry_t::ascii'
C:/DevTools/Sierra Wireless/Embedded Software/com.wavecom.openat.ide.spm.lib.os.model.6.34.0.201007281407_6.34.0.201007281407/resources/ADL/basic/wm_types.h:106: error: changes meaning of 'ascii' from 'typedef char ascii'

main.cpp:

#include <Common.h>

/***************************************************************************/
/*  Mandatory variables                                                    */
/*-------------------------------------------------------------------------*/
/*  wm_apmCustomStackSize                                                  */
/*-------------------------------------------------------------------------*/
/***************************************************************************/
const u16 wm_apmCustomStackSize = 1024*3;

extern "C" {
/***************************************************************************/
/*  Function   : HelloWorld_TimerHandler                                   */
/*-------------------------------------------------------------------------*/
/*  Object     : Timer handler                                             */
/*                                                                         */
/*-------------------------------------------------------------------------*/
/*  Variable Name     |IN |OUT|GLB|  Utilisation                           */
/*--------------------+---+---+---+----------------------------------------*/
/*  ID                |   |   |   | Timer ID                               */
/*--------------------+---+---+---+----------------------------------------*/
/*  Context           |   |   |   | Context                                */
/*--------------------+---+---+---+----------------------------------------*/
/***************************************************************************/
void HelloWorld_TimerHandler ( u8 ID, void * Context )
{
    /* Hello World */
    TRACE (( 1, "Embedded : Hello World" ));
    adl_atSendResponse ( ADL_AT_UNS, "\r\nHello World from Open-AT\r\n" );
}



/***************************************************************************/
/*  Function   : adl_main                                                  */
/*-------------------------------------------------------------------------*/
/*  Object     : Customer application initialisation                       */
/*                                                                         */
/*-------------------------------------------------------------------------*/
/*  Variable Name     |IN |OUT|GLB|  Utilisation                           */
/*--------------------+---+---+---+----------------------------------------*/
/*  InitType          |   |   |   |  Application start mode reason         */
/*--------------------+---+---+---+----------------------------------------*/
/***************************************************************************/
void adl_main ( adl_InitType_e  InitType )
{
    TRACE (( 1, "Embedded : Appli Init" ));
    
    /* Set 1s cyclic timer */
    adl_tmrSubscribe ( TRUE, 10, ADL_TMR_TYPE_100MS, HelloWorld_TimerHandler );
}
}

Common.h:

#ifndef COMMON_H_
#define COMMON_H_

#ifdef __cplusplus

extern "C"
{
  // Include ADL interface
  #include "adl_global.h"
  #include "wip.h"
}

// Define FALSE and TRUE macros if needed
// (depends on used Open AT OS version)
#ifndef FALSE
#define FALSE 0
#endif //FALSE
#ifndef TRUE
#define TRUE  1
#endif //TRUE

#endif //__cplusplus


#endif /* COMMON_H_ */

#2

Stupid error in WIP header when used in C++
(cf [url]https://forum.sierrawireless.com/t/wip-library-and-c-fixed/3842/1])
Reported to concerned team here, and should be fixed in next release.
Meanwhile, you should add underscores (e.g. u32 _u32;) in wip_file.h to make it compile.


#3

It is also stupid in ‘C’ :exclamation:

No, you should not add leading underscores!
User code should not define symbol names with a leading underscore - that is reserved for compiler writers!

See: https://forum.sierrawireless.com/t/wip-library-and-c-fixed/3842/9


#4

Could you also get them to fix:


#5

Ok, sent for fix also.


#6

While they’re at it, please can they also put comments in the headers - consistent with the rest of ADL.


#7

I second that. The WIP header files are pretty opaque. Comments would really help.


#8

Done: action posted on the WIP side.


#9

But, aparently, not heeded: https://forum.sierrawireless.com/t/where-is-wip-iprouteadd-prototyped/4910/4


#10

This is broken again in Software Suite 2.35: https://forum.sierrawireless.com/t/no-newline-at-end-of-file/4615/2

:angry: