LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   C Errors on compiling (https://www.linuxquestions.org/questions/fedora-35/c-errors-on-compiling-547063/)

prashanthjj 04-18-2007 10:43 AM

C Errors on compiling
 
i'm doing my B.Tech project on Portknocking concept while i implementing portknocking in C using Fedora Core 6 these errors are came.... plz suggest any solutions for that plz its very urgent......
eventhough i installed openssl and libslack packages these errors are came...

[root@localhost ~]# cc knock.h

[root@localhost ~]# cc knockc.c
/tmp/ccmAMaEo.o: In function `main':
knockc.c:
(.text+0x59a): undefined reference to `BF_set_key'
knockc.c:(.text+0x5c4): undefined reference to `BF_ecb_encrypt'
collect2: ld returned 1 exit status

[root@localhost ~]# cc knockd.c

knockd.c:29:33: error: md5.h: No such file or directory

knockd.c: In function ‘main’:

knockd.c:110: warning: passing argument 2 of ‘signal’ from incompatible pointer type

knockd.c:111: warning: passing argument 2 of ‘signal’ from incompatible pointer type

knockd.c:115: warning: comparison between pointer and integer
knockd.c:147: warning: passing argument 1 of ‘strcmp’ makes pointer from integer without a cast

XavierP 04-18-2007 11:04 AM

2 things: firstly, marking your thread as Urgent is a big no-no here. We are all volunteers and do this on our own time, no problem is more urgent than any other. Secondly, this forum is purely a place to say "hello", you won't get any technical answers in this forum so I have moved your thread to the Fedora forum.

XavierP 04-18-2007 11:05 AM

I have also renamed your thread to give it a meaningful title.

slzckboy 04-18-2007 11:12 AM

is this code that you have written yourself ?

if so have you included the right headers and linked to correct libs?

osor 04-18-2007 11:14 AM

First, a lot of my post will be guessing since you make no revelations about your code nor your install paths for openssl. Second, there is no point to “cc knock.h” as it should be used as a header file. Third, you need to not only install openssl, but to use it (i.e., tell the compiler where to find the include files and the linker what libs to link). For your first error (in knockc.c) it compiles fine, but there is a linking error. Most likely you need to link to the ssl library (try “cc -lssl -lcrypto -ldl -o knockc knockc.c”). For your second error (knockd.c) the compiler can’t find the file “md5.h” you can either change “#include <md5.h>” to “#include <openssl/md5.h>” or specify the include path the compiler should use (i.e., “cc -I/usr/include/openssl -o knockd knockd.c”).

prashanthjj 04-19-2007 12:42 AM

Quote:

Originally Posted by slzckboy
is this code that you have written yourself ?

if so have you included the right headers and linked to correct libs?


No i downloaded this coding from Portknocking.org and eventhough i installed openssl and libslack the errors are came.....


so plz suggest any other solutions..............

slzckboy 04-19-2007 01:18 AM

and the code dosn't have a make file?

or install instructions?

osor 04-19-2007 09:24 AM

Quote:

Originally Posted by prashanthjj
so plz suggest any other solutions..............

Did you try my “solution”?

prashanthjj 04-21-2007 12:39 AM

tel me ur solution i'll try......

osor 04-21-2007 10:25 AM

Umm…
Did you not see this?

prashanthjj 04-23-2007 09:30 PM

i already tried it will work for knockc only not for knockd...... in knockd the main error is undefined reference to MD5file() function......

nomb 04-24-2007 07:43 AM

I guess if anyone wants to see his code you can look at his other post a few spots down on the main fedora page.

http://www.linuxquestions.org/questi...d.php?t=547233

Don't double post.


All times are GMT -5. The time now is 06:02 PM.