Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JUCE compilation error under Windows (Continuous Integration) #47

Closed
SuslikV opened this issue Apr 26, 2019 · 2 comments
Closed

JUCE compilation error under Windows (Continuous Integration) #47

SuslikV opened this issue Apr 26, 2019 · 2 comments

Comments

@SuslikV
Copy link

SuslikV commented Apr 26, 2019

How to get rid of this?

C:/projects/libopenshot-audio/JuceLibraryCode/modules/juce_core/text/juce_CharPointer_UTF8.h:477:27: error: 'atoll' was not declared in this scope
         return atoll (data);

What do mingw needs to find the std lib and the function?


Additional info
I'm trying to build libopenshot-audio using appveyor with the next scripts:

libopenshot-audio/CI/install-win-av.cmd

REM For appveyor.com
REM mute output
@echo off

cd %APPVEYOR_BUILD_FOLDER%

REM leave some space
echo.
echo Platform: %PLATFORM%
echo Default build folder: %APPVEYOR_BUILD_FOLDER%
echo.

REM we need to update PATH with MSYS2 dirs, also it resolves ZLIB dependency
set PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH%

REM let us see what is installed within MSYS2
bash -lc "pacman -Q"

REM Add doxygen dependencies
REM bash -lc "pacman -S --needed --noconfirm mingw64/mingw-w64-x86_64-doxygen"
REM
REM let us see what is installed now within MSYS2
REM bash -lc "pacman -Q"

REM unmute output
@echo on

libopenshot-audio/CI/build-win-av.cmd


REM Building script

REM status
echo
REM Some space
echo.

REM Let us see what we have as environment here
echo %PATH%
echo.
cd 

REM cmake will unable to compile without "MinGW\bin" path to PATH
set PATH=C:\MinGW\bin;%PATH%
echo.
echo PATH environment variable was updated.
echo %PATH%
echo.

REM Make new building dir
mkdir %APPVEYOR_BUILD_FOLDER%\build
cd %APPVEYOR_BUILD_FOLDER%\build

cmake --version
cmake -G "MinGW Makefiles" -DCMAKE_SH="CMAKE_SH-NOTFOUND" ..
mingw32-make
mingw32-make install

libopenshot-audio/appveyor.yml

#---------------------------------#
#      general configuration      #
#---------------------------------#

# version format
version: "{build}"

# branches to build 
branches:
  # whitelist
  only:
    - patch-1
  # blacklisted
  except:
    - /.*/    # exclude all branches but whitelisted
    
#---------------------------------#
#    environment configuration    #
#---------------------------------#

# Build worker image (VM template)
image:
  - Visual Studio 2015

# environment variables
environment:
  matrix:
    - platform: x86
      configuration: Release

# scripts that run after cloning repository
install:
  # running under CI
  - set CI_TESTING=1
  - cmd: '%APPVEYOR_BUILD_FOLDER%\CI\install-win-av.cmd'
  - 'echo End install at: & time /t'

# Build settings
build: off # disable MSBuild

# to run custom scripts instead of automatic MSBuild
build_script:
  - 'echo We are building...'
  - cmd: '%APPVEYOR_BUILD_FOLDER%\CI\build-win-av.cmd'
  - 'echo End building at: & time /t'


test: off

build log itself: https://ci.appveyor.com/project/SuslikV/libopenshot-audio/builds/24124334

@SuslikV
Copy link
Author

SuslikV commented Apr 28, 2019

So, nobody knows? What I found is that in CMakeLists.txt next strings

#### Enable C++11 (for JUCE)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

explicitly adds the "-std=c++11" key into the g++ output command line and thus the -std=gnu++11 (required under MinGW Windows) when specified, was added as two keys: -std=gnu++11 -std=c++11 instead of replace the second one. And definitely, there is no atoll in stdlib when -DCMAKE_CXX_FLAGS="-std=c++11" is used. There is only atol. So, when I removed the mentioned strings from CMakeLists.txt the -std=gnu++11 was automatically added and compilation continues. Edit: it is just enough to comment out the - set(CMAKE_CXX_EXTENSIONS OFF)

Now, I have number of link errors (see below) to zlib.

...
undefined reference to `inflateInit2_'
...
collect2.exe: error: ld returned 1 exit status

Any clues?

I simply tried to follow the wiki instructions to build under the Windows (MinGW) https://github.com/OpenShot/libopenshot/wiki/Windows-Build-Instructions

@SuslikV
Copy link
Author

SuslikV commented Apr 28, 2019

OK. I solved it by renaming static libs C:\msys64\mingw64\lib\libz.dll.a nofile.dll.a and C:\msys64\mingw64\lib\libz.a , thus cmake finds C:/MinGW/bin/zlib1.dll instead.

Edit: the log with all mentioned changes in code:
https://ci.appveyor.com/project/SuslikV/libopenshot-audio/builds/24157962

Edit2: I wrongly used old MinGW 32 from the CI environment, so messed up with the compile and "bitness". By adding C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\bin to path - the problem with the zlib linking was solved.

Edit3: even not by adding, just by removing the path to MinGW 32 that I mistakenly added earlier.

@SuslikV SuslikV closed this as completed Apr 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant