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

Fails to compile with clang #1270

Closed
yurivict opened this issue Sep 24, 2016 · 11 comments
Closed

Fails to compile with clang #1270

yurivict opened this issue Sep 24, 2016 · 11 comments
Assignees
Milestone

Comments

@yurivict
Copy link

WIth version 1.1.9, getting this error with clang-36 and clang-38:

In file included from /usr/ports/graphics/aseprite/work/aseprite-1.1.9/src/app/app_menus.cpp:11:
In file included from /usr/ports/graphics/aseprite/work/aseprite-1.1.9/src/./app/app_menus.h:15:
In file included from /usr/ports/graphics/aseprite/work/aseprite-1.1.9/src/./ui/menu.h:12:
In file included from /usr/ports/graphics/aseprite/work/aseprite-1.1.9/src/observable/obs/signal.h:13:
/usr/ports/graphics/aseprite/work/aseprite-1.1.9/src/observable/obs/slot.h:51:17: error: no matching constructor for initialization of 'std::function<void ()>'
  slot(F&& f) : f(std::forward<F>(f)) { }
                ^ ~~~~~~~~~~~~~~~~~~

The failing command:

cd /usr/ports/graphics/aseprite/work/.build/src/app && clang++ \
  -DASEPRITE_WITH_WEBP_SUPPORT -DENABLE_DATA_RECOVERY -DENABLE_SAVE -DENABLE_UPDATER -DHAVE_CONFIG_H -DNDEBUG -DPNG_NO_MMX_CODE -DUSE_ALLEG4_BACKEND -isystem /usr/local/include -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/ports/graphics/aseprite/work/aseprite-1.1.9/third_party/loadpng -I/usr/ports/graphics/aseprite/work/aseprite-1.1.9/third_party/simpleini -I/usr/ports/graphics/aseprite/work/aseprite-1.1.9/src/. -I/usr/ports/graphics/aseprite/work/aseprite-1.1.9/src/.. -I/usr/ports/graphics/aseprite/work/aseprite-1.1.9/src/../third_party -I/usr/ports/graphics/aseprite/work/aseprite-1.1.9/src/observable -I/usr/ports/graphics/aseprite/work/.build/src/base -I/usr/ports/graphics/aseprite/work/.build/src/app -O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer  -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/freetype2/freetype -Wall -Wno-switch -std=gnu++11 -O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer  -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/freetype2/freetype -o CMakeFiles/app-lib.dir/app_menus.cpp.o -c /usr/ports/graphics/aseprite/work/aseprite-1.1.9/src/app/app_menus.cpp
@dacap
Copy link
Member

dacap commented Sep 24, 2016

Hi @yurivict, I think you have an old clang version. Here I'm using Xcode 8.0, Mac OS X SDK 10.12 and my clang --version:

Apple LLVM version 8.0.0 (clang-800.0.38)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Before this I was compiling Aseprite with the clang version in Xcode 7.0 and SDK 10.11, that one should work too.

@yurivict
Copy link
Author

It fails for me with clang38-3.8_1:

# /usr/local/bin/clang++38 --version
clang version 3.8.0 (tags/RELEASE_380/final)
Target: x86_64-unknown-freebsd10.1
Thread model: posix
InstalledDir: /usr/local/llvm38/bin

which is the latest version according to clang's wiki page.
Something is wrong.

@dacap
Copy link
Member

dacap commented Sep 24, 2016

Oh you are on FreeBSD, it might be related to the libc++ version, but I'm not sure. Are you using libstdc++ or libc++?

@yurivict
Copy link
Author

I get the same error with both: -std=gnu++11 and -std=c++14.

@dacap
Copy link
Member

dacap commented Sep 24, 2016

Next week I'll take a look to this issue running a FreeBSD VM.

@yurivict
Copy link
Author

yurivict commented Sep 24, 2016

Thanks!

The easiest way is to first install all dependencies with the package:

# pkg install aseprite

Then build the port (cd /usr/ports/graphics/aseprite), after updating versions to:

PORTVERSION=            1.1.9
...
USE_GITHUB=             yes
GH_TUPLE=               aseprite:clip:3e9533e:clip/src/clip
GH_TUPLE+=              aseprite:flic:65a6072:flic/src/flic
GH_TUPLE+=              aseprite:gtest:d63c625:gtest/third_party/gtest
GH_TUPLE+=              aseprite:simpleini:0687587:simpleini/third_party/simpleini
GH_TUPLE+=              aseprite:duktape:0de771c:duktape/third_party/duktape
GH_TUPLE+=              aseprite:undo:f39b188:undo/src/undo
GH_TUPLE+=              dacap:observable:83dfe27:observable/src/observable

and build:

# make

@yurivict yurivict reopened this Sep 24, 2016
@yurivict
Copy link
Author

yurivict commented Oct 6, 2016

This is a regression in 1.1.9. I don't think you need to install FreeBSD for this, you can probably see this on linux if you switch to clang.

@yurivict
Copy link
Author

Any chance to have this fixed? I can't update the port. You can probably reproduce this with clang-3.8.0 linux too.

@dacap dacap self-assigned this Oct 24, 2016
@dacap
Copy link
Member

dacap commented Oct 24, 2016

I'll take a look at this issue today.

@dacap dacap added this to the v1.1 milestone Oct 24, 2016
@dacap
Copy link
Member

dacap commented Oct 24, 2016

Hi @yurivict, I was just able to compile the master branch from Aseprite on FreeBSD 11.0 with clang 3.8, I've used the steps from INSTALL.md:

screen shot 2016-10-24 at 3 05 54 pm

I recommend you to clone the master branch, and follow the steps on INSTALL.md to compile Aseprite (don't use ports or nothing extra). And you can install dependencies using pkg install.

@yurivict
Copy link
Author

Thanks for looking into this. This turned out to be a bug in FreeBSD 10 clang compiler that fails to compile this. I will work with them to fix it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants