Hi, I am getting following error p.c uses some of the function implemented in md4.c. p.c , when compiled with gcc works but it does not work with g++, gives undefined method error. Am I missing something obivious ?
[prafulla@ps7374 sample] $g++ -c -o md4.o md4.c
[prafulla@ps7374 sample] $gcc -c -o md4.o md4.c
[prafulla@ps7374 sample] $g++ p.c md4.o
p.c: In function ‘int main()’:
p.c:5: warning: deprecated conversion from string constant to ‘char*’
/tmp/ccxE4q1J.o: In function `main':
p.c:(.text+0x3b): undefined reference to `MD4Init(MD4_CTX*)'
p.c:(.text+0x57): undefined reference to `MD4Update(MD4_CTX*, unsigned char*, unsigned int)'
p.c:(.text+0x6b): undefined reference to `MD4Final(unsigned char*, MD4_CTX*)'
collect2: ld returned 1 exit status
[prafulla@ps7374 sample] $gcc p.c md4.o
Here is my makefile
sample.out: sample.cc md4.o Makefile
g++ -o sample.out sample.cc md4.o
./sample.out
test.o: p.c
g++ p.c md4.o
md4.o: md4.c md4.h
gcc -c -o md4.o md4.c