aMule Forum

English => Multiplatform => Win32 => Topic started by: Crakem on March 06, 2008, 08:17:45 PM

Title: Compiling amuleweb on windows (I can't)
Post by: Crakem on March 06, 2008, 08:17:45 PM
I don't find any in wiki saying I can't compile amuleweb on windows. I trying it and 'make' miss regex.h, I think it's glibc which is missing, isn't it? I rode there is not support for it in linux (has not linux port) so I find in mingw at sourceforge an user contributed source for regex, I compiled it and rerun make for amuleweb but another time regex.h could not be found so I change line 30 of php_core_lib.cpp to:
Code: [Select]
#include <C:\msys\1.0\include\regex.h>
doing that regex.h is OK and that's newest I found:
Code: [Select]
amuleweb-php_core_lib.o:php_core_lib.cpp:(.text+0x3534): undefined reference to `regcomp'
amuleweb-php_core_lib.o:php_core_lib.cpp:(.text+0x359f): undefined reference to `regexec'
amuleweb-php_core_lib.o:php_core_lib.cpp:(.text+0x3638): undefined reference to `regfree'
amuleweb-php_core_lib.o:php_core_lib.cpp:(.text+0x3665): undefined reference to `regerror'
collect2: ld returned 1 exit status
make[4]: *** [amuleweb.exe] Error 1
make[4]: Leaving directory `/home/enrique/build/amule-cvs/src/webserver/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/enrique/build/amule-cvs/src/webserver'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/enrique/build/amule-cvs/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/enrique/build/amule-cvs'
make: *** [all] Error 2
Maybe regex is not so complete as I need or maybe there is missing libs?
Thanks all for replies.
Title: Re: Compiling amuleweb on windows (I can't)
Post by: lfroen on March 07, 2008, 01:13:45 PM
Yep, you're missing lib (regex)
Title: Re: Compiling amuleweb on windows (I can't)
Post by: Crakem on March 07, 2008, 04:34:14 PM
Yep, you're missing lib (regex)
Yeah, I found mingw-libgnurx-2.5.1 (mingw regex) have to be configured with:
Code: [Select]
./configure --prefix=/mingw && make && make install and then I could maintain php_core_lib.cpp untouched (regex.h is found finally with #include <regex.h>)
But library is not found:
Code: [Select]
amuleweb-WebInterface.o:WebInterface.cpp:(.rdata$_ZTV12CamulewebApp[vtable for CamulewebApp]+0x44): undefined reference to `wxEvtHandler::GetClassInfoW() const'
amuleweb-php_core_lib.o:php_core_lib.cpp:(.text+0x3534): undefined reference to `regcomp'
amuleweb-php_core_lib.o:php_core_lib.cpp:(.text+0x359f): undefined reference to `regexec'
amuleweb-php_core_lib.o:php_core_lib.cpp:(.text+0x3638): undefined reference to `regfree'
amuleweb-php_core_lib.o:php_core_lib.cpp:(.text+0x3665): undefined reference to `regerror'
collect2: ld returned 1 exit status
make[4]: *** [amuleweb.exe] Error 1
I try changing makefiles like this:
Code: [Select]
amuleweb_LDFLAGS = -L../../../../../usr/lib $(LIBPNG_LDFLAGS) -L../../libs/common -L../../libs/ec/cpp
amuleweb_LDADD = -lregex -lec -lmulecommon $(WXBASE_LIBS) $(ZLIB_LIBS) \
and I got:
Code: [Select]
amuleweb-WebInterface.o:WebInterface.cpp:(.rdata$_ZTV12CamulewebApp[vtable for CamulewebApp]+0x44): undefined reference to `wxEvtHandler::GetClassInfoW() const'
collect2: ld returned 1 exit status
make[4]: *** [amuleweb.exe] Error 1
make[4]: Leaving directory `/home/enrique/build/amule-cvs/src/webserver/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/enrique/build/amule-cvs/src/webserver'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/enrique/build/amule-cvs/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/enrique/build/amule-cvs'
make: *** [all] Error 2
Any ideas? Please it's possible compiling it with mingw and msys? There is no information in wiki about it
Thanks lfroen for so fast reply
NOTE: I building in windows mingw with msys (last release)
Title: Re: Compiling amuleweb on windows (I can't)
Post by: Crakem on March 07, 2008, 05:50:45 PM
I got regex at the list end, here:
Code: [Select]
http://sourceforge.net/project/showfiles.php?group_id=2435Perhaps another silly as me are interested in trying to compile it  :D
Regards
Title: Re: Compiling amuleweb on windows (I can't)
Post by: wuischke on March 08, 2008, 12:13:21 AM
Are they identical with this one: http://gnuwin32.sourceforge.net/packages/regex.htm ?

Please give it a try.
Title: Re: Compiling amuleweb on windows (I can't)
Post by: Crakem on March 08, 2008, 04:27:44 PM
Are they identical with this one: http://gnuwin32.sourceforge.net/packages/regex.htm ?
I try it but I got
Code: [Select]
regcomp.c:244: warning: 're_syntax_options' defined locally after being referenced with dllimport linkage
 gcc -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT regex.lo -MD -MP -MF .deps/regex.Tpo -c regex.c -o regex.o >/dev/null 2>&1
mv -f .deps/regex.Tpo .deps/regex.Plo
make[2]: *** No rule to make target `regex-dllversion.c', needed by `regex-dllversion.lo'.  Stop.
make[2]: Leaving directory `/home/enrique/build/regex-2.7-src/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/enrique/build/regex-2.7-src'
make: *** [all] Error 2
Maybe a bug in lib?  ???

I try too installer, and compiling again amuleweb:
Code: [Select]
amuleweb-WebInterface.o:WebInterface.cpp:(.rdata$_ZTV12CamulewebApp[vtable for CamulewebApp]+0x44): undefined reference to `wxEvtHandler::GetClassInfoW() const'
collect2: ld returned 1 exit status
make[4]: *** [amuleweb.exe] Error 1
make[4]: Leaving directory `/home/enrique/build/amule-cvs/src/webserver/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/enrique/build/amule-cvs/src/webserver'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/enrique/build/amule-cvs/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/enrique/build/amule-cvs'
make: *** [all] Error 2
I got same error!  :o maybe I have to look for wxEvtHandler in wxWidgets, maybe make is using some limited command in msys ???
Title: Re: Compiling amuleweb on windows (I can't)
Post by: wuischke on March 08, 2008, 07:09:02 PM
Ah, not again...this is a problem which happens quite often on mingw...I'll try to compile it later on my system and see how I can get around this.
Title: Re: Compiling amuleweb on windows (I can't)
Post by: Crakem on March 09, 2008, 03:39:09 PM
Ah, not again...this is a problem which happens quite often on mingw...I'll try to compile it later on my system and see how I can get around this.
Thanks wuischke, I'm unhappy with mingw, I hope I could mount a cross compiler in few time and problems disappear finally but gentoo have not cross compiler ready yet.
Title: Re: Compiling amuleweb on windows (I can't)
Post by: wuischke on March 09, 2008, 03:53:13 PM
No, it happens on my cross-compiler, too. It's mingw32 after all. ;)

The problem is with a macro which replaces function names. You can try to include <wx/msw/winundef.h> in the file causing the error, this sometimes helps. (This will undefine the macro)
Title: Re: Compiling amuleweb on windows (I can't)
Post by: wuischke on March 14, 2008, 06:35:59 PM
OK, you can get around the regex errors by creating empty .c-files for the missing ones.

I seem to have some problem with my cross-compiler, I get a lot of errors failing to link to standard library functions. It worked fine when I recompiled wxMSW, so it should be related to aMule...:( I'll see what I can do about it.

Edit: Argh, it always tries to use Linux libraries...why can't it stay out of /usr/ and use /usr/i486-mingw32/ like it should? Anyway, I can reproduce your error now.
Title: Re: Compiling amuleweb on windows (I can't)
Post by: GonoszTopi on March 21, 2008, 02:44:56 AM
Code: [Select]
amuleweb-WebInterface.o:WebInterface.cpp:(.rdata$_ZTV12CamulewebApp[vtable for CamulewebApp]+0x44): undefined reference to `wxEvtHandler::GetClassInfoW() const'
collect2: ld returned 1 exit status
Fixed.
Title: Re: Compiling amuleweb on windows (I can't)
Post by: Crakem on April 08, 2008, 03:14:26 AM
Code: [Select]
amuleweb-WebInterface.o:WebInterface.cpp:(.rdata$_ZTV12CamulewebApp[vtable for CamulewebApp]+0x44): undefined reference to `wxEvtHandler::GetClassInfoW() const'
collect2: ld returned 1 exit status
Fixed.
OK!!! I could compile and run amuleweb on windows XP, I'll test it intensively later :)
Thanks wuischke and GonoszTopi  :D
Title: Re: Compiling amuleweb on windows (I can't)
Post by: Crakem on April 23, 2008, 05:35:38 PM
Well, I intensively tested amuleweb and I found a few problems:
1) libgd failed to compile on windowsXP with msys  :'( I don't know if I could do it (have somebody tried to cross-compile it?)
2) so I tested amuleweb without it, and when I load webpage a lot of images (static images in webserver/'template') wont load with page at start in firefox. If I open webpage with iexplorer I found more pictures but I miss statics images (for example: decrease priority)
3) amuleweb report a lot of errors with dinamically generated images (sure!) and changing ShowProgressBar=0 in remote.conf is not taken in account (why?  :'( ) {I want to see error messages but there is difficult with so long log}

I'm using 0404 version of aMule. Thanks for all (and a lot of) replies. Feel free for request test to me.

Edit: redirecting to file I found no errors for static images, I got only error for dynamics ones (like: CFileImage: failed to open c:\<path>\ dyn_<hash>.png)
Title: Re: Compiling amuleweb on windows (I can't)
Post by: Crakem on April 23, 2008, 07:58:56 PM
OK, I have checked libgd website and I found this link (precompiled package)
Code: [Select]
http://www.libgd.org/releases/gd-latest-win32.zipI have downloaded and installed (by hand) in c:\mingw directory (it's different from msys directory in my setup and maybe in all)
Configure script was able to find libgd and amuleweb compilation was successful; I added to amuleweb folder bgd.dll but amuleweb won't show dinamically generated pictures in webpage and I miss a lot of statically generated too. Maybe it need another binaries from gd lib? Running amuleweb didn't request any bins but I saw same errors like missing libgd  :-\

Thanks all for replies
Title: Re: Compiling amuleweb on windows (I can't)
Post by: lfroen on April 23, 2008, 09:21:36 PM
You need libpng
Title: Re: Compiling amuleweb on windows (I can't)
Post by: Crakem on April 23, 2008, 09:52:50 PM
You need libpng
i have copied libpng12-0.dll and libpng-3.dll to amuleweb forder but don't work, could you be more specific??
Title: Re: Compiling amuleweb on windows (I can't)
Post by: lfroen on April 24, 2008, 06:02:18 PM
You need libpng (I mean development part of it) in compile-time, so "configure" script will detect it and set correct define in source code.
Title: Re: Compiling amuleweb on windows (I can't)
Post by: Nil Einne on April 26, 2008, 07:30:53 AM
Are you working on the SVN/CVS Crakem? If so, if you ever manage to do this, could you contribute your work to the distro section? We currently have someone who is releasing most of the files, but not amuleweb
Title: Re: Compiling amuleweb on windows (I can't)
Post by: Crakem on April 28, 2008, 11:11:00 PM
You need libpng (I mean development part of it) in compile-time, so "configure" script will detect it and set correct define in source code.
Sorry, here you are my config.log for amuleweb build
Code: [Select]
configure:6540: checking for libpng-config
configure:6559: found /usr/local/bin/libpng-config
configure:6572: result: /usr/local/bin/libpng-config
configure:6584: checking for libpng version >= 1.2.0
configure:6638: result: yes (version 1.2.25rc02)
configure:6918: checking for File::Copy
configure:6921: result: ok
I thought you are talking with me about what file I have to pack with amuleweb, I think compile script found libpng well. But dynamic generation didn't work (and statics files load partially) so I got an amuleweb not fully working.

Nil Einne, yes, I'm working on CVS 20080404 but as I said amuleweb is not fully working yet. I posting here when it's working. If you want amuleweb partially working, please post me one link where I could upload it.
Title: Re: Compiling amuleweb on windows (I can't)
Post by: lfroen on April 29, 2008, 11:30:30 AM
Can you please explain what do you mean by "dynamic generation didn't work":
* Do you see <img> tag being generated?
* Do you see error messages for missing images on console?
* Do you see PNG code is actually compiled (-D present in gcc command line)?
Title: Re: Compiling amuleweb on windows (I can't)
Post by: Crakem on April 29, 2008, 10:15:28 PM
* Do you see <img> tag being generated?
I can't see progress bar for example (named dinamic for me and errors (CFileImage: failed to open <name of png image>) I found on console, I named it few post back, it follow pattern: dyn_<hash>.png)
* Do you see error messages for missing images on console?
Yes, please, read back
* Do you see PNG code is actually compiled (-D present in gcc command line)?
I have to check it on windows (now i'm on linux) but configure have found libpng and libgd (precompiled)
Title: Re: Compiling amuleweb on windows (I can't)
Post by: lfroen on April 30, 2008, 09:03:21 PM
I can't see progress bar for example (named dinamic for me and errors (CFileImage: failed to open <name of png image>) I found on console, I named it few post back, it follow pattern: dyn_<hash>.png)

OK, this means that amuleweb "thinks" that dynamic png should be requested by browser. That's good. Errors on console later means, that for some reason image cache doesn't contain dynamically generated files (which are not actually files as you can understand). Since this code works on Linux, I assume that actual logic is OK. Next thing before starting gdb is to check that correct -D switch present in gcc command line, and png-generating code is actually being compiled.
Title: Re: Compiling amuleweb on windows (I can't)
Post by: Crakem on May 01, 2008, 12:05:00 AM
I was talking with Pierre Joye from libgd and as I understood, we could compile libgd on mingw from 2.0.37 release  :D
Title: Re: Compiling amuleweb on windows (I can't)
Post by: Crakem on May 01, 2008, 12:21:17 AM
Next thing before starting gdb is to check that correct -D switch present in gcc command line, and png-generating code is actually being compiled.
After running make, I couldn't find any gcc line for check you told me (I running configure for just build webserver) I taken this line from 'Makefile' file
Code: [Select]
CFLAGS =  -DNOMINMAX  -W -Wall -Wshadow -Wundef -O2  -DUSE_WX_EXTENSIONSIs this you told me?  Please, if is not, could you drive me to the good direction for check you said, please?
Title: Re: Compiling amuleweb on windows (I can't)
Post by: lfroen on May 01, 2008, 06:36:53 AM
After running make, I couldn't find any gcc line for check you told me (I running configure for just build webserver) I taken this line from 'Makefile' file
Code: [Select]
CFLAGS =  -DNOMINMAX  -W -Wall -Wshadow -Wundef -O2  -DUSE_WX_EXTENSIONSIs this you told me?  Please, if is not, could you drive me to the good direction for check you said, please?

Please look to the terminal shell where you run "make". The flag you're looking for is -DWITH_LIBPNG, as you can see from WebServer.cpp:

Code: [Select]
#ifdef WITH_LIBPNG
        m_ImageLib->AddImage(item->m_Image, wxT("/") + item->m_Image->Name());
#endif
Title: Re: Compiling amuleweb on windows (I can't)
Post by: GonoszTopi on May 01, 2008, 08:01:20 PM
Crakem: trying "make clean && make" should produce some gcc lines... or g++...
Title: Re: Compiling amuleweb on windows (I can't)
Post by: Crakem on May 02, 2008, 04:17:57 AM
trying "make clean && make" should produce some gcc lines... or g++...
That's right (I didn't think running clean ::))
Code: [Select]
make[4]: Entering directory `/home/enrique/build/amule-cvs-04042008/src/webserver/src'
if g++ -DHAVE_CONFIG_H -I. -I. -I../../..  -I../.. -I../../../src -I../../../src/libs -I../../../src/include -DWITH_LIBPNG -DHAVE_BFD -DEC_REMOTE -DWEBSERVERDIR="\"/usr/local/share/amule/webserver\"" -DECSOCKET_USE_EVENTS=0  -I/usr/local/lib/wx/include/msw-unicode-release-static-2.8 -I/usr/local/include/wx-2.8 -D__WXMSW__ -mthreads -DwxUSE_GUI=0 -I/usr/local/include/libpng12  -DNOMINMAX -I/home/enrique/usr/lib/cryptopp/include -D__CRYPTO_INSTALLED__ -D__WEAK_CRYPTO__  -W -Wall -Wshadow -Wundef -O2  -DUSE_WX_EXTENSIONS -MT amuleweb-WebServer.o -MD -MP -MF ".deps/amuleweb-WebServer.Tpo" -c -o amuleweb-WebServer.o `test -f 'WebServer.cpp' || echo './'`WebServer.cpp; \
A more long extract of make is here http://pastebin.com/m357b6000 (http://pastebin.com/m357b6000)
And flag is present  ???
Title: Re: Compiling amuleweb on windows (I can't)
Post by: lfroen on May 02, 2008, 01:33:32 PM
So, everything is in place, but doesn't work. GDB is your friend from now on.
Title: Re: Compiling amuleweb on windows (I can't)
Post by: Radek on May 23, 2008, 01:54:43 PM
Hi, Crakem

Nil Einne, yes, I'm working on CVS 20080404 but as I said amuleweb is not fully working yet. I posting here when it's working. If you want amuleweb partially working, please post me one link where I could upload it.

If you like, you can upload the files to the FTP-Server (ftp://kieselei.de/incoming) I am using for my own binaries. The "incoming" directory is write-only and I have to move the files to the target directory manually but that's not a big problem, of course.

I'm not really interested in running amuleweb under Win$, because I use my WinXP-machine only sporadically and don't like to leave it running all day long. For such tasks I have a local Debian server with Low-Power-Architecture (VIA C7) which is running 24/7.
But I could try to act as sort of a "compile farm" for the binaries if wanted. I normally start the batch-job once a day and leave it running in the background. So it would not make much difference to compile amuleweb, too.
Title: Re: Compiling amuleweb on windows (I can't)
Post by: Crakem on June 04, 2008, 01:20:21 AM
If you like, you can upload the files...
Yes, of course. I upload all my binaries. I think you could remove libpng dlls because it's not working yet.
If you want I will upload complete CVS when amuleweb working.
Post me if you got problems.