Linux-Development-Apps Digest #436, Volume #7    Sun, 27 May 01 23:13:15 EDT

Contents:
  Oracle 8.1.5 installation problem Redhat 6.2 ("Nick H")
  Shell Scripting Frustration (Rand Simberg)
  Re: does anyone know of a gui ide for c++ with component libraries (must be free or 
cheap) ("Neil Butterworth")
  Re: help: Undefined reference to '...' (Jim Cochrane)
  Re: Shell Scripting Frustration (Jim Cochrane)
  Re: Shell Scripting Frustration (Rand Simberg)
  Re: howto move the errors from gcc to a file? (hihihi)
  gdb warning (Charles Wilkins)
  Generating dependencies (David Welch)
  Re: A linuxthreads C++ object question (Daniel Barron)
  about struct file_operations? (charles guo)
  Help with tinycobol (David. E. Goble)
  What widget could be read/written easily? (Etienne Maitre)
  Re: about struct file_operations? (Christopher Fairbairn)

----------------------------------------------------------------------------

From: "Nick H" <[EMAIL PROTECTED]>
Subject: Oracle 8.1.5 installation problem Redhat 6.2
Date: Sun, 27 May 2001 15:41:09 +0200

I'm stuck.  The runinstaller program fails in creating the Java Virtual
Machine with a EFAULT from an execve.  My Jre is 1.1.6 glibc version from
Blackdown as per installation notes.  My environment appears  correct.
Any ideas?




------------------------------

From: [EMAIL PROTECTED] (Rand Simberg)
Subject: Shell Scripting Frustration
Date: Sun, 27 May 2001 16:09:21 GMT

I'm writing a simple Bourne shell script (running in bash).

When redirecting a file from a read command, isn't each read supposed
to read the next line of the file?

I have a file called mainshares whose contents are:

\tNEW FOLDER\tDisk
\tPRINTER$\tDisk
\tVENTURES\tDisk

(It's generated by a grep on "Disk" of an smbclient -L command)

My script is:

:
while read inshare < mainshares
do
  echo $inshare
done

When I run this, it goes into an infinite loop, repeatedly printing
the first line of the file, and never advancing to the next one.

What's going on?

-- 
simberg.interglobal.org  * 310 372-7963 (CA) 307 739-1296 (Jackson Hole)  
interglobal space lines  * 307 733-1715 (Fax) http://www.interglobal.org 

"Extraordinary launch vehicles require extraordinary markets..."
Replace first . with @ and throw out the "@trash." to email me.  
Here's my email address for autospammers: [EMAIL PROTECTED]

------------------------------

From: "Neil Butterworth" <[EMAIL PROTECTED]>
Subject: Re: does anyone know of a gui ide for c++ with component libraries (must be 
free or cheap)
Date: Sun, 27 May 2001 19:14:58 +0100

"Daniel Moss" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Does anyone know of a gui ide for c++ with component libraries (must be
free
> or cheap). Thanks.

Take a look at kdevelop at www.kdevelop.org

NeilB






------------------------------

From: [EMAIL PROTECTED] (Jim Cochrane)
Crossposted-To: alt.linux,aus.computers.linux,comp.os.linux.setup
Subject: Re: help: Undefined reference to '...'
Date: 27 May 2001 13:54:09 -0600

I think you need to read the gcc man page, or info gcc.  On your command
line:

>gcc -O3 -o testlibpq testlibpq.c -I/usr/include/pgsql -Llibpq 2>testlibpq.txt

the -L option takes a directory and (path).  If you want to link with
libpq.a, the option is -lpq.  That file will need to be in a standard
directory such as /usr/lib; if it's not, read up on the LD_LIBRARY_PATH
env. variable.  Here's the relevant section on -l in the gcc man page:

       -llibrary
              Use the library named library when linking.

              The  linker searches a standard list of directories
              for the library, which is  actually  a  file  named
              `liblibrary.a'.   The linker then uses this file as
              if it had been specified precisely by name.

              The directories searched include  several  standard
              system  directories  plus any that you specify with
              `-L'.

              Normally the  files  found  this  way  are  library
              files--archive   files  whose  members  are  object
              files.  The linker handles an archive file by scan
              ning  through  it  for members which define symbols
              that have so far been referenced but  not  defined.
              However,  if  the  linker  finds an ordinary object
              file rather than a  library,  the  object  file  is
              linked  in  the usual fashion.  The only difference
              between using an `-l' option and specifying a  file
              name  is that `-l' surrounds library with `lib' and
              `.a' and searches several directories.


In article <[EMAIL PROTECTED]>,
David. E. Goble <goble@gtech> wrote:
>On Thu, 24 May 2001 07:52:32 GMT, goble@gtech (David. E. Goble) wrote:
>>
>Hi All;
>
>I have redHat 6.2 (server install)
>I am trying to do some programming.
>
>How that I know how to save the error messages, here is what is
>happening;
>
>/*######## Here is the c file I am trying to compile and run #######*/
>/*
> * testlibpq.c Test the C version of Libpq, the Postgres frontend
> * library.
> *
> *
> */
>#include<stdio.h>
>#include "libpq-fe.h"
>
>void exit_nicely(PGconn *conn)
>{
>    PQfinish(conn);
>    exit(1);
>}
>
>main()
>{
>    char       *pghost,
>               *pgport,
>               *pgoptions,
>               *pgtty;
>    char       *dbName;
>    int         nFields;
>    int         i,
>                j;
>
>    /* FILE *debug; */
>
>    PGconn     *conn;
>    PGresult   *res;
>
>    /*
>     * begin, by setting the parameters for a backend connection if
>the
>     * parameters are null, then the system will try to use reasonable
>     * defaults by looking up environment variables or, failing that,
>     * using hardwired constants
>     */
>    pghost = NULL;              /* host name of the backend server */
>    pgport = NULL;              /* port of the backend server */
>    pgoptions = NULL;           /* special options to start up the
>backend
>                                 * server */
>    pgtty = NULL;               /* debugging tty for the backend
>server */
>    dbName = "template1";
>
>    /* make a connection to the database */
>    conn = PQsetdb(pghost, pgport, pgoptions, pgtty, dbName);
>
>    /*
>     * check to see that the backend connection was successfully made
>     */
>    if (PQstatus(conn) == CONNECTION_BAD)
>       {
>        fprintf(stderr, "Connection to database '%s' failed.\n",
>dbName);
>        fprintf(stderr, "%s", PQerrorMessage(conn));
>        exit_nicely(conn);
>       }
>
>    /* debug = fopen("/tmp/trace.out","w"); */
>    /* PQtrace(conn, debug);  */
>
>    /* start a transaction block */
>    res = PQexec(conn, "BEGIN");
>    if (!res || PQresultStatus(res) != PGRES_COMMAND_OK)
>       {
>        fprintf(stderr, "BEGIN command failed\n");
>        PQclear(res);
>        exit_nicely(conn);
>       }
>
>    /*
>     * should PQclear PGresult whenever it is no longer needed to
>avoid
>     * memory leaks
>     */
>    PQclear(res);
>
>    /*
>     * fetch instances from the pg_database, the system catalog of
>     * databases
>     */
>    res = PQexec(conn, "DECLARE mycursor CURSOR FOR select * from
>pg_database");
>    if(!res || PQresultStatus(res) != PGRES_COMMAND_OK)
>       {
>        fprintf(stderr, "DECLARE CURSOR command failed\n");
>        PQclear(res);
>        exit_nicely(conn);
>       }
>    PQclear(res);
>    res = PQexec(conn, "FETCH ALL in mycursor");
>    if(!res || PQresultStatus(res) != PGRES_TUPLES_OK)
>       {
>        fprintf(stderr, "FETCH ALL command didn't return tuples
>properly\n");
>        PQclear(res);
>        exit_nicely(conn);
>       }
>
>    /* first, print out the attribute names */
>    nFields = PQnfields(res);
>    for (i = 0; i<nFields; i++)
>        printf("%-15s", PQfname(res, i));
>    printf("\n\n");
>
>    /* next, print out the instances */
>    for (i = 0; i<PQntuples(res); i++)
>       {
>        for (j = 0; j<nFields; j++)
>            printf("%-15s", PQgetvalue(res, i, j));
>        printf("\n");
>       }
>    PQclear(res);
>
>    /* close the cursor */
>    res = PQexec(conn, "CLOSE mycursor");
>    PQclear(res);
>
>    /* commit the transaction */
>    res = PQexec(conn, "COMMIT");
>    PQclear(res);
>
>    /* close the connection to the database and cleanup */
>    PQfinish(conn);
>
>    /* fclose(debug); */
>}
>
>/*
>This is how I am trying to do it;
>
>gcc -O3 -o testlibpq testlibpq.c -I/usr/include/pgsql -Llibpq
>2>testlibpq.txt
>
>And here are the results
>
>/tmp/cc2HM1Be.o: In function `exit_nicely':
>/tmp/cc2HM1Be.o(.text+0x8): undefined reference to `PQfinish'
>/tmp/cc2HM1Be.o: In function `main':
>/tmp/cc2HM1Be.o(.text+0x66): undefined reference to `PQsetdbLogin'
>/tmp/cc2HM1Be.o(.text+0x77): undefined reference to `PQstatus'
>/tmp/cc2HM1Be.o(.text+0xa1): undefined reference to `PQerrorMessage'
>/tmp/cc2HM1Be.o(.text+0xd4): undefined reference to `PQexec'
>/tmp/cc2HM1Be.o(.text+0xeb): undefined reference to `PQresultStatus'
>/tmp/cc2HM1Be.o(.text+0x118): undefined reference to `PQclear'
>/tmp/cc2HM1Be.o(.text+0x130): undefined reference to `PQclear'
>/tmp/cc2HM1Be.o(.text+0x141): undefined reference to `PQexec'
>/tmp/cc2HM1Be.o(.text+0x158): undefined reference to `PQresultStatus'
>/tmp/cc2HM1Be.o(.text+0x180): undefined reference to `PQclear'
>/tmp/cc2HM1Be.o(.text+0x198): undefined reference to `PQclear'
>/tmp/cc2HM1Be.o(.text+0x1a9): undefined reference to `PQexec'
>/tmp/cc2HM1Be.o(.text+0x1c0): undefined reference to `PQresultStatus'
>/tmp/cc2HM1Be.o(.text+0x1e8): undefined reference to `PQclear'
>/tmp/cc2HM1Be.o(.text+0x200): undefined reference to `PQnfields'
>/tmp/cc2HM1Be.o(.text+0x229): undefined reference to `PQfname'
>/tmp/cc2HM1Be.o(.text+0x265): undefined reference to `PQntuples'
>/tmp/cc2HM1Be.o(.text+0x29d): undefined reference to `PQgetvalue'
>/tmp/cc2HM1Be.o(.text+0x2d7): undefined reference to `PQclear'
>/tmp/cc2HM1Be.o(.text+0x2e8): undefined reference to `PQexec'
>/tmp/cc2HM1Be.o(.text+0x2f9): undefined reference to `PQclear'
>/tmp/cc2HM1Be.o(.text+0x30a): undefined reference to `PQexec'
>/tmp/cc2HM1Be.o(.text+0x31b): undefined reference to `PQclear'
>/tmp/cc2HM1Be.o(.text+0x327): undefined reference to `PQfinish'
>collect2: ld returned 1 exit status
>*/


-- 
Jim Cochrane
[EMAIL PROTECTED]

------------------------------

From: [EMAIL PROTECTED] (Jim Cochrane)
Subject: Re: Shell Scripting Frustration
Date: 27 May 2001 14:03:46 -0600

In article <[EMAIL PROTECTED]>,
Rand Simberg <[EMAIL PROTECTED]> wrote:
>I'm writing a simple Bourne shell script (running in bash).
>
>When redirecting a file from a read command, isn't each read supposed
>to read the next line of the file?
>
>I have a file called mainshares whose contents are:
>
>\tNEW FOLDER\tDisk
>\tPRINTER$\tDisk
>\tVENTURES\tDisk
>
>(It's generated by a grep on "Disk" of an smbclient -L command)
>
>My script is:
>
>:
>while read inshare < mainshares
>do
>  echo $inshare
>done

Each time the while expression is evaluated, you are starting a fresh
command to read from mainshares, and each time the first line is read.
Try:

while read inshare
do
  echo $inshare
done < mainshares

or:

cat mainshares|while read inshare
do
  echo $inshare
done

>
>When I run this, it goes into an infinite loop, repeatedly printing
>the first line of the file, and never advancing to the next one.
>
>What's going on?
>
>-- 
>simberg.interglobal.org  * 310 372-7963 (CA) 307 739-1296 (Jackson Hole)  
>interglobal space lines  * 307 733-1715 (Fax) http://www.interglobal.org 
>
>"Extraordinary launch vehicles require extraordinary markets..."
>Replace first . with @ and throw out the "@trash." to email me.  
>Here's my email address for autospammers: [EMAIL PROTECTED]


-- 
Jim Cochrane
[EMAIL PROTECTED]

------------------------------

From: [EMAIL PROTECTED] (Rand Simberg)
Subject: Re: Shell Scripting Frustration
Date: Sun, 27 May 2001 20:24:34 GMT

On 27 May 2001 14:03:46 -0600, in a place far, far away,
[EMAIL PROTECTED] (Jim Cochrane) made the phosphor on my monitor
glow in such a way as to indicate that:

>>My script is:
>>
>>:
>>while read inshare < mainshares
>>do
>>  echo $inshare
>>done
>
>Each time the while expression is evaluated, you are starting a fresh
>command to read from mainshares, and each time the first line is read.
>Try:
>
>while read inshare
>do
>  echo $inshare
>done < mainshares
>
>or:
>
>cat mainshares|while read inshare
>do
>  echo $inshare
>done

OK, I'll try that--thanx...

-- 
simberg.interglobal.org  * 310 372-7963 (CA) 307 739-1296 (Jackson Hole)  
interglobal space lines  * 307 733-1715 (Fax) http://www.interglobal.org 

"Extraordinary launch vehicles require extraordinary markets..."
Replace first . with @ and throw out the "@trash." to email me.  
Here's my email address for autospammers: [EMAIL PROTECTED]

------------------------------

Date: Sun, 27 May 2001 23:23:20 +0200
From: hihihi <[EMAIL PROTECTED]>
Crossposted-To: alt.linux,aus.computers.linux,comp.os.linux.setup
Subject: Re: howto move the errors from gcc to a file?

David. E. Goble wrote:

> Hi all;
> 
> I am just beginning to try programming in linux (redhat).
> 
> My problem is when I use gcc ...etc it produces a scolling list of
> errors. How can I move or pipe the errors to a file. ie something like
> 
>       gcc -o hello.c > error.txt?

gcc -o hello hello.c 2>&1 | tee error.txt

This way you get the text on screen and in the error.txt text file.


------------------------------

From: [EMAIL PROTECTED] (Charles Wilkins)
Subject: gdb warning
Date: Sun, 27 May 2001 22:10:27 GMT
Reply-To: [EMAIL PROTECTED]

Hi all,

When i run gdb, I get warning: unable to find dynamic linker
breakpoint function.
GDB will be unable to debug shared library initializers and track
explicitly loaded dynamic code.

I have installed the latest gdb and gcc.

Minimally, to duplicate this error, I compile with:
g++ -g test.cpp

Then to debug, I run:
gdb a.out

In the debugger when I try to run, is when I get the error.

Anybody care to point out what the cause of this is ?

Thanks in advance for a prompt reply.

Best regards,
Charles Wilkins

------------------------------

From: David Welch <[EMAIL PROTECTED]>
Subject: Generating dependencies
Date: Sun, 27 May 2001 22:22:55 +0000 (UTC)

Hi,

I know this isn't linux specific but I couldn't find a make newsgroup.
I have a project whose makefile which generates dependencies so both
the file which holds the dependencies (and is included from the makefile)
and the source file have as prerequisities the source file and the files
it includes. This works quite well when header files are updated since
dependencies are rebuilt automatically but when a header file is deleted
the make fails since one of the prerequisites for the file holding the
dependencies is missing. Is there some way to tell make to ignore that
the prerequisites when they don't exist but still check if they have
been changed? Or is there some other approach?

Thanks,
David Welch

------------------------------

From: Daniel Barron <[EMAIL PROTECTED]>
Subject: Re: A linuxthreads C++ object question
Date: Mon, 28 May 2001 00:52:05 GMT

In message <[EMAIL PROTECTED]>
          [EMAIL PROTECTED] (David Konerding) wrote:
[snip]
> I certainly would not want to have to do a lock or mutex around every
> string I construct or stream I access.  

Even if the above is not correct, the whole linux multithreading 'thing'
seems like quite a mess.  One needs to be too careful with the standard
libraries to get anything stable and reliable.  Multithreads on linux seems
fine, but the support in standard libraries is just not there yet :(

With all this hassle, I think I'm going to go for a pool of forks and
communicate with IPC.  OK, I'll not perform as well upon a sudden increase
of requests, but at-least it'll be more relable!  Especially with problems
such as one bad error in one thread killing the whole app rather than just
the process.

I can see, on the face of it, linuxthreads seem easier than IPC and forks,
but I think it's more difficult to write something reliable.

What do you(p) think?

BTW, thanks for all the help people.


-- 
Daniel Barron - use [at jadeb.com] for personal replys.


------------------------------

From: [EMAIL PROTECTED] (charles guo)
Subject: about struct file_operations?
Date: 27 May 2001 19:12:56 -0700

i find file_operations define as

struct file_operations {
        struct module *owner;
        loff_t (*llseek) (struct file *, loff_t, int);
        ssize_t (*read) (struct file *, char *, size_t, loff_t *);
        ssize_t (*write) (struct file *, const char *, size_t, loff_t *);
        int (*readdir) (struct file *, void *, filldir_t);
        unsigned int (*poll) (struct file *, struct poll_table_struct *);
        int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long
);
        int (*mmap) (struct file *, struct vm_area_struct *);
        int (*open) (struct inode *, struct file *);
        int (*flush) (struct file *);
        int (*release) (struct inode *, struct file *);
        int (*fsync) (struct file *, struct dentry *, int datasync);
        int (*fasync) (int, struct file *, int);
        int (*lock) (struct file *, int, struct file_lock *);
        ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, lo
ff_t *);
        ssize_t (*writev) (struct file *, const struct iovec *, unsigned long, l
off_t *);

but i do not know why use it like this:
static struct file_operations proc_bus_pci_operations = {
        proc_bus_pci_lseek,
        proc_bus_pci_read,
        proc_bus_pci_write,
        NULL,           /* readdir */
        NULL,           /* poll */
        NULL,           /* ioctl */
        NULL,           /* mmap */
        NULL,           /* no special open code */
        NULL,           /* flush */
        NULL,           /* no special release code */
        NULL            /* can't fsync */
};

------------------------------

From: goble@gtech (David. E. Goble)
Crossposted-To: alt.linux,aus.computers.linux,comp.os.linux.setup
Subject: Help with tinycobol
Date: Mon, 28 May 2001 02:28:29 GMT
Reply-To: goble@gtech

Hi All;

Iam running redhat 6.2 (server install).

I found tinycobol-0_51-1_libc5_i386.rpm on tuscow.

But when I try to compile one of the test.codes, this happens;

############ job1.run.err.trace.txt ###################

Processing compiler parameters
Cannot spawn
"/usr/local/src/redhat/BUILD/tinycobol-0.51/cobpp/htcobolpp": execv
failed!
error: pre-processor return status=512, ... aborting
Assembler messages:
Error: Can't open job1.s for reading.
job1.s: No such file or directory
make: *** [job1.o] Error 1

Earlier I had similar problems with htcobol, it had htcobol in
/usr/local/bin and had cobopt in /usr/local/share/htcobol. I had to cp
one to the other. I ended up cp each to the other.

can anyone help please, I would really would like to move my cobol
programming from win95 Microfoucus personnal to linux.

------------------------------

From: Etienne Maitre <[EMAIL PROTECTED]>
Subject: What widget could be read/written easily?
Date: Mon, 28 May 2001 11:35:05 +0900

Hi
I have a problem using GDK. I need to easily use the drawing primitive of a drawing 
area (line, rectangle, pixel, ...) but I need to read easilly the color of a specified 
pixel. GdkPixmap is perfect for the first need but can't do the second. Whereas 
gdkImage is perfect for the second but can't do the first. I'm a newbie in that field 
(I miss my Delphi on this problem) and I can't figure out a solution.
Thanks

Etienne

PS: I have already sent this message but due a a mistake of mine, it appeared as an 
answer to another question. So I don't know if it has been read by people who know the 
answer to my question. Sorry about that.

------------------------------

From: Christopher Fairbairn <[EMAIL PROTECTED]>
Subject: Re: about struct file_operations?
Date: Mon, 28 May 2001 14:59:18 +1200

charles guo wrote:

> i find file_operations define as
> 
> struct file_operations {
>       <SNIP>
> };
>
> but i do not know why use it like this:
>
> static struct file_operations proc_bus_pci_operations = {
>         proc_bus_pci_lseek,
>         proc_bus_pci_read,
>         proc_bus_pci_write,
>         NULL,           /* readdir */
>         NULL,           /* poll */
>         NULL,           /* ioctl */
>         NULL,           /* mmap */
>         NULL,           /* no special open code */
>         NULL,           /* flush */
>         NULL,           /* no special release code */
>         NULL            /* can't fsync */
> };

Certain filesystem drivers don't need certain functions to be produced 
because they can use the default versions which are provided by the VFS 
layer of the kernel.

If the VFS layer can't execute a function provided by the function pointer 
in this struct (i.e. if it is null). The VFS layer will usually use a 
version which it provides.....

As the comments say, this filesystem can't fsync, so there is no need to 
provide such a function to perform special actions when this request is 
made....

>From my knowledge of the /proc filesystem I know that this file_operations 
struct is only associated with files (i.e. not directories), because of 
this there is no need to define a function to read the assoicated directory 
entries, because there can't be any directory entries assocated with a file.

If this wasn't what you where trying to point out, ask again...

Hope it helps,
Christopher Fairbairn.

------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list by posting to the
comp.os.linux.development.apps newsgroup.

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Development-Apps Digest
******************************

Reply via email to