Hi,
I got some C code files and I have written some C++ files as its wrapper. Now I'd like to create a library from all these C and C++ files. To generate .o files before archiving them into a .a file, should I gcc those .c files and g++ those .cc files separately, or just use either gcc or g++ for all .c and .cc files? If both gcc and g++ can successfully generate .o files, can these .o files be equally reliable for further use?
I also notice that if I g++ one of my .c files, I will get "error: invalid conversion from ‘void*’ to ‘LIST_NODE*’" kind of error at somewhere like "bktptr = bktptr->next;" where bktptr is of "LIST_NODE*" type, pointer to a sturcture.
Code:
typedef struct _list_node {
void *ptr;
void *next;
} LIST_NODE;
Should I therefore change "bktptr = bktptr->next;" to be "bktptr = (LIST_NODE*)bktptr->next;"? But if I gcc that .c file, there will be no error. I was wondering what is the actual difference between "gcc" and "g++", instead of gcc only .c and g++ only .cc, does it matter to mix somehow?
Thanks in advance!