aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Trouble compiling in Cygwin  (Read 1533 times)

exaghost

  • Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
Trouble compiling in Cygwin
« on: November 03, 2016, 10:09:10 PM »

A magyar verzióhoz lapozz lentebb! ;)

Hi!
If someone wants to try to compile with Cygwin (32 bit, 64 bit won't work)...
You have to install wxWidgets 2.8.12, after that, download AND compile crypto++ 5.6.4 (crypto++ 5.6.5 is _broken_, latest commit is OK, but I have not tried yet.) <<-- aMule bug with the version detection rutin, original sources are not usable, just after you compile.
You can copy your cryptopp folder to \amule\cryptopp564 and compile

There is a bug with detecting wx, so you have to extract the \wxWidgets-2.8.12.tar\wxWidgets-2.8.12\include\wx\ folder into \amule\wx. Even if the Cygwin install was OK.

I can run
$ ./configure --with-wx-config=wx-config-2.8
fine, without error, but when I try to MAKE
Gergely@Gergely-PC ~/amule/aMule-2.3.2 $ make
Compiling FileFunctions.cpp
Compiling Format.cpp

[...]

Compiling UserEvents.cpp
Compiling amule.rc
Linking amule.exe
/usr/lib/gcc/i686-pc-cygwin/5.4.0/../../../../i686-pc-cygwin/bin/ld: cannot find -lcryptopp
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:1039: amule.exe] Error 1
make[2]: *** [Makefile:3274: all-recursive] Error 1
make[1]: *** [Makefile:489: all-recursive] Error 1
make: *** [Makefile:396: all] Error 2

Gergely@Gergely-PC ~/amule/aMule-2.3.2

Actually there is no lcryptopp.* in the compiled pryptopp folder. There is libcryptopp, and others, but they are not usable.
Any suggestions what to do ? I'm working on this for many hours now, but thats all I have investigated so far.

MAGYARUL ;)

Üdv!
Megpróbáltam Cygwin alól lefordítani, de eddig nem nagyon sikerült. Telepítettem a szükséges csomagokat, wxWidgets 2.8.12, (és 3.0) volt, és települt is. Crypto++ nincs, az magamnak kellett beszerezni, sikerült az egyel régebbi verziót le is fordítani (az újabb ebben a környezetben nem fordul). Utóbbi forrását akár hova másoltam, nem ette meg, azt mondja, nem elég új (az elvileg megfelelő 5.1 sem), illetve a \-jelet megeszi, de a /-t nem. Na mindegy, szóval sikerült egy fordított verzióval tovább lépni. Aztán a wx-et hiába telepítettem a Cygwin rendszeren belül, be kellett másolni a fent említett helyről az amule mappán belül.  Továbbá a "wx-config" nincs a rendszeren, csak "wx-config-2.8" de azzal már jó volt. A MAKE pedig nem találja a lefordított cryptopp-t.

Ennyire jutottam, hátha valaki sikeresebb lesz. Nem vagyok programozó, szóval eléggé megszenvedtem vele :) Próbáltam MS Visual Studio 2010-zel is, de ott egyéb problémák voltak, így azt hagytam is.

Remélem tudtam segíteni a fejlesztésben, szép napot, sok sikert !
« Last Edit: November 03, 2016, 11:26:57 PM by exaghost »
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 164
  • Offline Offline
  • Posts: 2703
Re: Trouble compiling in Cygwin
« Reply #1 on: November 09, 2016, 12:12:30 AM »

Hello exaghost (Gergely)!

I will reply only in English, because 1) I don't like repeating myself, and 2) others can understand, too. I hope you don't mind :)

I had several tries with compilation on windows with different toolsets, as far as I remember all (or almost all) failed at some point. I'll give it another try sometime later, and we'll see if it is possible at all or not.

/usr/lib/gcc/i686-pc-cygwin/5.4.0/../../../../i686-pc-cygwin/bin/ld: cannot find -lcryptopp

You have to tell the linker where the compiled library is. You can pass LDFLAGS=-L\amule\cryptopp564 to configure, that should do it (in case you did not install it, if you did you have to point the linker to the install directory).

Actually there is no lcryptopp.* in the compiled pryptopp folder. There is libcryptopp, and others, but they are not usable.

The -l<libname> flag tells the linker to link to the <libname> library and the actual file will be called lib<libname>.a, in this case libcryptopp.a (or libcryptopp.dll.a if you compiled a shared library, that will make aMule use cryptopp.dll - however, I discourage doing so).

Próbáltam MS Visual Studio 2010-zel is, de ott egyéb problémák voltak, így azt hagytam is.

The Microsoft Visual Studio 2010 project files are currently unmaintained and will be removed from the sources. Most likely. The Visual Studio 2013 projects should build fine.

I hope I could help.
Logged
concordia cum veritate

exaghost

  • Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
Re: Trouble compiling in Cygwin
« Reply #2 on: November 09, 2016, 12:06:28 PM »

Hi!

A tried what You recommended but no luck :( I have generated "libcryptopp.a" (43+ MiB) But the commands are not working for me.

./configure --with-wx-config=wx-config-2.8 LDFLAGS="-L/amule/cryptopp564"  <- notice the / instead of \ and the " "
There are many other possibilities i tried, but non worked.

./configure --with-wx-config=wx-config-2.8 CRYPTOPP_LDFLAGS="-lcryptopp -L/amule/cryptopp564"
OR
./configure --with-wx-config=wx-config-2.8 CRYPTOPP_LDFLAGS="-L/amule/cryptopp564"

I have found this CRYPTOPP_LDFLAGS parameter in the configure file, but the error is the same.

$ ./configure --with-wx-config=wx-config-2.8 LDFLAGS="-L lcryptopp /amule/cryptopp564"

checking for a BSD-compatible install... /usr/bin/install -c
[..]
checking whether the C++ compiler works... no
configure: error: in `/home/Gergely/amule':
configure: error: C++ compiler cannot create executables
See `config.log' for more details.

What is really strange, after I install the lib, and I issue simply
$ ./configure --with-wx-config=wx-config-2.8

**** General Libraries and Tools ****
  Should ccache support be enabled?                          no
  Libraries aMule will use to build:
                             wxWidgets             2.8.12 (gtk2,shared)
                             crypto++              5.6.4 (in /usr/local)
                             libintl               system
                             zlib                  1.2.8
There IS the lib .... now what ? :O

The libupnp thing....
After I compile and install libupnp-1.6.20, aMule can not detect it either... The magic with both libs can be the same :D
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 164
  • Offline Offline
  • Posts: 2703
Re: Trouble compiling in Cygwin
« Reply #3 on: November 09, 2016, 09:19:38 PM »

Okay, please try
Code: [Select]
$ ./configure --with-wx-config=wx-config-2.8 --with-denoise-level=0
$ make V=1
then please copy here the last screenful of make output.
Logged
concordia cum veritate

exaghost

  • Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
Re: Trouble compiling in Cygwin
« Reply #4 on: November 09, 2016, 10:42:44 PM »

Hi!

Here You go !


Gergely@Gergely-PC ~/amule
$ make V=1
make  all-recursive
make[1]: Entering directory '/home/Gergely/amule'
Making all in intl
make[2]: Entering directory '/home/Gergely/amule/intl'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/Gergely/amule/intl'
Making all in po
make[2]: Entering directory '/home/Gergely/amule/po'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/Gergely/amule/po'
Making all in docs
make[2]: Entering directory '/home/Gergely/amule/docs'
Making all in man
make[3]: Entering directory '/home/Gergely/amule/docs/man'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/Gergely/amule/docs/man'
make[3]: Entering directory '/home/Gergely/amule/docs'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/Gergely/amule/docs'
make[2]: Leaving directory '/home/Gergely/amule/docs'
Making all in src
make[2]: Entering directory '/home/Gergely/amule/src'
Making all in libs
make[3]: Entering directory '/home/Gergely/amule/src/libs'
Making all in common
make[4]: Entering directory '/home/Gergely/amule/src/libs/common'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/home/Gergely/amule/src/libs/common'
Making all in ec
make[4]: Entering directory '/home/Gergely/amule/src/libs/ec'
make  all-recursive
make[5]: Entering directory '/home/Gergely/amule/src/libs/ec'
Making all in cpp
make[6]: Entering directory '/home/Gergely/amule/src/libs/ec/cpp'
make  all-am
make[7]: Entering directory '/home/Gergely/amule/src/libs/ec/cpp'
make[7]: Nothing to be done for 'all-am'.
make[7]: Leaving directory '/home/Gergely/amule/src/libs/ec/cpp'
make[6]: Leaving directory '/home/Gergely/amule/src/libs/ec/cpp'
make[6]: Entering directory '/home/Gergely/amule/src/libs/ec'
make[6]: Nothing to be done for 'all-am'.
make[6]: Leaving directory '/home/Gergely/amule/src/libs/ec'
make[5]: Leaving directory '/home/Gergely/amule/src/libs/ec'
make[4]: Leaving directory '/home/Gergely/amule/src/libs/ec'
make[4]: Entering directory '/home/Gergely/amule/src/libs'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/home/Gergely/amule/src/libs'
make[3]: Leaving directory '/home/Gergely/amule/src/libs'
Making all in utils
make[3]: Entering directory '/home/Gergely/amule/src/utils'
make[4]: Entering directory '/home/Gergely/amule/src/utils'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/home/Gergely/amule/src/utils'
make[3]: Leaving directory '/home/Gergely/amule/src/utils'
Making all in pixmaps
make[3]: Entering directory '/home/Gergely/amule/src/pixmaps'
Making all in flags_xpm
make[4]: Entering directory '/home/Gergely/amule/src/pixmaps/flags_xpm'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/home/Gergely/amule/src/pixmaps/flags_xpm'
make[4]: Entering directory '/home/Gergely/amule/src/pixmaps'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/home/Gergely/amule/src/pixmaps'
make[3]: Leaving directory '/home/Gergely/amule/src/pixmaps'
Making all in skins
make[3]: Entering directory '/home/Gergely/amule/src/skins'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/Gergely/amule/src/skins'
make[3]: Entering directory '/home/Gergely/amule/src'
cat ../amule.rc amule-version.rc | \
( \
        abs_builddir=`pwd` ; \
        abs_top_srcdir=`cd .. ; pwd` ; \
        cd .. ; \
        windres -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DWXUSINGDLL -D__WXGTK__  -D__DEBUG__ -I${abs_top_srcdir}  -O COFF -o "${abs_builddir}/amulerc.o" ; \
)
g++ -g -W -Wall -Wshadow -Wundef -ggdb -fno-inline -fmessage-length=0      -o amule.exe amule-CaptchaDialog.o amule-CaptchaGenerator.o amule-PartFileConvert.o amule-PartFileConvertDlg.o amule-amule.o amule-BaseClient.o amule-ClientList.o amule-ClientCreditsList.o amule-ClientTCPSocket.o amule-ClientUDPSocket.o amule-CorruptionBlackBox.o amule-DownloadClient.o amule-DownloadQueue.o amule-ECSpecialCoreTags.o amule-EMSocket.o amule-EncryptedStreamSocket.o amule-EncryptedDatagramSocket.o amule-ExternalConn.o amule-FriendList.o amule-IPFilter.o amule-KnownFileList.o amule-ListenSocket.o amule-MuleUDPSocket.o amule-SearchFile.o amule-SearchList.o amule-ServerConnect.o amule-ServerList.o amule-ServerSocket.o amule-ServerUDPSocket.o amule-SHAHashSet.o amule-SharedFileList.o amule-ThreadTasks.o amule-UploadBandwidthThrottler.o amule-UploadClient.o amule-UploadQueue.o amule-Kademlia.o amule-Prefs.o amule-Search.o amule-UDPFirewallTester.o amule-KademliaUDPListener.o amule-PacketTracking.o amule-Contact.o amule-RoutingZone.o amule-amule-gui.o amule-amuleDlg.o amule-AddFriend.o amule-CatDialog.o amule-ChatSelector.o amule-ChatWnd.o amule-CommentDialog.o amule-CommentDialogLst.o amule-GenericClientListCtrl.o amule-ClientDetailDialog.o amule-DirectoryTreeCtrl.o amule-FileDetailDialog.o amule-KadDlg.o amule-OScopeCtrl.o amule-PrefsUnifiedDlg.o amule-SearchDlg.o amule-ServerWnd.o amule-SharedFilesWnd.o amule-StatisticsDlg.o amule-SearchListCtrl.o amule-DownloadListCtrl.o amule-SourceListCtrl.o amule-SharedFilePeersListCtrl.o amule-FriendListCtrl.o amule-ServerListCtrl.o amule-SharedFilesCtrl.o amule-MuleTrayIcon.o amule-TransferWnd.o amule-amuleAppCommon.o amule-ClientRef.o amule-ECSpecialMuleTags.o amule-KnownFile.o amule-GetTickCount.o amule-GuiEvents.o amule-HTTPDownload.o amule-Logger.o amule-PartFile.o amule-Preferences.o amule-Proxy.o amule-Server.o amule-Statistics.o amule-StatTree.o amule-UserEvents.o -L. -lmuleappcommon -Llibs/common -Llibs/ec/cpp -lmulecommon -lec -lbfd -liberty -lintl -lz  -lz  -lmulesocket    -lcryptopp -L. -lmuleappcore   -lshlwapi -L. -lmuleappgui -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_net-2.8 -lwx_baseu-2.8    amulerc.o
/usr/lib/gcc/i686-pc-cygwin/5.4.0/../../../../i686-pc-cygwin/bin/ld: cannot find -lcryptopp
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:1127: amule.exe] Error 1
make[3]: Leaving directory '/home/Gergely/amule/src'
make[2]: *** [Makefile:5336: all-recursive] Error 1
make[2]: Leaving directory '/home/Gergely/amule/src'
make[1]: *** [Makefile:532: all-recursive] Error 1
make[1]: Leaving directory '/home/Gergely/amule'
make: *** [Makefile:426: all] Error 2

Gergely@Gergely-PC ~/amule
$
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 164
  • Offline Offline
  • Posts: 2703
Re: Trouble compiling in Cygwin
« Reply #5 on: November 10, 2016, 07:34:08 AM »

Please make sure libcryptopp.a is in /usr/local/lib.
Logged
concordia cum veritate

exaghost

  • Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
Re: Trouble compiling in Cygwin
« Reply #6 on: November 10, 2016, 10:01:42 AM »

It was not there. Just "lcryptopp.a". After I make a nother copy of that with "libcryptopp.a" in the same dir, output is 100% the same. Even, if I leave only "libcryptopp.a" in there. (There is also "libupnp.a" but amule can not see it.)
Logged

exaghost

  • Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
Re: Trouble compiling in Cygwin
« Reply #7 on: November 20, 2016, 01:04:27 PM »

Nos ? :)
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 164
  • Offline Offline
  • Posts: 2703
Re: Trouble compiling in Cygwin
« Reply #8 on: November 21, 2016, 11:47:15 AM »

Okay, I finally managed to build a working version under Cygwin. After installing the required packages:

Crypto++ (5.6.4):
Code: [Select]
$ make PREFIX="$HOME/local/cygwin32"
$ ./cryptest.exe v
$ ./cryptest.exe tv all
$ make install PREFIX="$HOME/local/cygwin32"

The cryptest.exe lines are not strictly required, but it's wise to test the build before installing ;)

aMule:
Code: [Select]
$ export CXXFLAGS="-Wno-unused-local-typedefs"      # save some warnings from wxWidgets-2.8
$ ./configure \
    --with-wx-config=wx-config-2.8 \
    --with-crypto-prefix="$HOME/local/cygwin32" \
    --enable-silent-rules \
    --enable-optimize \
    --enable-debug \
    --enable-mmap \
    --disable-geoip \
    --disable-upnp \
    --enable-monolithic \
    --enable-amule-daemon \
    --enable-amule-gui \
    --enable-webserver \
    --enable-amulecmd \
    --enable-cas \
    --enable-wxcas \
    --enable-alc \
    --enable-alcc \
    --enable-fileview

$ make

UPnP and GeoIP support is yet untested. You can choose any location for the cryptopp installation, just use the same prefix in aMule configure options. Or do not install at all and point --with-crypto-prefix to the cryptopp build directory.
Logged
concordia cum veritate