473,729 Members | 2,235 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

compiling problems

Good day Everyone,

I am a still very new at learning C and I have thrown myself in the
deep end. I started with a simple program and kept widening the scope.
This has taught me many things about C and some, I must admit, have not
really sunk in yet. Still, I push on. Now I am taken a library of C
programs that were designed to read HDF files. I work on a Unix server
and in Mandrake10. The program below is most likely broken but I cannot
solve any problem unitl I get pass my current problem in compiling. All
the codes that I need: *.c and *.h are located in directory given in
the compilation command:

cc -g msgpps_function s.c -I/data/proj/safworks/MSG_PPS_COMP/c_codes

And I get the following oputput that baffles me:

/home/tmp/ccAn0IYi.o(.tex t+0x67f): In function `readHDF':
/data/proj/safworks/MSG_PPS_COMP/c_codes/msgpps_function s.c:197:
undefined reference to `initHlHdf'
/home/tmp/ccAn0IYi.o(.tex t+0x694):/data/proj/safworks/MSG_PPS_COMP/c_codes/msgpps_function s.c:201:
undefined reference to `readHL_NodeLis t'
/home/tmp/ccAn0IYi.o(.tex t+0x6cc):/data/proj/safworks/MSG_PPS_COMP/c_codes/msgpps_function s.c:207:
undefined reference to `selectNode'
/home/tmp/ccAn0IYi.o(.tex t+0x6fc):/data/proj/safworks/MSG_PPS_COMP/c_codes/msgpps_function s.c:212:
undefined reference to `fetchMarkedNod es'
/home/tmp/ccAn0IYi.o(.tex t+0x70d):/data/proj/safworks/MSG_PPS_COMP/c_codes/msgpps_function s.c:214:
undefined reference to `getNode'
/home/tmp/ccAn0IYi.o(.tex t+0x87b):/data/proj/safworks/MSG_PPS_COMP/c_codes/msgpps_function s.c:243:
undefined reference to `freeHL_NodeLis t'
collect2: ld returned 1 exit status

Now, I have included the code but not the dependencies -- thought that
that would be too much. I would really like to know why this
compilation problem arose. All of the functions mentioned above are
declared in one or another of the dependencies in the path given and
the #include files.

Appreciate the help,

Sheldon

*************** *************** *************** *************** *************** *************** ****
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <read_vhlhdf. h>
#include <read_hlhdf.h >
#include <hlhdf.h>
#include <sys/types.h>
#include <dirent.h>
#include <vhlhdf.h>

#define ROW 1215
#define COL 1215
#define Auxdatadir "/data/proj/safworks/sheldon/MSG_PPS_COMP/data/aux/"
#define Region "ibla_57n20 e"
#define Date 200512

static int inithdf = 1; // Är 1 om initHlHdf ej har anropats, 0
annars. This routine must be run
int readHDF(float** , char *hdfname, char *fieldname);

// Variable Declaration
char Filename[] =
"/data/proj/safworks/sheldon/MSG_PPS_COMP/data/aux/test_array.dat" ;
char Reprodir[100];
char Physdata[100];
//*************** *************** *************** *************** *************** *************** ***************
struct hdfstruct {
float** latitude;
float** longitude;
float** landuse;
float** fractofland;
float** sunangle;
float** viewingangle;
};

int main(void) {

struct hdfstruct hdfdata;
FILE *fp = NULL;
double** array;
int i, j, num, stat;
int dataprecision = 4;
unsigned char** tmp;
double count;
char* strp;
char Latfile[150];
char Lonfile[150];
char hdfname[] =
"/data/proj/safworks/pps_v11/import/AUX_data/remapped/physiography.ib la_35n00e.hdf";
char latfile[150];
// Putting the file strings together for lat and long files
strcpy(Latfile, Auxdatadir);
strcat(Latfile, Region);
strcat(Latfile, "_lat.data" );
strcpy(Lonfile, Auxdatadir);
strcat(Lonfile, Region);
strcat(Lonfile, "_lon.data" );
strcpy(latfile, Auxdatadir);
strcat(latfile, Region);
strcat(latfile, "_latlon.h5 ");

printf("\n%s\n\ n", Latfile);
printf("%s\n\n" , Lonfile);

// allocate memory with error checking for lon and lat files
hdfdata.latitud e = calloc(ROW,size of(float *));
hdfdata.longitu de = calloc(ROW,size of(float *));
hdfdata.landuse = calloc(ROW,size of(float *));
hdfdata.fractof land = calloc(ROW,size of(float *));
hdfdata.sunangl e = calloc(ROW,size of(float *));
hdfdata.viewing angle = calloc(ROW,size of(float *));

if(hdfdata.lati tude == NULL ||
hdfdata.longitu de == NULL ||
hdfdata.landuse == NULL ||
hdfdata.fractof land == NULL ||
hdfdata.sunangl e == NULL ||
hdfdata.viewing angle == NULL) { // Memory for the ROWS
fprintf(stderr, "Failed to allocate memory");
return EXIT_FAILURE;
}
for (i = 0; i < ROW; i++) {
hdfdata.latitud e[i] = calloc(COL,size of(float));
hdfdata.longitu de[i] = calloc(COL,size of(float));
hdfdata.landuse[i] = calloc(COL,size of(float));
hdfdata.fractof land[i] = calloc(COL,size of(float));
hdfdata.sunangl e[i] = calloc(COL,size of(float));
hdfdata.viewing angle[i] = calloc(COL,size of(float));
if(hdfdata.lati tude == NULL ||
hdfdata.longitu de == NULL ||
hdfdata.landuse == NULL ||
hdfdata.fractof land == NULL ||
hdfdata.sunangl e == NULL ||
hdfdata.viewing angle == NULL) { // Memory for the COLS
fprintf(stderr, "Failed to allocate memory");
return EXIT_FAILURE;
}
}
// Reading the hdf data into the arrays
stat = readHDF(hdfdata .latitude,latfi le,"/LAT");
if (stat == 0) {
fprintf(stderr, "Failed reading latitude hdf");
return EXIT_FAILURE;
}

if((tmp=calloc( ROW,sizeof(floa t *))) == NULL) { // Memory for the
ROWS
fprintf(stderr, "Failed to allocate memory");
return EXIT_FAILURE;
}

for (i = 0; i < ROW; i++) {
if((tmp[i]=calloc(COL,siz eof(float))) == NULL) { // Memory for the
COLS
fprintf(stderr, "Failed to allocate memory");
return EXIT_FAILURE;
}
}

// Opening and reading lon and lat files
printf("Opening lat file: %s\n",Latfile);
if ((fp = fopen(Latfile, "rb")) == NULL) {
fprintf(stderr, "Error opening file %s in read mode.\n", Latfile);
fclose(fp);
goto fail;
}
else
printf("File opened successfully.\n \n");

printf("Reading said file.\n\n");
if (ROW*COL*4 != fread(tmp, sizeof(unsigned char), ROW*COL*4, fp)) {
fprintf(stderr, "Error reading file: %s\n", Latfile);
fclose(fp);
goto fail;
}
else {
printf("File read successfully.\n \n");
fclose(fp);
}

// allocate memory with error checking test array
if((array=callo c(ROW,sizeof(do uble *))) == NULL) { // Memory for the
ROWS
fprintf(stderr, "Failed to allocate memory");
return EXIT_FAILURE;
}

for (i = 0; i < ROW; i++) {
if((array[i]=calloc(COL,siz eof(double))) == NULL) { // Memory for
the COLS
fprintf(stderr, "Failed to allocate memory");
return EXIT_FAILURE;
}
}

// display read array for debuging
printf("Printin g array\n");
for (i = 0; i < 5; i++) {
printf("latitud es[%d,%d] = \t%f\n", i,j, hdfdata.latitud e[i,j]);
}

fail:
if(array) {
for (i = 0; i < ROW; i++) {
free(array[i]);
}
free(array);
}
return EXIT_FAILURE;
}

int readHDF(float **arp, char *hdfname, char *fieldname) {

HL_NodeList *nodelist = NULL; // These are take from read_vlhdf.h
where some explanation is given
HL_Node *cloudproduct; // These are pointers to structures
HL_Node *dataset;
HL_CompoundType Attribute *attr; // pointer to structure
int i, xsize, ysize;
int dataprecision = sizeof(float);

if (inithdf) {
initHlHdf();
inithdf = 0;
}

nodelist = readHL_NodeList (hdfname);
if (!nodelist) {
fprintf(stderr, "Error reading hdf-file: %s\n", hdfname);
goto error;
}

if (!selectNode(no delist, fieldname)) {
fprintf(stderr, "Dataset in %s was not found in %s.\n",fieldnam e,
hdfname);
goto error;
}

fetchMarkedNode s(nodelist); // gets the data from selected dataset

cloudproduct = getNode(nodelis t, fieldname);

if (!cloudproduct) {
fprintf(stderr, "Error reading data from %s\n", hdfname);
goto error;
}
for (i = 0; i < cloudproduct->compoundDescri ption->nAttrs; i++) {
attr = cloudproduct->compoundDescri ption->attrs[i];
if(0 == strcmp(attr->attrname, "xsize")) {
xsize = *((int *)&cloudproduc t->data[attr->offset]);
} else if (0 == strcmp(attr->attrname,"ysiz e")) { // checking to
see if there is such an attribute
ysize = *((int *)&cloudproduc t->data[attr->offset]); // casting
from binary to int
}
}

if (xsize != COL || ysize != ROW) {
if (xsize <= 0 || ysize <= 0) {
fprintf(stderr, "Error: hdf-file has undefined size.\n");
goto error;
} else {
fprintf(stderr,
"Warning: hdf-file has unexpected size: %d×%d\n",
xsize, ysize);
}
}

memcpy(arp, cloudproduct->data, ROW * COL * dataprecision); // This
converts the data from binary to float

error: {
if (nodelist) freeHL_NodeList (nodelist);
if (arp) free(arp);
return (0);
}
return (1);
}

Oct 28 '06 #1
9 2197
Sheldon wrote:
Good day Everyone,

I am a still very new at learning C and I have thrown myself in the
deep end. I started with a simple program and kept widening the scope.
This has taught me many things about C and some, I must admit, have not
really sunk in yet. Still, I push on. Now I am taken a library of C
programs that were designed to read HDF files. I work on a Unix server
and in Mandrake10. The program below is most likely broken but I cannot
solve any problem unitl I get pass my current problem in compiling. All
the codes that I need: *.c and *.h are located in directory given in
the compilation command:

cc -g msgpps_function s.c -I/data/proj/safworks/MSG_PPS_COMP/c_codes

And I get the following oputput that baffles me:

/home/tmp/ccAn0IYi.o(.tex t+0x67f): In function `readHDF':
/data/proj/safworks/MSG_PPS_COMP/c_codes/msgpps_function s.c:197:
undefined reference to `initHlHdf'
/home/tmp/ccAn0IYi.o(.tex t+0x694):/data/proj/safworks/MSG_PPS_COMP/c_codes/msgpps_function s.c:201:
undefined reference to `readHL_NodeLis t'
/home/tmp/ccAn0IYi.o(.tex t+0x6cc):/data/proj/safworks/MSG_PPS_COMP/c_codes/msgpps_function s.c:207:
undefined reference to `selectNode'
/home/tmp/ccAn0IYi.o(.tex t+0x6fc):/data/proj/safworks/MSG_PPS_COMP/c_codes/msgpps_function s.c:212:
undefined reference to `fetchMarkedNod es'
/home/tmp/ccAn0IYi.o(.tex t+0x70d):/data/proj/safworks/MSG_PPS_COMP/c_codes/msgpps_function s.c:214:
undefined reference to `getNode'
/home/tmp/ccAn0IYi.o(.tex t+0x87b):/data/proj/safworks/MSG_PPS_COMP/c_codes/msgpps_function s.c:243:
undefined reference to `freeHL_NodeLis t'
collect2: ld returned 1 exit status

Now, I have included the code but not the dependencies -- thought that
that would be too much. I would really like to know why this
compilation problem arose. All of the functions mentioned above are
declared in one or another of the dependencies in the path given and
the #include files.
[...]
The #include files contain declarations of the functions
you're trying to use, but almost certainly don't contain the
actual "meat" of those functions. The actual implementations
of the functions are probably found in a library that is part
of this HDF package you've acquired. The declarations in the
#include files describe selectNode() et al. so that you can
compile the various modules of your program, but when you link
the compiled modules together you must tell the linker where
it can find those external functions. You probably need to add
something to the compiler's command line to inform it where the
function bodies can be found; it might be as simple as "-lhdf"
or it might be more involved. Check the documentation for the
HDF package and for your compiler.

It's really the same with the standard C library functions:
If you look inside the <stdio.hfile you will find descriptions
of printf() and fclose() and so on, but not the actual bodies of
those functions. They come from "elsewhere, " but since these
are "standard" functions intended to be available to all C
programs, the C compiler and linker already know where to look
for them and don't need to be told. Your HDF package is an add-
on of some kind, and the compiler needs to be told about it.

--
Eric Sosman
es*****@acm-dot-org.invalid
Oct 28 '06 #2
Sheldon wrote:
Good day Everyone,

I am a still very new at learning C and I have thrown myself in the
deep end. I started with a simple program and kept widening the scope.
This has taught me many things about C and some, I must admit, have not
really sunk in yet. Still, I push on. Now I am taken a library of C
programs that were designed to read HDF files. I work on a Unix server
and in Mandrake10. The program below is most likely broken but I cannot
solve any problem unitl I get pass my current problem in compiling. All
the codes that I need: *.c and *.h are located in directory given in
the compilation command:

cc -g msgpps_function s.c -I/data/proj/safworks/MSG_PPS_COMP/c_codes

And I get the following oputput that baffles me:

/home/tmp/ccAn0IYi.o(.tex t+0x67f): In function `readHDF':
/data/proj/safworks/MSG_PPS_COMP/c_codes/msgpps_function s.c:197:
undefined reference to `initHlHdf'
<snip>
collect2: ld returned 1 exit status

Now, I have included the code but not the dependencies -- thought that
that would be too much. I would really like to know why this
compilation problem arose. All of the functions mentioned above are
declared in one or another of the dependencies in the path given and
the #include files.
Your compilation succeeded. Look at the error message closely, and
you'll see that the error is with ld. So your code compiled okay, but
the link step failed. If you have code for all of the functions, say
in
a file named foo.c, then you can probably build an executable
by simply addind foo.c as an argument to the compile line. That
is less appropriate than building libfoo.a and using "-lfoo" to
tell the linker about the other functions.

Including a declaration in a header file allowed your compilation
to succeed. Now you just to tell the linker where to find the
code.

--
Bill Pursell

Oct 28 '06 #3

Bill Pursell skrev:
Sheldon wrote:
Good day Everyone,

I am a still very new at learning C and I have thrown myself in the
deep end. I started with a simple program and kept widening the scope.
This has taught me many things about C and some, I must admit, have not
really sunk in yet. Still, I push on. Now I am taken a library of C
programs that were designed to read HDF files. I work on a Unix server
and in Mandrake10. The program below is most likely broken but I cannot
solve any problem unitl I get pass my current problem in compiling. All
the codes that I need: *.c and *.h are located in directory given in
the compilation command:

cc -g msgpps_function s.c -I/data/proj/safworks/MSG_PPS_COMP/c_codes

And I get the following oputput that baffles me:

/home/tmp/ccAn0IYi.o(.tex t+0x67f): In function `readHDF':
/data/proj/safworks/MSG_PPS_COMP/c_codes/msgpps_function s.c:197:
undefined reference to `initHlHdf'
<snip>
collect2: ld returned 1 exit status

Now, I have included the code but not the dependencies -- thought that
that would be too much. I would really like to know why this
compilation problem arose. All of the functions mentioned above are
declared in one or another of the dependencies in the path given and
the #include files.

Your compilation succeeded. Look at the error message closely, and
you'll see that the error is with ld. So your code compiled okay, but
the link step failed. If you have code for all of the functions, say
in
a file named foo.c, then you can probably build an executable
by simply addind foo.c as an argument to the compile line. That
is less appropriate than building libfoo.a and using "-lfoo" to
tell the linker about the other functions.

Including a declaration in a header file allowed your compilation
to succeed. Now you just to tell the linker where to find the
code.

--
Bill Pursell
Thanks Guys,

Now I have a direction, at least.
I have to look at the Makefile and see if I can figure out how to use
it.
Unfortunately, the documentation is very poor and almost non-existent.

/Sheldon

Oct 28 '06 #4
Sheldon wrote:
>
I am a still very new at learning C and I have thrown myself in
the deep end. I started with a simple program and kept widening
the scope. This has taught me many things about C and some, I must
admit, have not really sunk in yet. Still, I push on. Now I am
taken a library of C programs that were designed to read HDF files.
I work on a Unix server and in Mandrake10. The program below is
most likely broken but I cannot solve any problem unitl I get pass
my current problem in compiling. All the codes that I need: *.c
and *.h are located in directory given in the compilation command:

cc -g msgpps_function s.c -I/data/proj/safworks/MSG_PPS_COMP/c_codes
.... snip ...
>
Now, I have included the code but not the dependencies -- thought
that that would be too much. I would really like to know why this
compilation problem arose. All of the functions mentioned above
are declared in one or another of the dependencies in the path
given and the #include files.

*************** *************** *************** *************** *****
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
To start with, all the following #includes are non-standard and
unknown to us. We deal only with standard C here.
#include <read_vhlhdf. h>
#include <read_hlhdf.h >
#include <hlhdf.h>
#include <sys/types.h>
#include <dirent.h>
#include <vhlhdf.h>

#define ROW 1215
#define COL 1215
#define Auxdatadir "/data/proj/safworks/sheldon/MSG_PPS_COMP/data/aux/"
#define Region "ibla_57n20 e"
#define Date 200512

static int inithdf = 1; // Är 1 om initHlHdf ej har anropats, 0
annars. This routine must be run
This illustrates why you should not use // comments in any code
posted to the newsgroup. First, it wraps, and becomes invalid
source. Second, it is not even a legal comment in the most
portable C systems, such as those that adhere to the C90 standard.

Just use proper /* .... */ comments.
int readHDF(float** , char *hdfname, char *fieldname);

// Variable Declaration
char Filename[] =
"/data/proj/safworks/sheldon/MSG_PPS_COMP/data/aux/test_array.dat" ;
char Reprodir[100];
char Physdata[100];
//*************** *************** *************** *************** *************** *************** ***************
Also, to avoid line wrap in usenet, limit your line length to 72
chars. 65 is better.
struct hdfstruct {
float** latitude;
float** longitude;
float** landuse;
float** fractofland;
float** sunangle;
float** viewingangle;
};

int main(void) {
.... snip code ...

I suggest you follow the above suggestions and repost. In general
you should avoid creating routines that are too long. Break your
system down into simpler functions that do simple things, and
return information.

When you have something that can be compiled with:

gcc -W -Wall -ansi -pedantic

you are most of the way there. Read the links below.

--
Some informative links:
<news:news.anno unce.newusers
<http://www.geocities.c om/nnqweb/>
<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html >
<http://www.netmeister. org/news/learn2quote.htm l>
<http://cfaj.freeshell. org/google/>
Oct 28 '06 #5

CBFalconer skrev:
Sheldon wrote:

I am a still very new at learning C and I have thrown myself in
the deep end. I started with a simple program and kept widening
the scope. This has taught me many things about C and some, I must
admit, have not really sunk in yet. Still, I push on. Now I am
taken a library of C programs that were designed to read HDF files.
I work on a Unix server and in Mandrake10. The program below is
most likely broken but I cannot solve any problem unitl I get pass
my current problem in compiling. All the codes that I need: *.c
and *.h are located in directory given in the compilation command:

cc -g msgpps_function s.c -I/data/proj/safworks/MSG_PPS_COMP/c_codes
... snip ...

Now, I have included the code but not the dependencies -- thought
that that would be too much. I would really like to know why this
compilation problem arose. All of the functions mentioned above
are declared in one or another of the dependencies in the path
given and the #include files.

*************** *************** *************** *************** *****
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>

To start with, all the following #includes are non-standard and
unknown to us. We deal only with standard C here.
#include <read_vhlhdf. h>
#include <read_hlhdf.h >
#include <hlhdf.h>
#include <sys/types.h>
#include <dirent.h>
#include <vhlhdf.h>

#define ROW 1215
#define COL 1215
#define Auxdatadir "/data/proj/safworks/sheldon/MSG_PPS_COMP/data/aux/"
#define Region "ibla_57n20 e"
#define Date 200512

static int inithdf = 1; // Är 1 om initHlHdf ej har anropats, 0
annars. This routine must be run

This illustrates why you should not use // comments in any code
posted to the newsgroup. First, it wraps, and becomes invalid
source. Second, it is not even a legal comment in the most
portable C systems, such as those that adhere to the C90 standard.

Just use proper /* .... */ comments.
int readHDF(float** , char *hdfname, char *fieldname);

// Variable Declaration
char Filename[] =
"/data/proj/safworks/sheldon/MSG_PPS_COMP/data/aux/test_array.dat" ;
char Reprodir[100];
char Physdata[100];
//*************** *************** *************** *************** *************** *************** ***************

Also, to avoid line wrap in usenet, limit your line length to 72
chars. 65 is better.
struct hdfstruct {
float** latitude;
float** longitude;
float** landuse;
float** fractofland;
float** sunangle;
float** viewingangle;
};

int main(void) {
... snip code ...

I suggest you follow the above suggestions and repost. In general
you should avoid creating routines that are too long. Break your
system down into simpler functions that do simple things, and
return information.

When you have something that can be compiled with:

gcc -W -Wall -ansi -pedantic

you are most of the way there. Read the links below.

--
Some informative links:
<news:news.anno unce.newusers
<http://www.geocities.c om/nnqweb/>
<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html >
<http://www.netmeister. org/news/learn2quote.htm l>
<http://cfaj.freeshell. org/google/>
Thanks! Your advice is really helpful. I need to find out from where
some of the dependent files are located before I can continue with
this. Will "clean up" my code.

/Sheldon

Oct 28 '06 #6
In article <45************ ***@yahoo.com>,
CBFalconer <cb********@mai neline.netwrote :
....
>To start with, all the following #includes are non-standard and
unknown to us. We deal only with standard C here.
The really funny part is that, in any other newsgroup, if people posted
responses that said "I don't understand; I have no idea what you're
talking about; I can't help you.", it would be considered the ultimate
in ridiculous and people would, quite rightly, wonder what the poster
was smoking.

Yet, here, for some reason, it is not only acceptable, but common.
gcc -W -Wall -ansi -pedantic
The usual crippleware options.

Oct 28 '06 #7

Kenny McCormack skrev:
In article <45************ ***@yahoo.com>,
CBFalconer <cb********@mai neline.netwrote :
...
To start with, all the following #includes are non-standard and
unknown to us. We deal only with standard C here.

The really funny part is that, in any other newsgroup, if people posted
responses that said "I don't understand; I have no idea what you're
talking about; I can't help you.", it would be considered the ultimate
in ridiculous and people would, quite rightly, wonder what the poster
was smoking.

Yet, here, for some reason, it is not only acceptable, but common.
gcc -W -Wall -ansi -pedantic

The usual crippleware options.
I put together a make file and found out where some of my dependent
files are placed. after some work, it worked smoothly.
Still - and this might sound really silly but here goes - what does the
options -W and -Wall mean?
I looked these up but it does not seem to be a part of cc. Is unigue to
gcc?

Oct 30 '06 #8
"Sheldon" <sh******@gmail .comwrites:
[...]
>In article <45************ ***@yahoo.com>,
CBFalconer <cb********@mai neline.netwrote :
[...]
gcc -W -Wall -ansi -pedantic
[...]
>
I put together a make file and found out where some of my dependent
files are placed. after some work, it worked smoothly.
Still - and this might sound really silly but here goes - what does the
options -W and -Wall mean?
I looked these up but it does not seem to be a part of cc. Is unigue to
gcc?
"cc" is a common name for C compilers in general, particularly on
Unix-like systems. We can't guess which compiler you're referring to.
On some systems, "cc" is an alias for "gcc".

Yes, all the options "-W", "-Wall", "-ansi", and "-pedantic" are
specific to gcc. Some compilers may have options with the same name;
they're likely to mean the same thing *if* they're copied from gcc,
otherwise they could have some different meaning.

<OT>
In gcc, "-W" and "-Wall" enable certain sets of warning messages,
"-ansi" tells it to conform to the C90 standard, and "-pedantic" tells
it to be more diligent about reporting certain errors. See the gcc
documentation for details (you should be able to find it on the web).
</OT>

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Oct 30 '06 #9
Keith Thompson said:

<snip>
<OT>
In gcc, "-W" and "-Wall" enable certain sets of warning messages,
"-ansi" tells it to conform to the C90 standard, and "-pedantic" tells
it to be more diligent about reporting certain errors. See the gcc
documentation for details (you should be able to find it on the web).
The traditional (but non-canonical) interpretations are:

-W : give me all the warnings please
-Wall : no, ALL the warnings please
-ansi : no really, I honestly want ALL the warnings
-pedantic: yeah, AND the rest
-Wformat-nonliteral -Wcast-align -Wpointer-arith -Wbad-function-cast
-Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Winline
-Wundef -Wnested-externs -Wcast-qual -Wshadow -Wconversion -Wwrite-strings
-Wno-conversion -ffloat-store -O2 : look, I really mean it, okay?
</OT>
Um, quite so.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Oct 30 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
6909
by: Andres Rosado-Sepulveda | last post by:
Hello, I'm having trouble compiling PHP 4.3.4 on Solaris 8. This is the error message it is showing: -- start -- Undefined first referenced symbol in file php_parse_date ext/standard/datetime.o ld: fatal: Symbol referencing errors. No output written to sapi/cli/php
11
3199
by: Arturo DiDonna | last post by:
Hello everyone. I am trying to compile someone else code and I am stuck with compilation problems using the g++ 3.3 compiler. Basically, when compiling the following code, I get this error message: parsefcns.cc: In function `void get_token(std::ifstream*, char**)': parsefcns.cc:57: error: cannot convert `std::basic_string<char, std::char_traits<char>, std::allocator<char> >' to `char*' in assignment make: *** Error 1
0
3066
by: David W. Fenton | last post by:
Today I was working on a hideous old app that I created a long time ago that does a lot of showing/hiding/resizing of fields on one of the forms. I had used constants to store reference values for many of the top/height/left settings. I noticed that some of the constants were defined by using other constant values, and I was impressed that VBA could do that. Here's an example: Const row1Top = 1.0208 * 1440 ' top of first row Const...
4
1693
by: -Michelle- | last post by:
Hi I am using A2003 on XP. The client has A2000. So I have ensured that I have developed based on A2000 and compiled as such. I have found that in a number of cases now, I have used (what I thought) was fairly standard methods & properties, but as it turns out, not so. I install on the client's machine and recompile and have found that a method is just not recognised in A2000. eg: in A2003, docmd.OpenReport includes the 'OpenArgs'...
3
4984
by: Dmitri Shvetsov | last post by:
Hi All, Did somebody have a problem compiling some solution in VS2003? I get the error every time that some files are locked and are using by another process. I repeat compiling again and again and finally the compilation can be finished successfully after several tries. What can be a reason of that? I turned off my antivirus software, no results. Maybe it's just a bug of the VS2003? I installed the latest service pack for the Studio...
2
2123
by: Erik | last post by:
Hi Everyone, I'm having real problems compiling some source for eVC4++. The errors I am getting are below: It all seems to be centred around winsock. If I move the afsock.h reference to before my other includes then I get lots of errors like C2011: 'fd_set' : 'struct' type redefinition warning C4005: 'FD_CLR' : macro redefinition which I understand are due to the fact that windows.h is being included in another header file as well as...
3
2332
by: Ryan Riehle | last post by:
Hi All! Trying to upgrade to Apache 2.0.49 and getting compile errors related to mod_auth_pgsql, any clue?: make: Entering directory `/usr/src/httpd-2.0.49' /usr/src/httpd-2.0.49/srclib/apr/libtool --silent --mode=link gcc -pthread -I/ =500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DAP_HAVE_DESIGNATED_INITIALIZER I. -I/usr/src/httpd-2.0.49/os/unix -I/usr/src/httpd-2.0.49/server/mpm/prefork -I .49/modules/proxy
2
1543
by: nospam | last post by:
Hi Newbie asp questions: I have problems running new website when its uploaded. It compiles nicely when running on my local machine, but when compiling on the server i get the error:
0
1455
by: phoolimin | last post by:
Dear all, I am trying to embed python into another scripting language, to do this I need to solve a number of problems on importing or compiling python script. First let me state what exactly I want to do, that is, I want the following syntax to be supported in the host language which I am developing: ###################################################### # scripts in the host language
8
2203
by: WebSnozz | last post by:
I have an application written in C that does a lot of low level stuff. It does a lot of things like casting from void*'s. I want to create a new GUI for it in either C# or MC++, but reuse the existing code. The options I've considered so far: 1. Create a new MC++ GUI project and add the *.c files to them and mark them with pragma unamanged. However, the /clr option does not compile *.c files, so I rename them to *.cpp, and now they...
0
8761
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9280
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8144
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6016
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2162
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.