-6

I'm having some trouble with C standard functions. As an example, I'm getting that error in the memcpy function, even passing the right arguments to it. I've included a header as #include "header.h", and I've included , and so in the "header.h" file. (I'm also getting this error with strcpy, strtok, and some other standard functions, all respective headers included in "header.h")

Can anyone please help me with this? I'm running out of time to deploy this work... Thanks in advance

Vladimir
  • 393
  • 3
  • 16
  • 2
    what header are you using for `memcpy`? You need to include `string.h` – ouah Jul 12 '12 at 16:27
  • we don't know what your errors are, what your code looks like, what you are trying to do - so how can we possibly help?!? – Nim Jul 12 '12 at 16:30
  • `#include "source.c"`pun intended. – wildplasser Jul 12 '12 at 16:32
  • @wildplasser - No, you should never include a C file. Only headers, and the headers should not contain function implementations. – Kevin Vermeer Jul 12 '12 at 16:33
  • What is the compiler are you using? and please show your code. – Jack Jul 12 '12 at 16:37
  • I'm sorry I can't show the code right now, I will post it in some hours (I'm at some work in a PC that's not mine) Nim, basically the compiler is complaining that standard functions implicit declaratios (?!), which's headers files are included in my own header "header.h", differs from internal function. ouah, I've included string.h, stdlib.h, stdio.h, etc... Jack, I'm using the gcc c compiler, working from Eclipse CDT – Vladimir Jul 12 '12 at 16:54
  • @Vladimir I suggest you build the file with the gcc -E option (stops after preprocessing) and check the output to see which headers and function prototypes are actually getting pulled in. That might clear up the confusion. – Andrew Cottrell Jul 12 '12 at 18:53
  • 1
    Thanks Andrew, I think that would've been helpful, but I've already solved it. It seems it was some trouble within eclipse, because I right clicked one of those functions, selected Source->Add includes and it solved the problem (but didn't added any header). Thanks again for being the only one with a simple answer to a simple question. – Vladimir Jul 13 '12 at 16:57

2 Answers2

1

It seems it was some trouble within eclipse. I right clicked one of those functions, selected Source->Add includes and it solved the problem (but didn't added any header). I hope this can be helpful for someone else

Vladimir
  • 393
  • 3
  • 16
0

Since you have not posted your code I assume that you have not included the following lines of code, at the top of your file:

#include <string.h>

In case your are using a C++ compiler (i.e. g++) then:

#include <cstring>
nick.katsip
  • 868
  • 3
  • 12
  • 32