public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: More problems with make
       [not found] <616BE6A276E3714788D2AC35C40CD18D393FF1@whale.softwire.co.uk>
@ 2002-01-28 23:30 ` Rupert Wood
  0 siblings, 0 replies; 4+ messages in thread
From: Rupert Wood @ 2002-01-28 23:30 UTC (permalink / raw)
  To: kabir.patel; +Cc: gcc-help

Kabir Patel wrote:

> example1: $(HEADERS) $(OBJS) example1.c
>         $(GCC) example1.c $(OBJS) $(DBLIBS) $(CFLAGS) -o example1
:
> ./example1.c: static: not found
> ./example1.c: syntax error at line 13: `(' unexpected
> make: *** [example1] Error 2

Is the GCC environment variable set?

It looks like your source file is execute-permission-set and it's trying
to invoke it. # is the usual shell script comment, so the first line of
your source it tries to execute is the second - which starts with
'static'. Error 2 is the return code from the shell process - it may
mean something specific (check the sh manpage) but in this case it's
just important that it's non-zero, which means failure or 'false'.

Try 'make -n' to see what command it's actually trying to invoke or, if
it's GNU make,

    make --warn-undefined-variables

and then set the GCC variable if necessary, or change it to $(CC) or
similar.

Rup.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: More problems with make
       [not found] <616BE6A276E3714788D2AC35C40CD18D3942CA@whale.softwire.co.uk>
@ 2002-01-30  1:58 ` Rupert Wood
  0 siblings, 0 replies; 4+ messages in thread
From: Rupert Wood @ 2002-01-30  1:58 UTC (permalink / raw)
  To: kabir.patel; +Cc: gcc-help

Kabir Patel wrote:

> >>Is the GCC environment variable set?
> Before using my make file I run a "source source.me". The 
> source.me file has the following:
:
> Hence my environment variable for GCC must be set. (Is that right?)

Presumably yes, if you're using csh. You can test it with:

    echo $GCC

or with either of

    make -n
    make --warn-undefined-variables

as I suggested last time.

However, the error you got (which I can reproduce) is consistent with
the GCC environment variable *not* being set.

> >>It looks like your source file is execute-permission-set 
> >>and it's trying to invoke it.
> 
> What does that mean? Do I need to change the permissions so 
> that it is read and write only (using chmod)?

It's normal for C source not to be executable, yes, but it shouldn't
make a difference to the build process. I only mentioned it because you
would have seen a different error if it was not flagged executable.

Rup.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: More problems with make
@ 2002-01-30  1:49 kabir.patel
  0 siblings, 0 replies; 4+ messages in thread
From: kabir.patel @ 2002-01-30  1:49 UTC (permalink / raw)
  To: me; +Cc: gcc-help





>>Is the GCC environment variable set?

Before using my make file I run a "source source.me". The source.me file has the
following:

==============================
setenv PATH .:/usr/ucb:/bin:/usr/bin:/apps/restore/sybase_100/bin:/apps/restore/
sybase_100/install:/var/gnuc/usr/local/bin/:/export/home/kabir/make/make-3.79.1/
setenv CSRC /psd2hom/windev/csrc
setenv USER sa
setenv SYBASE /apps/restore/sybase_100
setenv GCC gcc
setenv CC gcc
==============================

Hence my environment variable for GCC must be set. (Is that right?)

>>It looks like your source file is execute-permission-set and it's trying
>>to invoke it.

What does that mean? Do I need to change the permissions so that it is read and
write only (using chmod)?

Any help would be appreciated.



*******************Internet Email Confidentiality Footer*******************


Privileged/Confidential Information may be contained in this message.  If you
are not the addressee indicated in this message (or responsible for delivery of
the message to such person), you may not copy or deliver this message to anyone.
In such case, you should destroy this message and kindly notify the sender by
reply email. Please advise immediately if you or your employer does not consent
to Internet email for messages of this kind.  Opinions, conclusions and other
information in this message that do not relate to the official business of my
firm shall be understood as neither given nor endorsed by it.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* More problems with make
@ 2002-01-28  8:10 kabir.patel
  0 siblings, 0 replies; 4+ messages in thread
From: kabir.patel @ 2002-01-28  8:10 UTC (permalink / raw)
  To: me; +Cc: velco, gcc-help




I have got my makefile to work correctly with some simple C. I have now got some
 more
complicated C code, that sends two queries to sybase SQL Server in a command
batch.  It binds each set
of results and prints the rows.

The code is syntactically correct.

I want to run make on my makefile so that it produces an "example1" exe. Now my
makefile
is as follows, and as far as I can see, it is correct:

===========================

#
# Comments
#

INCDIR = /d5/OCS-12_5/include
LIBDIR = /d5/OCS-12_5/lib
HEADERS = $(INCDIR)/sybfront.h \
        $(INCDIR)/sybdb.h
DBLIBS = $(LIBDIR)/libsybdb.a
OBJS = errhandler.o msghandler.o error.o \
        chkintr.o dberror.o handler.o hndlintr.o

INCLUDE = -I -I$(INCDIR) -I../include
CFLAGS = $(INCLUDE) -lm
OFLAGS = $(INCLUDE) -c

example1: $(HEADERS) $(OBJS) example1.c
        $(GCC) example1.c $(OBJS) $(DBLIBS) $(CFLAGS) -o example1


===========================

All the files for OBJS, HEADERS, INCDIR etc.. exist.

However, when I run make -f makefile it comes back with the following error
messages:

./example1.c: static: not found
./example1.c: syntax error at line 13: `(' unexpected
make: *** [example1] Error 2

Could somebody tell me:

a) What "static: not found" means?
b) What "Error 2" means?

Any additional info would be much appreciated.

===========================================
#if USE_SCCSID
static char Sccsid[] = {"@(#) example1.c 87.1 12/29/93"};
#endif

#include <stdio.h>
#include <sybfront.h>
#include <sybdb.h>
#include "sybdbex.h"

#define DATELEN     26
#define TYPELEN      2

int CS_PUBLIC   err_handler();
int CS_PUBLIC   msg_handler();

main(argc, argv)
int             argc;
char            *argv[];
{
     DBPROCESS     *dbproc;       /* Our connection with SQL Server. */
     LOGINREC      *login;        /* Our login information. */

     DBCHAR         crdate[DATELEN+1];
     DBINT          id;
     DBCHAR         name[DBMAXNAME+1];
     DBCHAR         type[TYPELEN+1];
     RETCODE        result_code;

     printf("Demo of SQL queries in a command batch\n\n");
     fflush(stdout);

     if (dbinit() == FAIL)
          exit(ERREXIT);

     dberrhandle((EHANDLEFUNC)err_handler);
     dbmsghandle((MHANDLEFUNC)msg_handler);

     login = dblogin();
     DBSETLUSER(login, USER);
     DBSETLPWD(login, PASSWORD);
     DBSETLAPP(login, "example1");

     dbproc = dbopen(login, NULL);

     dbcmd(dbproc, "select name, type, id, crdate from sysobjects");
     dbcmd(dbproc, " where type = 'S' ");
     dbcmd(dbproc, "select name, type, id, crdate from sysobjects");
     dbcmd(dbproc, " where type = 'P' ");

     dbsqlexec(dbproc);


     while ((result_code = dbresults(dbproc)) != NO_MORE_RESULTS)
     {
          if (result_code == SUCCEED)
          {
               /* Bind program variables. */

               dbbind(dbproc, 1, NTBSTRINGBIND, (DBINT)0,
                              (BYTE DBFAR *)name);
               dbbind(dbproc, 2, NTBSTRINGBIND, (DBINT)0,
                              (BYTE DBFAR *)type);
               dbbind(dbproc, 3, INTBIND, (DBINT)0, (BYTE *)&id);
               dbbind(dbproc, 4, NTBSTRINGBIND, (DBINT)0,
                              (BYTE DBFAR *)crdate);

               printf("\n %s Objects: \n\n",
               DBCURCMD(dbproc) == 1 ? "System Table": "Procedure");

               while (dbnextrow(dbproc) != NO_MORE_ROWS)
               {
                    if ((DBCURCMD(dbproc) == 2)
                         && (DBCURROW(dbproc) > 10))
                         continue;
                    printf
                         ("%s %s %d %s\n", name, type, id, crdate);
               }
          }
     }

     dbexit();
     exit(STDEXIT);
}

int CS_PUBLIC err_handler(dbproc, severity, dberr, oserr, dberrstr, oserrstr)
DBPROCESS       *dbproc;
int             severity;
int             dberr;
int             oserr;
char            *dberrstr;
char            *oserrstr;
{
     if ((dbproc == NULL) || (DBDEAD(dbproc)))
          return(INT_EXIT);
     else
     {
          fprintf (ERR_CH, "DB-Library error:\n\t%s\n", dberrstr);

          if (oserr != DBNOERR)
               fprintf (ERR_CH, "Operating-system error:\n\t%s\n", oserrstr);

          return(INT_CANCEL);
     }
}

int CS_PUBLIC msg_handler(dbproc, msgno, msgstate, severity, msgtext,
                srvname, procname, line)

DBPROCESS       *dbproc;
DBINT           msgno;
int             msgstate;
int             severity;
char            *msgtext;
char            *srvname;
char            *procname;
int       line;

{
     fprintf (ERR_CH, "Msg %d, Level %d, State %d\n",
             msgno, severity, msgstate);

     if (strlen(srvname) > 0)
          fprintf (ERR_CH, "Server '%s', ", srvname);
     if (strlen(procname) > 0)
          fprintf (ERR_CH, "Procedure '%s', ", procname);
     if (line > 0)
          fprintf (ERR_CH, "Line %d", line);

     fprintf (ERR_CH, "\n\t%s\n", msgtext);

     return(0);
}

=========================


*******************Internet Email Confidentiality Footer*******************


Privileged/Confidential Information may be contained in this message.  If you
are not the addressee indicated in this message (or responsible for delivery of
the message to such person), you may not copy or deliver this message to anyone.
In such case, you should destroy this message and kindly notify the sender by
reply email. Please advise immediately if you or your employer does not consent
to Internet email for messages of this kind.  Opinions, conclusions and other
information in this message that do not relate to the official business of my
firm shall be understood as neither given nor endorsed by it.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-01-30  9:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <616BE6A276E3714788D2AC35C40CD18D393FF1@whale.softwire.co.uk>
2002-01-28 23:30 ` More problems with make Rupert Wood
     [not found] <616BE6A276E3714788D2AC35C40CD18D3942CA@whale.softwire.co.uk>
2002-01-30  1:58 ` Rupert Wood
2002-01-30  1:49 kabir.patel
  -- strict thread matches above, loose matches on Subject: below --
2002-01-28  8:10 kabir.patel

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).