Migrating from CBuilder XE to Cbuilder 10.4

This is the forum for miscellaneous technical/programming questions.

Moderator: 2ffat

Post Reply
Ofer G
Posts: 3
Joined: Mon Jan 04, 2021 9:17 am

Migrating from CBuilder XE to Cbuilder 10.4

Post by Ofer G »

I have a project running written in CBuilder XE. In the code i use the following:

#include <queue.h>

Trying to compile it in the new compiler i get the following error message:
[bcc32 Error] cdrv.hpp(5): E2209 Unable to open include file 'queue.h'
Full parser context
POS_PRNT.CPP(7): #include cpos.hpp
cpos.hpp(5): #include cdrv.hpp

Searching the include directory (and sub directories....) i didn't find queue.h.

How should i change this line ?

Thanks

Ofer
rlebeau
BCBJ Author
BCBJ Author
Posts: 1776
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA
Contact:

Re: Migrating from CBuilder XE to Cbuilder 10.4

Post by rlebeau »

Ofer G wrote: Mon Jan 04, 2021 10:18 am In the code i use the following:

#include <queue.h>
What are you trying to use from <queue.h> exactly? If you are trying to use the standard std::queue class, you need to include <queue> instead (drop the .h suffix).
Remy Lebeau (TeamB)
Lebeau Software
Ofer G
Posts: 3
Joined: Mon Jan 04, 2021 9:17 am

Re: Migrating from CBuilder XE to Cbuilder 10.4

Post by Ofer G »

After dropping the .h I tried to compiled it. On the line below:

typedef queue< PcPosRec > MsgQueue;

i got the following error:

[bcc32 Error] cdrv.hpp(53): E2257 , expected

What does it means and how can I correct it ?

Thanks

Ofer
rlebeau
BCBJ Author
BCBJ Author
Posts: 1776
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA
Contact:

Re: Migrating from CBuilder XE to Cbuilder 10.4

Post by rlebeau »

Ofer G wrote: Thu Jan 07, 2021 1:28 am typedef queue< PcPosRec > MsgQueue;

i got the following error:

[bcc32 Error] cdrv.hpp(53): E2257 , expected
If there is no preceding 'using namespace std;' or 'using std::queue;' statement, you will need to fully qualify the class name:

Code: Select all

typedef std::queue< PcPosRec > MsgQueue;
Otherwise, add a 'using' statement, eg:

Code: Select all

#include <queue>
using namespace std;
typedef queue< PcPosRec > MsgQueue;
Or:

Code: Select all

#include <queue>
using std::queue;
typedef queue< PcPosRec > MsgQueue;
Remy Lebeau (TeamB)
Lebeau Software
Ofer G
Posts: 3
Joined: Mon Jan 04, 2021 9:17 am

Re: Migrating from CBuilder XE to Cbuilder 10.4

Post by Ofer G »

Hi,
I added the using (first example) and it compiled OK.

Now the link failed on the following statement:

if ((pPOS->idCHValThred = _beginthread(CHValidate, 0x2000, pValPrm)) == -1)
CritErr("Can't create CHVal thread");

The error is:

[ilink32 Error] Error: Unresolved external '__beginthread' referenced from C:\CPP\POS\DOR\TEMP\DDAFUNC.OBJ

looking at the help it is written:

/* Use the -tWM (32-bit multi-threaded target) command-line switch for this example */

Where should i add this switch ?

Thanks

Ofer
rlebeau
BCBJ Author
BCBJ Author
Posts: 1776
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA
Contact:

Re: Migrating from CBuilder XE to Cbuilder 10.4

Post by rlebeau »

Ofer G wrote: Sun Jan 10, 2021 6:22 am Where should i add this switch ?
I don't see a checkbox/toggle for that switch in the Project Options, so you will have to manually add the switch to the IDE's command-line for the compiler. There should be an option somewhere to specify additional user-defined command-line options (sorry, I'm not in front of an IDE that I can look at right now).
Remy Lebeau (TeamB)
Lebeau Software
Post Reply