owncloud / client

🖥️ Desktop Syncing Client for ownCloud
GNU General Public License v2.0
1.4k stars 665 forks source link

Building the client for windows raises an error [src/CMakeFiles/owncloud.dir/all] Error 2 #1412

Closed Panthro closed 10 years ago

Panthro commented 10 years ago

I have tried all I could with the instructions provided at: https://github.com/owncloud/mirall/blob/master/doc/building.rst

Every single attempt have lead to the same error.

I have tried with the source packages in the page http://owncloud.org/sync-clients/ I have tried with what's in the master from github, absolutely nothing works.

Let me share my command sequence first, so if you find anything wrong just by the commands there's no need to read the rest

commands:

wget http://download.owncloud.com/desktop/stable/ocsync-0.91.4.tar.bz2
wget http://download.owncloud.com/desktop/stable/mirall-1.5.0.tar.bz2
tar -xvf ocsync-0.91.4.tar.bz2
mv ocsync-0.91.4 ocsync
tar -xvf mirall-1.5.0.tar.bz2
mv mirall-1.5.0 mirall
mkdir ocsync-build
mkdir mirall-build
cd ocsync-build/
mingw32-cmake -DCMAKE_BUILD_TYPE="Debug" ../ocsync
make
cd ../mirall-build
cmake -DCMAKE_BUILD_TYPE="Debug" ../mirall       -DCSYNC_BUILD_PATH=/root/owncloud/ocsync-build       -DCSYNC_INCLUDE_PATH=/root/owncloud/ocsync/src   -DCMAKE_TOOLCHAIN_FILE=../mirall/admin/win/Toolchain-mingw32-openSUSE.cmake
make

Now the outputs (with commands)

mingw32-cmake -DCMAKE_BUILD_TYPE="Debug" ../ocsync

====================================
-- The C compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/i686-w64-mingw32-gcc
-- Check for working C compiler: /usr/bin/i686-w64-mingw32-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Performing Test WITH_FPIC
-- Performing Test WITH_FPIC - Success
-- Performing Test WITH_STACK_PROTECTOR
-- Performing Test WITH_STACK_PROTECTOR - Success
-- Could NOT find CMocka (missing:  CMOCKA_LIBRARIES CMOCKA_INCLUDE_DIR)
-- Looking for argp.h
-- Looking for argp.h - not found
-- Looking for nanosleep in rt
-- Looking for nanosleep in rt - not found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - not found
-- Looking for dlopen in dl
-- Looking for dlopen in dl - not found
-- Looking for asprintf
-- Looking for asprintf - not found
-- Looking for fnmatch
-- Looking for fnmatch - not found
-- Looking for timegm
-- Looking for timegm - not found
-- Looking for strerror_r
-- Looking for strerror_r - not found
-- Looking for utimes
-- Looking for utimes - not found
-- Looking for lstat
-- Looking for lstat - not found
-- Looking for __mingw_asprintf
-- Looking for __mingw_asprintf - found
-- Copy file from /root/owncloud/ocsync/CTestCustom.cmake to /root/owncloud/ocsync-build/CTestCustom.cmake
-- The CXX compiler identification is GNU 4.8.2
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-g++
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PKG_CONFIG: /usr/bin/pkg-config (found version "0.25")
-- checking for module 'neon'
--   found neon, version 0.30.0
-- Found Neon: /usr/i686-w64-mingw32/sys-root/mingw/lib/libneon.dll.a
-- neon-config executable: /usr/i686-w64-mingw32/sys-root/mingw/bin/neon-config
-- libneon has been compiled with LFS support
-- Found SQLite3: /usr/i686-w64-mingw32/sys-root/mingw/lib/libsqlite3.dll.a (Required is at least version "3.3.9")
-- Found Neon: /usr/i686-w64-mingw32/sys-root/mingw/lib/libneon.dll.a (Required is at least version "0.29.0")
-- neon-config executable: /usr/i686-w64-mingw32/sys-root/mingw/bin/neon-config
-- libneon has been compiled with LFS support
-- Copy file from /root/owncloud/ocsync/config/ocsync.conf to /root/owncloud/ocsync-build/config/ocsync.conf
-- Copy file from /root/owncloud/ocsync/config/ocsync_exclude.conf to /root/owncloud/ocsync-build/config/ocsync_exclude.conf
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE)
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    SHARE_INSTALL_DIR

-- Build files have been written to: /root/owncloud/ocsync-build
=============================================================
make
=============================================================
[...]
Linking CXX shared library libocsync.dll
cd /root/owncloud/ocsync-build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/ocsync.dir/link.txt --verbose=1
/usr/bin/cmake -E remove -f CMakeFiles/ocsync.dir/objects.a
/usr/bin/i686-w64-mingw32-ar cr CMakeFiles/ocsync.dir/objects.a @CMakeFiles/ocsync.dir/objects1.rsp
/usr/bin/i686-w64-mingw32-g++    -Wl,--exclude-libs=libintl.a -Wl,--exclude-libs=libiconv.a -Wl,--no-keep-memory -shared -o libocsync.dll -Wl,--out-implib,libocsync.dll.a -Wl,--major-image-version,0,--minor-image-version,2 -Wl,--whole-archive CMakeFiles/ocsync.dir/objects.a -Wl,--no-whole-archive std/libcstdlib.a -lshlwapi -lpsapi -lkernel32 -lsqlite3 -lneon httpbf/libhttpbf.a -Wl,-Bstatic -lshlwapi -Wl,-Bdynamic -lneon -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
make[2]: Leaving directory `/root/owncloud/ocsync-build'
/usr/bin/cmake -E cmake_progress_report /root/owncloud/ocsync-build/CMakeFiles  10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
[100%] Built target ocsync
make[1]: Leaving directory `/root/owncloud/ocsync-build'
/usr/bin/cmake -E cmake_progress_start /root/owncloud/ocsync-build/CMakeFiles 0
================================================================
cmake -DCMAKE_BUILD_TYPE="Debug" ../mirall \
      -DCSYNC_BUILD_PATH=/root/owncloud/ocsync-build \
      -DCSYNC_INCLUDE_PATH=/root/owncloud/ocsync/src \
      -DCMAKE_TOOLCHAIN_FILE=../mirall/admin/win/Toolchain-mingw32-openSUSE.cmake

=================================================================
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/i686-w64-mingw32-gcc
-- Check for working C compiler: /usr/bin/i686-w64-mingw32-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-g++
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Could not find Qt5, searching for Qt4 instead...
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - not found.
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found.
-- Found OpenGL: opengl32
-- Found ZLIB: /usr/i686-w64-mingw32/sys-root/mingw/lib/libz.dll.a (found version "1.2.8")
-- Found PNG: /usr/i686-w64-mingw32/sys-root/mingw/lib/libpng.dll.a (found version "1.5.17")
-- Could NOT find JPEG (missing:  JPEG_LIBRARY JPEG_INCLUDE_DIR)
-- Could NOT find TIFF (missing:  TIFF_LIBRARY TIFF_INCLUDE_DIR)
-- Found Qt4: i686-w64-mingw32-qmake (found suitable version "4.8.4", required is "4.7.0")
58035a2f4a3100b824597d8d490801845bbd22f9
-- Found PKG_CONFIG: /usr/bin/pkg-config (found version "0.25")
-- checking for module 'neon'
--   package 'neon' not found
-- Found Neon: /usr/i686-w64-mingw32/sys-root/mingw/lib/libneon.dll.a
-- neon-config executable: /usr/i686-w64-mingw32/sys-root/mingw/bin/neon-config
-- libneon has been compiled with LFS support
-- Found Csync: /root/owncloud/ocsync-build/src/libocsync.dll
-- Found QtKeyChain: /usr/i686-w64-mingw32/sys-root/mingw/bin/libqtkeychain.dll
-- Could NOT find INOTIFY (missing:  INOTIFY_INCLUDE_DIR)
-- Could NOT find Sphinx (missing:  SPHINX_EXECUTABLE)
-- Could NOT find PdfLatex (missing:  PDFLATEX_EXECUTABLE)
-- Configuring done
-- Generating done
-- Build files have been written to: /root/owncloud/mirall-build
====================================================================
make
====================================================================
    Generated 384 translation(s) (384 finished and 0 unfinished)
[ 68%] Generating mirall_hu.qm
Updating '/root/owncloud/mirall-build/src/mirall_hu.qm'...
    Generated 194 translation(s) (194 finished and 0 unfinished)
    Ignored 190 untranslated source text(s)
[ 69%] Generating mirall_it.qm
Updating '/root/owncloud/mirall-build/src/mirall_it.qm'...
    Generated 384 translation(s) (384 finished and 0 unfinished)
[ 69%] Generating 3rdparty/qtsingleapplication/moc_qtlocalpeer.cxx
[ 70%] Generating 3rdparty/qtsingleapplication/moc_qtsingleapplication.cxx
[ 70%] Generating 3rdparty/qtsingleapplication/moc_qtsinglecoreapplication.cxx
[ 71%] Generating 3rdparty/fancylineedit/moc_fancylineedit.cxx
[ 71%] Generating 3rdparty/QProgressIndicator/moc_QProgressIndicator.cxx
[ 72%] Generating ownCloud_res.o
/bin/sh: line 1: 17530 Segmentation fault      /usr/bin/i686-w64-mingw32-windres -i /root/owncloud/mirall-build/src/ownCloud.rc -o /root/owncloud/mirall-build/src/ownCloud_res.o --include-dir=/root/owncloud/mirall/src
make[2]: *** [src/ownCloud_res.o] Error 139
make[1]: *** [src/CMakeFiles/owncloud.dir/all] Error 2
make: *** [all] Error 2
DeepDiver1975 commented 10 years ago

@Panthro on which distro are you trying to build?

Here is a blog about building mirall in a vagrant box using opensuse : http://deepdiver1975.wordpress.com/2013/12/05/building-the-owncloud-client-for-windows-on-opensuse-12-3-using-a-vagrant-box/

Maybe this helps.

dragotin commented 10 years ago

Yes, it seems to be an issue on your build setup as one tool seems to segfault:

/bin/sh: line 1: 17530 Segmentation fault      /usr/bin/i686-w64-mingw32-windres -i /root/owncloud/mirall-build/src/ownCloud.rc -o /root/owncloud/mirall-build/src/ownCloud_res.o --include-dir=/root/owncloud/mirall/src
make[2]: *** [src/ownCloud_res.o] Error 139

But please seek out for help on this on mailinglist or forum, not here in the bugtracker. Thanks.

Panthro commented 10 years ago

@DeepDiver1975 it was OpenSuse 12.2 on an ec2 instance.

@dragotin Didn't mean to say that the app itself has an issue, but at least the documentation does, as it's extremely hard for someone without opensuse (or any rpm based) knowledge to sucessfully cross compile.

dragotin commented 10 years ago

Yes, maybe, but honestly, cross compiling is not an easy thing. But how can we solve this problem? openSUSE has that great set of packages which make it comparably easy to compile the client for windows. If other distros don't offer that, I mean, that is not our fault, right? We try to use the easiest way to work with.

You could ask at your distro if they have cross compile packages, figure out how to use them and help us documenting it.

But see what @DeepDiver1975 posted, that should help you along.

Panthro commented 10 years ago

Cross compiling is a nightmare lol

Already working on that link, looks promising, I'll post any feedback.

One of the reasons I posted the issue here is to open up the issue to the Google world! :+1:

Panthro commented 10 years ago

And also, I only came here after 4 hours of digging, searching, trying....tried 2 different distros of open suse, trie 32b and 64b versions, some packages I had to find using rpmfind (which seriously I think it's the issue).

I have no idea if ubuntu have got this sort of things, but would be lovely to have something like:

apt-get install owncloud-client-build
git clone bla bla bla
cmake
make
kwillems commented 10 years ago

Experiencing the same kind of challenge when compiling I've made a set of bash scripts that might come in handy when (cross) compiling. One can also code sign and theme the clients. See http://owncloud.10557.n7.nabble.com/Build-scripts-desktop-clients-td13112.html and https://github.com/owncloud/administration/tree/master/build-clients The scripts a full of comments and there's a general manual.