-   Linux - Software (
-   -   Compilation Issues x86_64 (rocksaw) (

w3bd3vil 05-10-2007 11:00 AM

Compilation Issues x86_64 (rocksaw)

I have been trying to compile a program named Rocksaw

the file is this

Under the /src/jni folder
there is a make file.

when I run the make command I get the following error

[root@localhost jni]# make
gcc -ansi -Wall -O2 -pipe -pthread -D_REENTRANT -fpic -I/include -I -c RawSocket.c -o RawSocket.o
/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../crt1.o: In function `_start': undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [RawSocket.o] Error 1
[root@localhost jni]#
Could someone help me with the problem.

This program has a single c file.
I would be glad if someone could compile this prog. on a 64bit system and give me the compiled file. Like its urgent...thanks!

osor 05-10-2007 11:35 AM

First off, that package looks like it was intended to be compiled with “ant” from the top-level directory (though it also looks as if you can compile the C portion of the library by manually descending to src/jni and running make as you did). Second, have you tried doing the linking manually? I.e., after the Makefile creates RawSocket.o, try doing

$ gcc -shared -o RawSocket.o
If that doesn’t work, try

$ ld -shared -o RawSocket.o

w3bd3vil 05-10-2007 02:53 PM

the ant part is used for the java compilation. you can compile the C portion alone.
anyhow, I dont think I am getting any RawSocket.o file after the make command. OR I guess I didnt understand what you mean.

osor 05-10-2007 06:28 PM

Oh, I see the problem now. You need to have JDK_HOME set and exported so that it can be used by the Makefile.

w3bd3vil 05-10-2007 08:55 PM

lol, sometimes reading the README file carefully sorts everything out. Thanks for the pointer :D

All times are GMT -5. The time now is 11:49 PM.