Skip to content

Include string.h in mPresentation.c to declare strcpy()#82

Open
olebole wants to merge 1 commit intoCaltech-IPAC:mainfrom
olebole:mpresentation-string-h
Open

Include string.h in mPresentation.c to declare strcpy()#82
olebole wants to merge 1 commit intoCaltech-IPAC:mainfrom
olebole:mpresentation-string-h

Conversation

@olebole
Copy link
Contributor

@olebole olebole commented Dec 20, 2024

Otherwise, one gets the error (with gcc-14)

gcc -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -I. -I../../Montage -I../../lib/include  -c  mPresentation.c
mPresentation.c: In function ‘main’:
mPresentation.c:54:4: error: implicit declaration of function ‘strcpy’ [-Wimplicit-function-declaration]
   54 |    strcpy(urlbase,  argv[1]);
      |    ^~~~~~
mPresentation.c:17:1: note: include ‘<string.h>’ or provide a declaration of ‘strcpy’
   16 | #include <strings.h>
  +++ |+#include <string.h>
   17 | 
mPresentation.c:54:4: warning: incompatible implicit declaration of built-in function ‘strcpy’ [-Wbuiltin-declaration-mismatch]
   54 |    strcpy(urlbase,  argv[1]);
      |    ^~~~~~
mPresentation.c:54:4: note: include ‘<string.h>’ or provide a declaration of ‘strcpy’
make[2]: *** [Makefile:23: mPresentation.o] Fehler 1

Closes: #79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mPresentation.c build issue

1 participant