Lmms: Error while compiling on windows

Created on 11 Nov 2016  路  14Comments  路  Source: LMMS/lmms

$ ../cmake/build_mingw64.sh

Custom cmake vars: (blank = system default)
-----------------------------------------
* CMAKE_C_COMPILER                     : /mingw64/bin/gcc
* CMAKE_CXX_COMPILER                   : /mingw64/bin/g++
* CMAKE_RC_COMPILER                    : /mingw64/bin/windres
* WINDRES                              : /mingw64/bin/windres
* ENV{PKG_CONFIG}                      :
* MINGW_TOOL_PREFIX32                  :
* CMAKE_C_COMPILER32                   : /mingw32/bin/gcc
* CMAKE_CXX_COMPILER32                 : /mingw32/bin/g++
* STRIP                                : /mingw64/bin/strip
* QT_BINARY_DIR                        : /mingw64/bin
* QT_QMAKE_EXECUTABLE                  : /mingw64/bin/qmake

-- The C compiler identification is GNU 6.2.0
-- The CXX compiler identification is GNU 6.2.0
-- Check for working C compiler: /mingw64/bin/gcc
-- Check for working C compiler: /mingw64/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /mingw64/bin/g++
-- Check for working CXX compiler: /mingw64/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /opt/mingw64/bin/x86_64-w64-mingw32-pkg-config
-- Found Git: /usr/bin/git.exe (found version "2.10.1")

Configuring LMMS
--------------------------
* Project version             : 1.1.90.437
*   Major version             : 1
*   Minor version             : 1
*   Release version           : 90
*   Stage version             :
*   Build version             : 437
*

Optional Version Usage:
--------------------------
*   Override version:           -DFORCE_VERSION=x.x.x-x
*   Ignore Git information:     -DFORCE_VERSION=internal

PROCESSOR: x86_64
-- Target host is 64 bit
-- Looking for include file stdint.h
-- Looking for include file stdint.h - found
-- Looking for include file stdlib.h
-- Looking for include file stdlib.h - found
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for include file semaphore.h
-- Looking for include file semaphore.h - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file sys/types.h
-- Looking for include file sys/types.h - found
-- Looking for include file sys/ipc.h
-- Looking for include file sys/ipc.h - not found
-- Looking for include file sys/shm.h
-- Looking for include file sys/shm.h - not found
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - found
-- Looking for include file sched.h
-- Looking for include file sched.h - found
-- Looking for include file sys/soundcard.h
-- Looking for include file sys/soundcard.h - not found
-- Looking for include file soundcard.h
-- Looking for include file soundcard.h - not found
-- Looking for include file fcntl.h
-- Looking for include file fcntl.h - found
-- Looking for include file sys/ioctl.h
-- Looking for include file sys/ioctl.h - not found
-- Looking for include file ctype.h
-- Looking for include file ctype.h - found
-- Looking for include file string.h
-- Looking for include file string.h - found
-- Looking for include file process.h
-- Looking for include file process.h - found
-- Looking for include file locale.h
-- Looking for include file locale.h - found
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - not found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not 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: /mingw64/lib/libz.dll.a (found version "1.2.8")
-- Found PNG: /mingw64/lib/libpng.dll.a (found version "1.6.17")
-- Found JPEG: /mingw64/lib/libjpeg.dll.a
-- Found Qt4: /mingw64/bin/qmake (found suitable version "4.8.7", minimum required is "4.6.0;COMPONENTS;QtCore;QtGui;QtXml")
-- Found Qt translations in /mingw64/share/qt4/translations/
-- Checking for module 'sndfile>=1.0.11'
--
CMake Error at /usr/share/cmake-3.6.2/Modules/FindPkgConfig.cmake:424 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.6.2/Modules/FindPkgConfig.cmake:597 (_pkg_check_modules_internal)
  CMakeLists.txt:181 (PKG_CHECK_MODULES)


-- Configuring incomplete, errors occurred!
See also "/home/pop/lmms/build/CMakeFiles/CMakeOutput.log".
See also "/home/pop/lmms/build/CMakeFiles/CMakeError.log".

Most helpful comment

By rebuilding a few of the libraries from source and suppressing their install from the repository, I was able to get a compile without errors except malletstk didn't build. Better not build than exit with an error though. That at least gives us a cause and solution. I'll set up a fork and start working on an implementation.

All 14 comments

I think you need to find the arch linux equivalent of Ubuntu's
"libsndfile1-dev". Since Arch includes dev stuff in the regular package
(afaik) you could try:

'pacman -S libsndfile'

Thanks @Spekular. We actually get that dependency from toby's PPA which is located here:

https://launchpad.net/~tobydox/+archive/ubuntu/mingw-x-trusty

This is done with the unorthodox fetch_ppa.sh script which grabs the precompiled binaries intended for mingw on Linux and saves them to Windows.

I would start by troubleshooting that script.

Afterward, there's another script which does some clobbering of dependencies called msys_helper.sh.

See if there are any errors in these scripts. They should be safe to run multiple times.

Hey, I added the libsndfile-1.dll in the C:WindowsSysWOW64 directory which solved the libsndfile problem , but now i get this Error:

 Please install the fluid binary which is part of FLTK.

previously I had build error for FLTK when running msys_helper.sh script , as follows:

~/fltk-1.3.3 ~

  - Compiling fltk 1.3.3...
checking build system type... x86_64-pc-mingw32
checking host system type... x86_64-pc-mingw32
checking for gcc... D:\GAMES\support\mingw32\mingw32\bin\gcc.exe
checking whether the C compiler works... no
configure: error: in `/home/pop/fltk-1.3.3':
configure: error: C compiler cannot create executables
See `config.log' for more details
=== making src ===
=== making fluid ===
Linking fluid.exe...
CodeEditor.o: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
make[1]: *** [Makefile:51: fluid.exe] Error 1
make: *** [Makefile:24: all] Error 1

  - Installing fltk...
=== installing FL ===
Installing include files in /mingw32/usr/local/include...
=== installing src ===
Installing libraries in /mingw32/usr/local/lib...
=== installing fluid ===
Linking fluid.exe...
CodeEditor.o: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
make[1]: *** [Makefile:51: fluid.exe] Error 1
make: *** [Makefile:33: install] Error 1

ERROR: Could not build/install fltk -- Zyn needs this.  Exiting.

So maybe now the problem is in building FLTK

@Volumie please use ``` tags around your console output when you paste. I've done this for you for your last two posts.

Hey, I added the libsndfile-1.dll in the C:WindowsSysWOW64 directory

Don't do this! First, this doesn't help the project at all, you've placed a bandaid over a broken build process instead of helping us fix it. If you want to help, the help starts there. Don't make a mess of your build system.

Please install the fluid binary which is part of FLTK.

I think this is a symptom of the same problem you had with libsndfile-1.dll.

C compiler cannot create executables

This time around did you by chance accidentally launch from MSYS terminal and not the mingw shortcut?

yeah , sure and sorry man I am a noob .. trying to learn thing ... thank you for pointing out , i will keep that in mind from next time. And I ran msys_helper.sh script from mingw64.exe

yup you were right i ran msys_helper.sh from MSYS :P . So now, after i run msys_helper.sh from mingw64.exe, I am getting something like this:

../lib/libfltk_images.a(Fl_PNM_Image.o):Fl_PNM_Image.cxx:(.text$_ZN12Fl_PNM_ImageC2EPKc+0x5d5): undefined reference to `_fclose'
../lib/libfltk_images.a(Fl_PNM_Image.o):Fl_PNM_Image.cxx:(.text$_ZN12Fl_PNM_ImageC2EPKc+0x647): undefined reference to `_getc'
../lib/libfltk_images.a(Fl_PNM_Image.o):Fl_PNM_Image.cxx:(.text$_ZN12Fl_PNM_ImageC2EPKc+0x664): undefined reference to `_fclose'
../lib/libfltk_images.a(Fl_PNM_Image.o):Fl_PNM_Image.cxx:(.text$_ZN12Fl_PNM_ImageC2EPKc+0x680): undefined reference to `_fread'
../lib/libfltk_images.a(Fl_PNM_Image.o):Fl_PNM_Image.cxx:(.rdata$_ZTI12Fl_PNM_Image[__ZTI12Fl_PNM_Image]+0x0): undefined reference to `__ZTVN10__cxxabiv120__si_class_type_infoE'
D:/GAMES/support/mysys(lmms_compile)/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): In function `main':
/build/buildd/mingw-x-runtime-4.0.2/BUILD/64/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [Makefile:51: fluid.exe] Error 1
make: *** [Makefile:33: install] Error 1

ERROR: Could not build/install fltk -- Zyn needs this.  Exiting.

Well, i dont have much knowledge about cmake. Maybe this could be the solution: http://stackoverflow.com/questions/23918318/undefined-reference-to-winmain-in-cygwin

@Volumie we're here to help but we have very few (< 3) people that read our bug tracker that have successfully compiled on Windows, so we need help here and a lot of this is trial and error.

I understand you probably want to get to coding right away. You can on Linux and Mac. Windows however was never part of the build design. We're open to recommendations.

In regards to this specific issue you could do a few things... one is completely removing the ZynAddSubFX, or if you'd like all non-essential plugins using -DLMMS_MINIMAL=True as a cmake flag or provide the plugin list manually via -DPLUGIN_LIST="audio_file_processor kicker triple_oscillator".

If you'd rather fix the underlying problem, I'd recommend you start the build over from scratch using the proper terminal (rm CMakeCache.txt) and see if this message goes away.

yeah okay I will try it thank you for your time @tresf .

@Volumie this may still be a bug with our Windows build tools. Reopening until we've ruled otherwise. 馃憤

I ran into a few of these too. The problem with sndfile isn't with sndfile. It's with pkg-config. I'm pasting the errors I received and what I did to fix them below

```-- Found PkgConfig: /opt/mingw64/bin/x86_64-w64-mingw32-pkg-config

CMake Error at /usr/share/cmake-3.6.2/Modules/FindPkgConfig.cmake:424 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-3.6.2/Modules/FindPkgConfig.cmake:597 (_pkg_check_modules_internal)
CMakeLists.txt:177 (PKG_CHECK_MODULES)

$ mkdir -p /opt/mingw64/bin/

$ cp /usr/bin/pkg-config /opt/mingw64/bin/x86_64-w64-mingw32-pkg-config

-- Could NOT find FLTK (missing: FLTK_FLUID_EXECUTABLE)

$ cp /mingw64/mingw64/bin/fl* /mingw64/bin/

[ 73%] Linking CXX shared module ../gigplayer.dll
CMakeFiles/gigplayer.dir/objects.a(GigPlayer.cpp.obj):GigPlayer.cpp:(.text+0x9059): undefined reference to `RIFF::File::File(std::__cxx11::basic_string, std::allocator > const&)'
collect2.exe: error: ld returned 1 exit status
make[2]: * [plugins/GigPlayer/CMakeFiles/gigplayer.dir/build.make:205: plugins/gigplayer.dll] Error 1
make[1]:
[CMakeFiles/Makefile2:7149: plugins/GigPlayer/CMakeFiles/gigplayer.dir/all] Error 2
make: *
* [Makefile:150: all] Error 2

[ 79%] Linking CXX shared module ../../malletsstk.dll
/mingw64/lib/libstk.a(BandedWG.o): duplicate section .rdata$_ZTVN3stk8InstrmntE[_ZTVN3stk8InstrmntE]' has different size /mingw64/lib/libstk.a(BandedWG.o): duplicate section.rdata$_ZTVN3stk8FunctionE[_ZTVN3stk8FunctionE]' has different size
/mingw64/lib/libstk.a(BandedWG.o): duplicate section .rdata$_ZTVN3stk8BowTableE[_ZTVN3stk8BowTableE]' has different size /mingw64/lib/libstk.a(FM.o): duplicate section.rdata$_ZTVN3stk8InstrmntE[_ZTVN3stk8InstrmntE]' has different size
/mingw64/lib/libstk.a(ModalBar.o): duplicate section .rdata$_ZTVN3stk8InstrmntE[_ZTVN3stk8InstrmntE]' has different size /mingw64/lib/libstk.a(TubeBell.o): duplicate section.rdata$_ZTVN3stk8InstrmntE[_ZTVN3stk8InstrmntE]' has different size
/mingw64/lib/libstk.a(Modal.o): duplicate section .rdata$_ZTVN3stk8InstrmntE[_ZTVN3stk8InstrmntE]' has different size CMakeFiles/malletsstk.dir/objects.a(mallets.cpp.obj):mallets.cpp:(.text+0x6e87): undefined reference tostk::Stk::setRawwavePath(std::__cxx11::basic_string, std::allocator >)'
CMakeFiles/malletsstk.dir/objects.a(mallets.cpp.obj):mallets.cpp:(.text+0x7215): undefined reference to stk::Stk::setRawwavePath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)' CMakeFiles/malletsstk.dir/objects.a(mallets.cpp.obj):mallets.cpp:(.text+0x75e5): undefined reference tostk::Stk::setRawwavePath(std::__cxx11::basic_string, std::allocator >)'
CMakeFiles/malletsstk.dir/objects.a(mallets.cpp.obj):mallets.cpp:(.rdata$.refptr._ZN3stk3Stk8oStream_B5cxx11E[.refptr._ZN3stk3Stk8oStream_B5cxx11E]+0x0): undefined reference to `stk::Stk::oStream_[abi:cxx11]'
collect2.exe: error: ld returned 1 exit status
make[2]: * [plugins/stk/mallets/CMakeFiles/malletsstk.dir/build.make:140: plugins/malletsstk.dll] Error 1
make[1]:
[CMakeFiles/Makefile2:7503: plugins/stk/mallets/CMakeFiles/malletsstk.dir/all] Error 2
make: *
* [Makefile:150: all] Error 2

```

cp /usr/bin/pkg-config /opt/mingw64/bin/x86_64-w64-mingw32-pkg-config

I would recommend ln -s over copying.

cp /mingw64/mingw64/bin/fl* /mingw64/bin/

Same, I would recommend ln -s over copying however this suggest there may be something wrong with the PATH. If so, correcting PATH would be much less intrusive (or add directory to CMAKE_PREFIX_PATH, etc.)

/mingw64/lib/libstk.a(BandedWG.o): duplicate section.rdata$_ZTVN3stk8InstrmntE[_ZTVN3stk8InstrmntE]' has different size`

Hmm... Interesting, I had to do this on Debug builds, but I'd recommend you just omit STK from the build until we can find a better way to (build and) host these binaries. Had it been built by MSYS2 itself, I don't think this problem would occur.

with fluid, adding

--prefix=/mingw64

to the configure line and removing the destdir arguement solves the problem entirely. I just wasn't sure if that was required for the cross compile under linux so I was trying not to modify build_mingw64.sh I am building some of the libraries now trying to see if that will fix the build problems with gigplayer

By rebuilding a few of the libraries from source and suppressing their install from the repository, I was able to get a compile without errors except malletstk didn't build. Better not build than exit with an error though. That at least gives us a cause and solution. I'll set up a fork and start working on an implementation.

Closed by #3369

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Firepal picture Firepal  路  3Comments

mikobuntu picture mikobuntu  路  4Comments

binyominzeev picture binyominzeev  路  3Comments

Sawuare picture Sawuare  路  3Comments

mnini picture mnini  路  3Comments