Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » How to make Eclipse editor bool aware?
How to make Eclipse editor bool aware? [message #699491] Thu, 21 July 2011 16:20 Go to next message
Peter Steele is currently offline Peter SteeleFriend
Messages: 45
Registered: November 2010
Member
I originally posted this in the CDT group but didn't get a single response. I'm developing C code in Eclipse and have a self-managed makefile to use -std=c99. My code builds fine. Eclipse however does like my use of bool/true/false--it flags these as not being defined. Eclipse is happy about everything else except these symbols. I'm building my code on a Linux box but my Eclipse environment is running under Windows (with the source code mounted on a NFS drive).

I had thought these where defined in stdbool.h, and I have this include file specified. In drilling down into this include file though (and the include files it includes), don't actually see definitions for bool/true/false, so I'm a bit puzzled.

So, is there a way to make Eclipse recognize these symbols?
(no subject) [message #699502 is a reply to message #699491] Thu, 21 July 2011 16:39 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3268
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 21-Jul-11 10:20, Peter Steele wrote:
> I originally posted this in the CDT group but didn't get a single
> response. I'm developing C code in Eclipse and have a self-managed
> makefile to use -std=c99. My code builds fine. Eclipse however does like
> my use of bool/true/false--it flags these as not being defined. Eclipse
> is happy about everything else except these symbols. I'm building my
> code on a Linux box but my Eclipse environment is running under Windows
> (with the source code mounted on a NFS drive).
> I had thought these where defined in stdbool.h, and I have this include
> file specified. In drilling down into this include file though (and the
> include files it includes), don't actually see definitions for
> bool/true/false, so I'm a bit puzzled.
>
> So, is there a way to make Eclipse recognize these symbols?

Odd you wouldn't get a response there since those guys would better
understand the relationship between Eclipse and the C compiler (Eclipse
isn't a compiler of anything; even the Java compiler isn't Eclipse itself).

Is your drill-down being conducted in the include files actually
consumed by the compiler? Often, especially in the last 10 years, the
guts of even ISO C headers are tucked away down inside subordinate
included files many of which may not even have an extension like .h.

My guess would be the rather whimsical relation between where the code
lives and where Eclipse is running, but that's just me and I only ever
use Eclipse for Java (my numerous C days having been spent at the
command line in Unix and Linux years ago). The Linux box is too remote
for you to run Eclipse there instead?
Re: (no subject) [message #699511 is a reply to message #699502] Thu, 21 July 2011 17:05 Go to previous messageGo to next message
Peter Steele is currently offline Peter SteeleFriend
Messages: 45
Registered: November 2010
Member
I'm using Eclipse on a 30" monitor running under Windows 7 Ultimate. It's a very nice environment. Running Eclipse on the Linux box itself is an option, but I'd have to go through a VNC session. In my past experience in using Eclipse under Linux, I've found it to not operate as "smoothly" as it does under Windows. The fonts aren't as good, and many aspects of the experience is simply inferior. Augment that with a slowish VNC session and it's hard to get motivated to make the switch. I may have to make the leap though if issues like this can't be resolved.
Re: (no subject) [message #699514 is a reply to message #699511] Thu, 21 July 2011 17:08 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3268
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 21-Jul-11 11:05, Peter Steele wrote:
> I'm using Eclipse on a 30" monitor running under Windows 7 Ultimate.
> It's a very nice environment. Running Eclipse on the Linux box itself is
> an option, but I'd have to go through a VNC session. In my past
> experience in using Eclipse under Linux, I've found it to not operate as
> "smoothly" as it does under Windows. The fonts aren't as good, and many
> aspects of the experience is simply inferior. Augment that with a
> slowish VNC session and it's hard to get motivated to make the switch. I
> may have to make the leap though if issues like this can't be resolved.

Moving the whole enchilada to your local Windoz host then isn't an
option? I mean having access to the code and C tools (all that Ming and
other stuff they use) locally.

I would suggest "sharing" the code with the Linux host via Subversion,
Git, etc. Eclipse and Subversion work VERY well together. (I might be
able to help with this--getting it set up on Linux.)

Best,
Russ
Re: (no subject) [message #699686 is a reply to message #699511] Fri, 22 July 2011 04:54 Go to previous messageGo to next message
Dilton McGowan II is currently offline Dilton McGowan IIFriend
Messages: 108
Registered: July 2009
Senior Member
On Thu, 21 Jul 2011 13:05:04 -0400, Peter Steele wrote:

> using Eclipse under Linux, I've found it to not operate as "smoothly" as
> it does under Windows. The fonts aren't as good, and many aspects of the

It works just fine for the rest of us Eclipse Linux users.

Odd that. Fonts are great on Ubuntu the leading Linux desktop.

Perhaps you are recalling experiences from years gone by
but in that case you would have to compare to Windows
from that same period.
(no subject) [message #699688 is a reply to message #699491] Fri, 22 July 2011 04:56 Go to previous messageGo to next message
Dilton McGowan II is currently offline Dilton McGowan IIFriend
Messages: 108
Registered: July 2009
Senior Member
On Thu, 21 Jul 2011 12:20:41 -0400, Peter Steele wrote:

> a Linux box but my Eclipse environment is running under Windows (with
> the source code mounted on a NFS drive).

Don't do that. Use source control. Problem solved.
Re: (no subject) [message #699724 is a reply to message #699688] Fri, 22 July 2011 07:52 Go to previous messageGo to next message
Pal Shadi is currently offline Pal ShadiFriend
Messages: 6
Registered: July 2011
Junior Member
thanks for solving Smile
(no subject) [message #699896 is a reply to message #699491] Fri, 22 July 2011 14:41 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 179
Registered: July 2009
Senior Member
On Thu, 21 Jul 2011 12:20:41 -0400, Peter Steele
<forums-noreply@eclipse.org> wrote:

>I originally posted this in the CDT group but didn't get a single response. I'm developing C code in Eclipse and have a self-managed makefile to use -std=c99. My code builds fine. Eclipse however does like my use of bool/true/false--it flags these as not being defined. Eclipse is happy about everything else except these symbols. I'm building my code on a Linux box but my Eclipse environment is running under Windows (with the source code mounted on a NFS drive).
>
>I had thought these where defined in stdbool.h, and I have this include file specified. In drilling down into this include file though (and the include files it includes), don't actually see definitions for bool/true/false, so I'm a bit puzzled.
>
>So, is there a way to make Eclipse recognize these symbols?

That seems odd. I've had a go here and don't see this problem. If I
create a new Empty Makefile project with "Other toolchain" it doesn't
show anything useful about bool, true or false but, on the other hand,
it doesn't show them up as an issue (although #include <stdbool.h> is
highlighted as not found because I haven't set up any paths.

If I create a MinGW project and use bool, true and false then it's
much the same; they're not shown up as anything interesting but, when
I put in #include <stdbool.h> I can hover over them and see the macro
expansion information.

What version of Eclipse/CDT are you working with? I'm using Helios
with CDT 7.something.
Re: (no subject) [message #699900 is a reply to message #699514] Fri, 22 July 2011 14:54 Go to previous messageGo to next message
Peter Steele is currently offline Peter SteeleFriend
Messages: 45
Registered: November 2010
Member
I've used Ubuntu, and although it isn't quite up to the standards of Windows 7 font-wise, the fonts and UI are definitely pretty good. The Linux box I'd be using though runs SLED (SUSE Linux) and it isn't nearly as polished as other Linux distros I've used. And like I said, having to run over VNC isn't great.

And I do use source control of course (SVN, using Eclipse's built-in client as well as TortoiseSVN). That doesn't solve the problem of sharing a source tree between a Windows box and a Linux box though in my opinion. At least, not without checking in the changes to the files I'm editing and I definitely don't want to do that, not before the code is thoroughly tested. Once it's all tested, I check in my code, check out a clean tree under Linux, do a verification build and retest everything.

From my experience, if you want to build in Linux but edit under Windows, you either have to have the source on Windows and mount the Windows sources on Linux, or have the sources on Linux and mount that share on the Windows box. I prefer the latter since building on a network mounted share really impacts the build time.

Ultimately everything is working great. The only issue I have is Eclipse doesn't recognize bool/true/false. I assume there's a solution, if I can get the include files to be searched properly.
Re: (no subject) [message #699922 is a reply to message #699896] Fri, 22 July 2011 15:18 Go to previous messageGo to next message
Peter Steele is currently offline Peter SteeleFriend
Messages: 45
Registered: November 2010
Member
John McCabe wrote on Fri, 22 July 2011 10:41
On Thu, 21 Jul 2011 12:20:41 -0400, Peter Steele
<forums-noreply@eclipse.org> wrote:

What version of Eclipse/CDT are you working with? I'm using Helios
with CDT 7.something.


I am using Eclipse Indigo with CDT version 8. If I add an

#include <stdbool.h>

it finds it okay since I have the include paths defined. That expands to

#ifndef _TR1_STDBOOL_H
#define _TR1_STDBOOL_H 1

#include <tr1/cstdbool>

#endif

The symbol _TR1_STDBOOL_H is not defined so it includes tr1/csdbool, which expands to

#ifndef _GLIBCXX_TR1_CSTDBOOL
#define _GLIBCXX_TR1_CSTDBOOL 1

#pragma GCC system_header

#include <bits/c++config.h>

#define _GLIBCXX_HAVE_STDBOOL_H 1
#if _GLIBCXX_HAVE_STDBOOL_H
#include <stdbool.h>
#endif

#endif // _GLIBCXX_TR1_CSTDBOOL

and so on. The include files that are referenced are all recognized by Eclipse and I've drilled down through them, but I don't actually see bool or true or false defined in any of them. These include files come straight from my SLED Linux box. The answer is in this chain of includes somewhere, I'm just missing something.

If C99 is defined, does this make bool a new keyword/type in C or is it defined as a typedef somewhere? I've search through the include files and I cannot find a typedef or define for 'bool', nor anything for 'true' and 'false'.
Re: (no subject) [message #699927 is a reply to message #699922] Fri, 22 July 2011 15:26 Go to previous messageGo to next message
Peter Steele is currently offline Peter SteeleFriend
Messages: 45
Registered: November 2010
Member
I should add that if I have a line like

bool test = true;

the Eclipse Indigo editor adds an underline to 'bool' and 'false' plus there is a little bug symbol at the left of the line indicating there is a syntax error with the line. The error reported by Eclipse is

Type 'bool' could not be resolved

Re: (no subject) [message #699934 is a reply to message #699927] Fri, 22 July 2011 15:29 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 179
Registered: July 2009
Senior Member
On Fri, 22 Jul 2011 11:26:09 -0400, Peter Steele
<forums-noreply@eclipse.org> wrote:

>I should add that if I have a line like
>
>bool test = true;
>
>the Eclipse Indigo editor adds an underline to 'bool' and 'false' plus there is a little bug symbol at the left of the line indicating there is a syntax error with the line. The error reported by Eclipse is
>
>Type 'bool' could not be resolved

I guess you could try right clicking on the project, going to the
"Index" menu item, and reindexing the project. That worked for someone
I know who had vaguely similar issues.
Re: (no subject) [message #699946 is a reply to message #699900] Fri, 22 July 2011 15:41 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3268
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 22-Jul-11 08:54, Peter Steele wrote:
> I've used Ubuntu, and although it isn't quite up to the standards of
> Windows 7 font-wise, the fonts and UI are definitely pretty good. The
> Linux box I'd be using though runs SLED (SUSE Linux) and it isn't nearly
> as polished as other Linux distros I've used. And like I said, having to
> run over VNC isn't great.
>
> And I do use source control of course (SVN, using Eclipse's built-in
> client as well as TortoiseSVN). That doesn't solve the problem of
> sharing a source tree between a Windows box and a Linux box though in my
> opinion. At least, not without checking in the changes to the files I'm
> editing and I definitely don't want to do that, not before the code is
> thoroughly tested. Once it's all tested, I check in my code, check out a
> clean tree under Linux, do a verification build and retest everything.
>
> From my experience, if you want to build in Linux but edit under
> Windows, you either have to have the source on Windows and mount the
> Windows sources on Linux, or have the sources on Linux and mount that
> share on the Windows box. I prefer the latter since building on a
> network mounted share really impacts the build time.
>
> Ultimately everything is working great. The only issue I have is Eclipse
> doesn't recognize bool/true/false. I assume there's a solution, if I can
> get the include files to be searched properly.

As a former lont-time Novell employee, I used SuSE for a long time
before abandoning it for Ubunut.

I know a trick to getting Windows fonts onto Ubuntu. I'm not a fan of
Windoz, but I am a fan of Microsoft's new fonts (like Candara). If
interested, ask me privately.
Re: (no subject) [message #699958 is a reply to message #699900] Fri, 22 July 2011 15:51 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3268
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 22-Jul-11 08:54, Peter Steele wrote:
> I've used Ubuntu, and although it isn't quite up to the standards of
> Windows 7 font-wise, the fonts and UI are definitely pretty good. The
> Linux box I'd be using though runs SLED (SUSE Linux) and it isn't nearly
> as polished as other Linux distros I've used. And like I said, having to
> run over VNC isn't great.
>
> And I do use source control of course (SVN, using Eclipse's built-in
> client as well as TortoiseSVN). That doesn't solve the problem of
> sharing a source tree between a Windows box and a Linux box though in my
> opinion. At least, not without checking in the changes to the files I'm
> editing and I definitely don't want to do that, not before the code is
> thoroughly tested. Once it's all tested, I check in my code, check out a
> clean tree under Linux, do a verification build and retest everything.
>
> From my experience, if you want to build in Linux but edit under
> Windows, you either have to have the source on Windows and mount the
> Windows sources on Linux, or have the sources on Linux and mount that
> share on the Windows box. I prefer the latter since building on a
> network mounted share really impacts the build time.
>
> Ultimately everything is working great. The only issue I have is Eclipse
> doesn't recognize bool/true/false. I assume there's a solution, if I can
> get the include files to be searched properly.
>

As a former long-time Novell employee, I used SuSE (SLES and openSuSE)
for a long time before abandoning it for Ubuntu.

I know a trick to getting Windows fonts onto Ubuntu. I'm not a fan of
Windoz, but I am a fan of Microsoft's new fonts (like Candara). If
interested, ask me privately.
Re: (no subject) [message #699976 is a reply to message #699934] Fri, 22 July 2011 16:36 Go to previous messageGo to next message
Peter Steele is currently offline Peter SteeleFriend
Messages: 45
Registered: November 2010
Member
John McCabe wrote on Fri, 22 July 2011 11:29
On Fri, 22 Jul 2011 11:26:09 I guess you could try right clicking on the project, going to the
"Index" menu item, and reindexing the project. That worked for someone
I know who had vaguely similar issues.


Alas, no joy...
Re: (no subject) [message #699981 is a reply to message #699958] Fri, 22 July 2011 16:40 Go to previous messageGo to next message
Peter Steele is currently offline Peter SteeleFriend
Messages: 45
Registered: November 2010
Member
Russell Bateman wrote on Fri, 22 July 2011 11:51
On 22-Jul-11 08:54, I know a trick to getting Windows fonts onto Ubuntu. I'm not a fan of
Windoz, but I am a fan of Microsoft's new fonts (like Candara). If
interested, ask me privately.


I'm not specifically interested in Windows fonts, just nicely smoothed, readable fonts. SLED is just plain awful. I've tweaked it some to make it bearable but it's pretty pathetic compared to Windows and most of the better Linux distros like Ubuntu and Fedora. Unfortunately we use SLED here on our build boxes and I don't have an option to move to something better...
Re: (no subject) [message #700016 is a reply to message #699922] Fri, 22 July 2011 17:14 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 2411
Registered: July 2009
Senior Member
A question/problem with this much detail really belongs on the CDT forum
group. Most of the Eclipse C/C++ gurus hang out there, few of them hang
out here. Try posting again there with all this detail and see if anyone
responds.

Eric


On 7/22/11 11:18 AM, Peter Steele wrote:
> John McCabe wrote on Fri, 22 July 2011 10:41
>> On Thu, 21 Jul 2011 12:20:41 -0400, Peter Steele
>> <forums-noreply@eclipse.org> wrote:
>>
>> What version of Eclipse/CDT are you working with? I'm using Helios
>> with CDT 7.something.
>
>
> I am using Eclipse Indigo with CDT version 8. If I add an
>
> #include <stdbool.h>
>
> it finds it okay since I have the include paths defined. That expands to
>
> #ifndef _TR1_STDBOOL_H
> #define _TR1_STDBOOL_H 1
>
> #include <tr1/cstdbool>
>
> #endif
>
> The symbol _TR1_STDBOOL_H is not defined so it includes tr1/csdbool,
> which expands to
>
> #ifndef _GLIBCXX_TR1_CSTDBOOL
> #define _GLIBCXX_TR1_CSTDBOOL 1
>
> #pragma GCC system_header
>
> #include <bits/c++config.h>
>
> #define _GLIBCXX_HAVE_STDBOOL_H 1
> #if _GLIBCXX_HAVE_STDBOOL_H
> #include <stdbool.h>
> #endif
>
> #endif // _GLIBCXX_TR1_CSTDBOOL
>
> and so on. The include files that are referenced are all recognized by
> Eclipse and I've drilled down through them, but I don't actually see
> bool or true or false defined in any of them. These include files come
> straight from my SLED Linux box. The answer is in this chain of includes
> somewhere, I'm just missing something.
>
> If C99 is defined, does this make bool a new keyword/type in C or is it
> defined as a typedef somewhere? I've search through the include files
> and I cannot find a typedef or define for 'bool', nor anything for
> 'true' and 'false'.
>
Re: (no subject) [message #700030 is a reply to message #700016] Fri, 22 July 2011 18:18 Go to previous message
Peter Steele is currently offline Peter SteeleFriend
Messages: 45
Registered: November 2010
Member
Yeah, I'll do that. Hopefully someone will bite this time...
Previous Topic:Database Development view problems.
Next Topic:Help needed to get @Key annotation to work in eclipse
Goto Forum:
  


Current Time: Mon Dec 22 03:02:01 GMT 2014

Powered by FUDForum. Page generated in 0.02188 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software