* Re:include file problems
@ 2000-11-28 9:52 Nacho de los RÃos Tormo
2000-11-28 10:14 ` Mo DeJong
2000-11-28 13:42 ` Ben Elliston
0 siblings, 2 replies; 7+ messages in thread
From: Nacho de los RÃÂos Tormo @ 2000-11-28 9:52 UTC (permalink / raw)
To: sourcenav
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]
I am also having this problem on a SuSE 7.0 installation. For example:
I'm trying to call the library function:
gettimeofday(struct timeval* tv, struct timezone * tz).
According to man pages, I need
#include <sys/time.h> (which should expand to /usr/include/sys/time.h)
#include <unistd.h> (which should expand to /usr/include/unistd.h)
SNav is unable to find the correct files -- which are indeed there.
I have toyed with the project settings include tab, as well as with the build
settings. Depending on the combination, it either finds /usr/include/time.h
(wrong file) or /usr/include/sys/unistd.h (also wrong).
SNav only manages to find the correct files if I include them explicitly in
the project (which calls for a trip to the project editor and to have the
project reparsed). But these files themselves do include a variety of other
files, which in their turn call others.
Trying to manually include all the tree soon leads into confusion and
dispair. And this is just for gettimeofday()! The thought of throwing in some
threads and an ncurses interface sends shivers down my spine.
Any ideas on what is wrong?
--
Nacho de los RÃos Tormo
Procedimientos Integrados S.L.
Sevillanos, 67
28609 Sevilla la Nueva, Madrid
SPAIN
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re:include file problems
2000-11-28 9:52 Re:include file problems Nacho de los RÃos Tormo
@ 2000-11-28 10:14 ` Mo DeJong
2000-11-29 2:41 ` Nacho de los RÃos Tormo
2000-11-28 13:42 ` Ben Elliston
1 sibling, 1 reply; 7+ messages in thread
From: Mo DeJong @ 2000-11-28 10:14 UTC (permalink / raw)
To: sourcenav
On Tue, 28 Nov 2000, Nacho de los =?iso-8859-1?q?R=EDos=20Tormo?= wrote:
> I am also having this problem on a SuSE 7.0 installation. For example:
>
> I'm trying to call the library function:
>
> gettimeofday(struct timeval* tv, struct timezone * tz).
>
> According to man pages, I need
>
> #include <sys/time.h> (which should expand to /usr/include/sys/time.h)
> #include <unistd.h> (which should expand to /usr/include/unistd.h)
>
> SNav is unable to find the correct files -- which are indeed there.
>
> I have toyed with the project settings include tab, as well as with the build
> settings. Depending on the combination, it either finds /usr/include/time.h
> (wrong file) or /usr/include/sys/unistd.h (also wrong).
>
> SNav only manages to find the correct files if I include them explicitly in
> the project (which calls for a trip to the project editor and to have the
> project reparsed). But these files themselves do include a variety of other
> files, which in their turn call others.
>
> Trying to manually include all the tree soon leads into confusion and
> dispair. And this is just for gettimeofday()! The thought of throwing in some
> threads and an ncurses interface sends shivers down my spine.
>
> Any ideas on what is wrong?
Sounds like a bug. Why don't you take a shot at fixing it?
Take at look at the Preferences&::AddInclude methods at
line 879 of gui/preferences.tcl. That should get you started.
Mo DeJong
Red Hat Inc
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re:include file problems
2000-11-28 9:52 Re:include file problems Nacho de los RÃos Tormo
2000-11-28 10:14 ` Mo DeJong
@ 2000-11-28 13:42 ` Ben Elliston
1 sibling, 0 replies; 7+ messages in thread
From: Ben Elliston @ 2000-11-28 13:42 UTC (permalink / raw)
To: Nacho de los RÃÂos Tormo; +Cc: sourcenav
SNav only manages to find the correct files if I include them
explicitly in the project (which calls for a trip to the project
editor and to have the project reparsed). But these files themselves
do include a variety of other files, which in their turn call others.
I could be wrong, but my recollection is that S-N will only include files in
your project that are explicitly listed at project creation time. That is,
#include directives are not followed as you might expect. This is in fact a
good idea, since it gives you more control over how big your database gets.
Often, users don't care about header files or, say, the function prototype
for strcmp(3). If you use the project editor to include all of
/usr/include, does it work as expected?
Ben
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re:include file problems
2000-11-28 10:14 ` Mo DeJong
@ 2000-11-29 2:41 ` Nacho de los RÃos Tormo
2000-11-29 4:02 ` Nacho de los RÃos Tormo
0 siblings, 1 reply; 7+ messages in thread
From: Nacho de los RÃÂos Tormo @ 2000-11-29 2:41 UTC (permalink / raw)
To: Mo DeJong; +Cc: sourcenav
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1441 bytes --]
> > SNav only manages to find the correct files if I include them explicitly
> > in the project (which calls for a trip to the project editor and to have
> > the project reparsed). But these files themselves do include a variety of
> > other files, which in their turn call others.
> >
> > Trying to manually include all the tree soon leads into confusion and
> > dispair. And this is just for gettimeofday()! The thought of throwing in
> > some threads and an ncurses interface sends shivers down my spine.
> >
> > Any ideas on what is wrong?
>
> Sounds like a bug. Why don't you take a shot at fixing it?
> Take at look at the Preferences&::AddInclude methods at
> line 879 of gui/preferences.tcl. That should get you started.
>
> Mo DeJong
> Red Hat Inc
I will try, but bearing in mind that I have no previous experience with
either C++ or TCL/Tk don't expect results any time soon ... :-(
Still, doesn't it seem unlikely that it be a problem in the source code? If
it were, I'm sure everybody that had tried to build a program of any
significance with SNav would have found the same problem. Most programs
written nowadays must include files that are in subdirs of usr/include.
Could it be something to do with environment variables or directory
structure? After all, it seems that the problem occurs with SuSE but not with
Red Hat ... Could you point me in some direction?
Thanks for your support,
Nacho de los RÃos Tormo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re:include file problems
2000-11-29 2:41 ` Nacho de los RÃos Tormo
@ 2000-11-29 4:02 ` Nacho de los RÃos Tormo
2000-11-29 4:10 ` include " Bruce Stephens
0 siblings, 1 reply; 7+ messages in thread
From: Nacho de los RÃÂos Tormo @ 2000-11-29 4:02 UTC (permalink / raw)
To: Mo DeJong; +Cc: sourcenav
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1275 bytes --]
Sorry for pestering you, but I would be happy to help have this bug fixed (if
indeed a bug). My C++ knowledge is limited and my TCL/Tk knowledge
NONEXISTANT, so any help from your part would greatly speed me up.
> > > SNav only manages to find the correct files if I include them
> > > explicitly in the project (which calls for a trip to the project editor
> > > and to have the project reparsed). But these files themselves do
> > > include a variety of other files, which in their turn call others.
> > >
> > > Trying to manually include all the tree soon leads into confusion and
> > > dispair. And this is just for gettimeofday()! The thought of throwing
> > > in some threads and an ncurses interface sends shivers down my spine.
Dumb me! Why not add the whole /usr/include and all its subdirectories in one
go with the project editor? .... Well, I've done so, so all involved files
MUST now be included in the project. Still I get the same compilation errors:
dos_in_lin.c: In function 'get_time_ms'
dos_in_lin.c: 30: 'timeval' undeclared (first use in this function)
....
make: *** [dos_in_lin.o] Error 1
+++ End +++
Thanks for your support,
Nacho de los RÃos Tormo
Procedimientos Integrados S.L.
Sevillanos, 67
28609 Sevilla la Nueva, Madrid
SPAIN
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: include file problems
2000-11-29 4:02 ` Nacho de los RÃos Tormo
@ 2000-11-29 4:10 ` Bruce Stephens
0 siblings, 0 replies; 7+ messages in thread
From: Bruce Stephens @ 2000-11-29 4:10 UTC (permalink / raw)
To: sourcenav
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 934 bytes --]
Nacho de los RÃos Tormo <irios@proin.es> writes:
[...]
> Dumb me! Why not add the whole /usr/include and all its
> subdirectories in one go with the project editor? .... Well, I've
> done so, so all involved files MUST now be included in the
> project. Still I get the same compilation errors:
>
> dos_in_lin.c: In function 'get_time_ms'
> dos_in_lin.c: 30: 'timeval' undeclared (first use in this function)
> ....
> make: *** [dos_in_lin.o] Error 1
> +++ End +++
That's a compiler error: it's got nothing to do with Source Navigator.
SN doesn't tell the compiler what header files to use. Something like
this ought to compile, regardless of what include files Source
Navigator finds:
#include <sys/time.h>
void
foo()
{
struct timeval tv;
struct timezone tz;
gettimeofday(&tv, &tz);
}
--
Bruce Stephens Bruce.Stephens@MessagingDirect.com
MessagingDirect(UK) Ltd <URL: http://www.MessagingDirect.com/ >
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re:include file problems
[not found] <Pine.LNX.4.30.0011292313170.20902-100000@moshpit.cygnus.com>
@ 2000-11-29 6:53 ` Nacho de los RÃos Tormo
0 siblings, 0 replies; 7+ messages in thread
From: Nacho de los RÃÂos Tormo @ 2000-11-29 6:53 UTC (permalink / raw)
To: Ben Elliston; +Cc: sourcenav
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 503 bytes --]
I am AWFULLY sorry; this was all my fault. ... I tried to compile the file
from the command line and got the same errors. I tried gcc -E to do just the
preprocessing, and the declaration was there OK. I checked the code, and
there it was, glaring:
struct timeval system_time;
...
gettimeofday(&timeval, 0);
...
&timeval????? SHAME on me! I'll try to get smarter ...
Thanks again.
Nacho de los RÃos Tormo
Procedimientos Integrados S.L.
Sevillanos, 67
28609 Sevilla la Nueva, Madrid
SPAIN
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2000-11-29 6:53 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-11-28 9:52 Re:include file problems Nacho de los RÃos Tormo
2000-11-28 10:14 ` Mo DeJong
2000-11-29 2:41 ` Nacho de los RÃos Tormo
2000-11-29 4:02 ` Nacho de los RÃos Tormo
2000-11-29 4:10 ` include " Bruce Stephens
2000-11-28 13:42 ` Ben Elliston
[not found] <Pine.LNX.4.30.0011292313170.20902-100000@moshpit.cygnus.com>
2000-11-29 6:53 ` Nacho de los RÃos Tormo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).