The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 BOOL vs. bool
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

MBIMO

Belgium
Posts

Posted - 08/16/2005 :  11:09:20 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.0552 SR4
Operating System: Win2k

Hello everybody,

I'm sorry to bother you people with a stupid question,
but what's the difference between the two data types BOOL and bool?

If I define two functions:

void Func1(BOOL aBoolean)
{}

void Func2(bool aBoolean)
{}

and call them in another function e.g.:

void Test()
{
Func1(TRUE);
Func2(true); // <==ERROR
}

I get the following error in the marked line when compiling:

Error, Function Func2@_BA was called, but its body could not be located during linking.
Linking Failed!

Does anybody know why the second line isn't working?


Thanks in advance,

Martin

cpyang

USA
1406 Posts

Posted - 08/16/2005 :  12:16:57 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Maybe there was a bug in 7.0, but 7.5 should not have problem.

BOOL is typedef as int, and bool is internally char type. Reason for the two was for calling external DLL function which might have the two types. If all codes are inside OC, we usually just use bool.

CP


Go to Top of Page

MBIMO

Belgium
Posts

Posted - 08/17/2005 :  02:55:16 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi CP,

thanks for you help.

You are right, meanwhile I managed to run the example on a computer with an Origin 7.5 installation without any problems.

Thanks again,

Martin
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000