iveney / pwntcha

PWNtcha stands for "Pretend We’re Not a Turing Computer but a Human Antagonist", as well as PWN capTCHAs. This project’s goal is to demonstrate the inefficiency of many captcha implementations. This is a fork of Sam Hocevar's original version.
http://caca.zoy.org/wiki/PWNtcha
Other
83 stars 29 forks source link

Building under Ubuntu 12.04 (32-bit) - Error Messages #8

Closed jeremysolarz closed 10 years ago

jeremysolarz commented 11 years ago

I build pwntcha like os

./bootstrap
./configure
./make

Get the following error after make

make[3]: Entering directory `/home/user/pwntcha/src'
gcc `sdl-config --cflags` -Wall -O6 -g -O2 `sdl-config --libs` -lSDL_image  -o pwntcha pwntcha-main.o pwntcha-filter.o pwntcha-font.o pwntcha-image.o pwntcha-easter-eggs.o pwntcha-test.o authimage/libdecoder.a clubic/libdecoder.a htmlformguide/libdecoder.a java/libdecoder.a linuxfr/libdecoder.a livejournal/libdecoder.a lmt/libdecoder.a movabletype/libdecoder.a paypal/libdecoder.a phpbb/libdecoder.a scode/libdecoder.a slashdot/libdecoder.a ticketmaster/libdecoder.a tickets/libdecoder.a vbulletin/libdecoder.a xanga/libdecoder.a 
pwntcha-image.o: In function `image_new':
/home/user/pwntcha/src/image.c:98: undefined reference to `SDL_CreateRGBSurface'
pwntcha-image.o: In function `image_load':
/home/user/pwntcha/src/image.c:35: undefined reference to `IMG_Load'
/home/user/pwntcha/src/image.c:49: undefined reference to `SDL_UpperBlit'
/home/user/pwntcha/src/image.c:50: undefined reference to `SDL_FreeSurface'
pwntcha-image.o: In function `image_free':
/home/user/pwntcha/src/image.c:155: undefined reference to `SDL_FreeSurface'
pwntcha-image.o: In function `image_save':
/home/user/pwntcha/src/image.c:171: undefined reference to `SDL_RWFromFile'
/home/user/pwntcha/src/image.c:171: undefined reference to `SDL_SaveBMP_RW'
livejournal/libdecoder.a(libdecoder_a-decoder.o): In function `find_glyphs':
/home/user/pwntcha/src/livejournal/decoder.c:88: undefined reference to `sqrt'
slashdot/libdecoder.a(libdecoder_a-decoder.o): In function `rotate':
/home/user/pwntcha/src/slashdot/decoder.c:146: undefined reference to `sqrt'
/home/user/pwntcha/src/slashdot/decoder.c:147: undefined reference to `sqrt'
xanga/libdecoder.a(libdecoder_a-decoder.o): In function `find_glyphs':
/home/user/pwntcha/src/xanga/decoder.c:173: undefined reference to `sqrt'
collect2: ld returned 1 exit status
make[3]: *** [pwntcha] Error 1
make[3]: Leaving directory `/home/user/pwntcha/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/user/pwntcha/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/user/pwntcha'
make: *** [all] Error 2

output of configure is

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for ranlib... ranlib
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for size_t... yes
checking for getopt_long... yes
checking IL/il.h usability... yes
checking IL/il.h presence... yes
checking for IL/il.h... yes
checking olectl.h usability... no
checking olectl.h presence... no
checking for olectl.h... no
checking for sdl-config... /usr/bin/sdl-config
checking SDL_image.h usability... yes
checking SDL_image.h presence... yes
checking for SDL_image.h... yes
checking cv.h usability... yes
checking cv.h presence... yes
checking for cv.h... yes
checking for imlib2-config... /usr/bin/imlib2-config
checking Imlib2.h usability... yes
checking Imlib2.h presence... yes
checking for Imlib2.h... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/authimage/Makefile
config.status: creating src/clubic/Makefile
config.status: creating src/htmlformguide/Makefile
config.status: creating src/java/Makefile
config.status: creating src/linuxfr/Makefile
config.status: creating src/livejournal/Makefile
config.status: creating src/lmt/Makefile
config.status: creating src/movabletype/Makefile
config.status: creating src/paypal/Makefile
config.status: creating src/phpbb/Makefile
config.status: creating src/scode/Makefile
config.status: creating src/slashdot/Makefile
config.status: creating src/ticketmaster/Makefile
config.status: creating src/tickets/Makefile
config.status: creating src/vbulletin/Makefile
config.status: creating src/xanga/Makefile
config.status: creating extras/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands

so the dependencies seem fine.

Any hint what could be the reason for this?

s35300792001 commented 11 years ago

I have the same problem as you.

iveney commented 11 years ago

I don't have a Ubuntu box at hand and cannot test. Looks like the new GCC in your system deprecated implicit declaration of sqrt etc. functions. Try to include the math header <math.h> in the reported files (decoder.c etc.) and recompile. Please fork and send a pull request.

samsemilia7 commented 11 years ago

To solve that problem you should try the following steps:

The command is mostly the same, except for the compiler (used g++) and the compiler flags are at the end. After that, you will have your executable :D ( Tested on a ubuntu 12.04, 64bit).

ghost commented 10 years ago

getting configure.ac:5: option tar-ustar' not recognized on fedora when ./bootstrap

samsemilia7 commented 10 years ago

maybe there is a space missing. try changing the line to tar -ustar

ghost commented 10 years ago

@samsemilia7 maybe tar-ustar option isn't in automakev1.7 and below.

djg123 commented 10 years ago

@samsemilia7 I am getting

/usr/bin/ld: cannot find -lSDL_image
collect2: ld returned 1 exit status
iveney commented 10 years ago

That means you need to have SDL_image library installed.

On Mon, Oct 28, 2013 at 8:23 AM, djyale notifications@github.com wrote:

@samsemilia7 https://github.com/samsemilia7 I am getting

/usr/bin/ld: cannot find -lSDL_image collect2: ld returned 1 exit status

— Reply to this email directly or view it on GitHubhttps://github.com/iveney/pwntcha/issues/8#issuecomment-27210540 .

Regards, Zigang Xiao, Department of Electrical and Computer and Engineering, University of Illinois at Urbana-Champaign http://ews.illinois.edu/~zxiao2

rostfrei commented 10 years ago

Managed to build pwntcha in cygwin!

So I have done exactly what samsemilia7 told to do, but in my case I use imlib2 so I run

g++ imlib2-config --cflags -Wall -O6 -g -O2 -o pwntcha pwntcha-main.o pwntcha-filter.o pwntcha-font.o pwntcha-image.o pwntcha-easter-eggs.o pwntcha-test.o authimage/libdecoder.a clubic/libdecoder.a java/libdecoder.a linuxfr/libdecoder.a livejournal/libdecoder.a lmt/libdecoder.a paypal/libdecoder.a phpbb/libdecoder.a scode/libdecoder.a slashdot/libdecoder.a ticketmaster/libdecoder.a tickets/libdecoder.a vbulletin/libdecoder.a xanga/libdecoder.a imlib2-config --libs -lImlib2

and I got the error

$ g++ imlib2-config --cflags -Wall -O6 -g -O2 -o pwntcha pwntcha-main.o pwntcha-filter.o pwntcha-font.o pwntcha-image.o pwntcha-easter-eggs.o pwntcha-test.o authimage/libdecoder.a clubic/libdecoder.a java/libdecoder.a linuxfr/libdecoder.a livejournal/libdecoder.a lmt/libdecoder.a paypal/libdecoder.a phpbb/libdecoder.a scode/libdecoder.a slashdot/libdecoder.a ticketmaster/libdecoder.a tickets/libdecoder.a vbulletin/libdecoder.a xanga/libdecoder.a imlib2-config --libs -lImlib2 /usr/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lfreetype /usr/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lz /usr/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lbz2 /usr/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lXext collect2: error: ld returned 1 exit status

after installing the missing libraries and running the command again, pwntcha.exe was successfully created.

micfan commented 10 years ago

@jeremysolarz I have the same problem as you, now. OS: ubuntu12.04. I think cywin is not proper for development, but i can't transfer it to Linux

2called-chaos commented 9 years ago

With your help I was able to build it on 14.04 as well, thanks!