hiliujunyi / skipfish

Automatically exported from code.google.com/p/skipfish
Apache License 2.0
0 stars 0 forks source link

Cygwin #143

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm totally oblivious to non-windows operating systems. I'd appreciate it if 
someone give me a few pointers in how to compile this source to work with 
cygwin1.dll (Cygwin project; http://www.cygwin.com/).

Thank you.

Original issue reported on code.google.com by hlubo...@gmail.com on 1 Mar 2012 at 8:16

GoogleCodeExporter commented 9 years ago
I'm sorry: I didn't pay attention to the issue-type. This isn't a defect.

Original comment by hlubo...@gmail.com on 1 Mar 2012 at 9:02

GoogleCodeExporter commented 9 years ago
There are many introductory guides to Cygwin in particular, or to using bash 
and compiling programs using make on Unix systems. While I can't recommend any 
specific one, I'd suggest using Google / Bing / Cuil to find the one that works 
for you.

Original comment by lcam...@gmail.com on 1 Mar 2012 at 9:10

GoogleCodeExporter commented 9 years ago
Thank you. I'm not sure that you understood me.

Basically, I have no clue how to compile your source. I am aware that source 
code in general targets specific platforms, but since cygwin is listed for this 
one, I'm assuming it should compile for windows.

Then, I landed on cygwin.com, and I read this:

"Cygwin is not a way to run native Linux apps on Windows. You must rebuild your 
application from source if you want it to run on Windows."

Therefore, I need to find a way (namely, instructions) on how to compile 
skipfish source into a windows executable. While I sure have (and will 
continue) to google/bing that (never heard of Cuil), I thought that source code 
in general compiles in environment that the developer chooses (e.g. I can't 
give you .NET source and not tell you about MSBuild and/or Visual Studio). So, 
what IDE do you use to code and compile? I'm assuming you develop on Linux. Is 
this source standard, and if I'm able to find a C compiler (for windows, I'm 
hoping), will I actually be able to compile it by just pointing it to the 
source directory? For example, IDE's (e.g. Visual Studio) won't know what to do 
with this source given just the path directory that contains it - some project 
file must exist, some rules about file layout must exist, dependencies, etc - 
some rules about in which order files should be fed to compilers.

Is "bash" the compiler I'm looking for, please?

Thank you.

Original comment by hlubo...@gmail.com on 1 Mar 2012 at 9:27

GoogleCodeExporter commented 9 years ago
Please refer to existing tutorials on compiling programs from the source code. 
In fact, there are several posts explaining the compilation of skipfish on 
Windows specifically. There is no IDE necessary, you simply need to use 'make', 
and possibly install some auxiliary libraries or tools (e.g., libidn).

Skipfish is distributed as source-only, and the process of compiling it is 
exactly the same on Linux, under Cygwin, or on any other supported platform.

Original comment by lcam...@gmail.com on 1 Mar 2012 at 9:42

GoogleCodeExporter commented 9 years ago
As a little update, I attempted to use Microsoft's Visual Studio compiler, 
following this example: http://msdn.microsoft.com/en-us/library/bb384838.aspx

Sample worked for me. Then, I searched for "main" function in your source, and 
finding one in skipfish.c file, I assumed that's my entry point. I attempted to 
compile that source, hoping this compiler will be smart enough to find the rest 
of the files, given just this one.

I immediately hit an error: "Cannot open include file: 'unistd.h'". So, it's 
obvious that snapfish project has some dependencies that are not included in 
the source - am I right? Or perhaps, this compiler is not smart enough to work 
with this source. I did find the "#include <unistd.h>" declaration in 
snapfish.c, though.

Even if I had that header file, I'm sure I'll hit other problems (e.g. 
following that declaration, "signal.h" is what's required, and I don't see that 
one neither.

Can you help? Perhaps compiling this is a 5-minute task for you. I'm sure 
people would benefit from a working windows executable. I am grateful for your 
work, though - I don't mean to sound negative in any way.

Thanks again.

Original comment by hlubo...@gmail.com on 1 Mar 2012 at 9:42

GoogleCodeExporter commented 9 years ago
Thanks; I posted my 2nd comment before I saw your last; I will see if I can 
figure it out.

Original comment by hlubo...@gmail.com on 1 Mar 2012 at 9:43

GoogleCodeExporter commented 9 years ago
Thanks. I will admit that I did not include the word "skipfish" when previously 
googling - thinking I won't find anything specific to this project elsewhere. 
This doc works: http://www.ryankinal.com/blog.php?pid=26

Thanks again; your last pointed worked!

Original comment by hlubo...@gmail.com on 1 Mar 2012 at 9:47

GoogleCodeExporter commented 9 years ago
> In fact, there are several posts explaining the compilation of skipfish on 
Windows specifically.

There are few, brief, promising, but non-working.

I ended up downloading most of cygwin - simply because nobody can be bothered 
to list dependencies for that app. Sorry, but - where I work, that's 
unacceptable: to tell the user to find out on their own what they need to run 
my app!?

This thing won't compile when "make" or "make install" (as those "tutorials" 
suggest) is typed:

$ make
cc -L/usr/local/lib/ -L/opt/local/lib skipfish.c -o skipfish -O3 -Wno-format 
-Wall -funsigned-char -g -ggdb -I/usr/local/include/  -I/opt/local/include/  
-DVERSION=\"2.04b\" \
      http_client.c database.c crawler.c analysis.c report.c -lcrypto -lssl -lidn -lz
make: cc: Command not found
Makefile:40: recipe for target `skipfish' failed
make: *** [skipfish] Error 127

If "cc" is another library at cygwin, I couldn't find one by just that name. 
What does this mean: "recipe for target `skipfish' failed"?

Please :)

Original comment by hlubo...@gmail.com on 3 Mar 2012 at 12:03

GoogleCodeExporter commented 9 years ago
Did you install gcc in your cygwin environment? It looks like it's missing.  

Original comment by niels.he...@gmail.com on 3 Mar 2012 at 1:30

GoogleCodeExporter commented 9 years ago
Thank you.

In the meantime, things changed. You were right, I had been missing some 
libraries, "gcc" included. Not including the compiler package and complaining 
about not being able to compile source is probably funny to all of you that 
work in those environments, but it isn't obvious at all.

I was finally able to compile the source into skipfish.exe. However, now I'm 
having problems running it, as it's complaining about missing supporting 
libraries. While I can find them one by one as they are reported by windows 
console, I wish I can figure out a way to have "make" output those supporting 
libraries also. My second (and last) wish is to dump these binaries into 
another folder. I'm trying to research that now.

Original comment by hlubo...@gmail.com on 3 Mar 2012 at 1:42

GoogleCodeExporter commented 9 years ago
plz help me in resolving this error i have installed cygwin and both make and 
gcc  is der something else that i need to install apart from dese 2 ??

C:\skipfish>make
cc -L/usr/local/lib/ -L/opt/local/lib src/skipfish.c -o skipfish \
        -O3 -Wno-format -Wall -funsigned-char -g -ggdb -I/usr/local/include/ -I/opt/local/include/  -DVERSION=\"2.10b\" src/http_client.c src/database.c src/crawler.c src/analysis.c src/report.c src/c
hecks.c src/signatures.c src/auth.c src/options.c -lcrypto -lssl -lidn -lz 
-lpcre
In file included from src/skipfish.c:48:0:
src/signatures.h:24:18: fatal error: pcre.h: No such file or directory
 #include "pcre.h"
                  ^
compilation terminated.
src/http_client.c:40:18: fatal error: idna.h: No such file or directory
 #include <idna.h>
                  ^
compilation terminated.
In file included from src/analysis.c:32:0:
src/signatures.h:24:18: fatal error: pcre.h: No such file or directory
 #include "pcre.h"
                  ^
compilation terminated.
src/signatures.c:27:18: fatal error: pcre.h: No such file or directory
 #include "pcre.h"
                  ^
compilation terminated.
Makefile:48: recipe for target 'skipfish' failed
make: *** [skipfish] Error 1

Original comment by soumyabh...@somaiya.edu on 19 Sep 2014 at 3:51