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

obj/fe_blend.o fails to compile #446

Closed
fanfani opened this issue May 31, 2018 · 17 comments
Closed

obj/fe_blend.o fails to compile #446

fanfani opened this issue May 31, 2018 · 17 comments

Comments

@fanfani
Copy link

fanfani commented May 31, 2018

hello there,

i am having issues compiling attractmode from latest git (relevant compiler output below)
i'm running debian jessie, and did not have any issues compiling from source until recently.

Compiling obj/fe_blend.o...
src/fe_blend.cpp: In static member function ‘static sf::BlendMode FeBlend::get_blend_mode(int)’:
src/fe_blend.cpp:35:76: error: expression list treated as compound expression in functional cast [-fpermissive]
    return sf::BlendMode(sf::BlendMode::One, sf::BlendMode::OneMinusSrcColor);
                                                                            ^
src/fe_blend.cpp:35:24: error: expected primary-expression before ‘(’ token
    return sf::BlendMode(sf::BlendMode::One, sf::BlendMode::OneMinusSrcColor);
                        ^
src/fe_blend.cpp:35:29: error: ‘sf::BlendMode’ is not a class or namespace
    return sf::BlendMode(sf::BlendMode::One, sf::BlendMode::OneMinusSrcColor);
                             ^
src/fe_blend.cpp:35:49: error: ‘sf::BlendMode’ is not a class or namespace
    return sf::BlendMode(sf::BlendMode::One, sf::BlendMode::OneMinusSrcColor);
                                                 ^
src/fe_blend.cpp:37:81: error: expression list treated as compound expression in functional cast [-fpermissive]
    return sf::BlendMode(sf::BlendMode::DstColor, sf::BlendMode::OneMinusSrcAlpha);
                                                                                 ^
src/fe_blend.cpp:37:24: error: expected primary-expression before ‘(’ token
    return sf::BlendMode(sf::BlendMode::DstColor, sf::BlendMode::OneMinusSrcAlpha);
                        ^
src/fe_blend.cpp:37:29: error: ‘sf::BlendMode’ is not a class or namespace
    return sf::BlendMode(sf::BlendMode::DstColor, sf::BlendMode::OneMinusSrcAlpha);
                             ^
src/fe_blend.cpp:37:54: error: ‘sf::BlendMode’ is not a class or namespace
    return sf::BlendMode(sf::BlendMode::DstColor, sf::BlendMode::OneMinusSrcAlpha);
                                                      ^
src/fe_blend.cpp:39:73: error: expression list treated as compound expression in functional cast [-fpermissive]
    return sf::BlendMode(sf::BlendMode::DstColor, sf::BlendMode::SrcColor);
                                                                         ^
src/fe_blend.cpp:39:24: error: expected primary-expression before ‘(’ token
    return sf::BlendMode(sf::BlendMode::DstColor, sf::BlendMode::SrcColor);
                        ^
src/fe_blend.cpp:39:29: error: ‘sf::BlendMode’ is not a class or namespace
    return sf::BlendMode(sf::BlendMode::DstColor, sf::BlendMode::SrcColor);
                             ^
src/fe_blend.cpp:39:54: error: ‘sf::BlendMode’ is not a class or namespace
    return sf::BlendMode(sf::BlendMode::DstColor, sf::BlendMode::SrcColor);
                                                      ^
src/fe_blend.cpp:41:76: error: expression list treated as compound expression in functional cast [-fpermissive]
    return sf::BlendMode(sf::BlendMode::One, sf::BlendMode::OneMinusSrcAlpha);
                                                                            ^
src/fe_blend.cpp:41:24: error: expected primary-expression before ‘(’ token
    return sf::BlendMode(sf::BlendMode::One, sf::BlendMode::OneMinusSrcAlpha);
                        ^
src/fe_blend.cpp:41:29: error: ‘sf::BlendMode’ is not a class or namespace
    return sf::BlendMode(sf::BlendMode::One, sf::BlendMode::OneMinusSrcAlpha);
                             ^
src/fe_blend.cpp:41:49: error: ‘sf::BlendMode’ is not a class or namespace
    return sf::BlendMode(sf::BlendMode::One, sf::BlendMode::OneMinusSrcAlpha);
                                                 ^
Makefile:456: set di istruzioni per l'obiettivo "obj/fe_blend.o" non riuscito
make: *** [obj/fe_blend.o] Errore 1

ciao!

@oomek
Copy link
Collaborator

oomek commented May 31, 2018

Have you tried compiling with full clean?

@fanfani
Copy link
Author

fanfani commented May 31, 2018

do you mean did i run make clean before make? yes i did

@oomek
Copy link
Collaborator

oomek commented May 31, 2018

Could you try my fork with the recent fixes and tell if the issue is also there ?
https://github.com/oomek/attract/tree/fixes

Also, are you compiling for linux or cross-compiling?

@fanfani
Copy link
Author

fanfani commented May 31, 2018

just run:

$ git clone https://github.com/oomek/attract.git

$ cd attract

$ make

same result

(compiling for linux)

@oomek
Copy link
Collaborator

oomek commented May 31, 2018

What SFML version do you have there?

@fanfani
Copy link
Author

fanfani commented Jun 1, 2018

$ aptitude versions libsfml-dev
Package libsfml-dev:                        
i   2.1+dfsg2-1+b1    stable    500 

@oomek
Copy link
Collaborator

oomek commented Jun 1, 2018

From what I see you have quite old sfml libs 2.1 Update to 2.4.0 or the latest 2.5.1 to get it compiling. SFML BlendMode was added from what I remember in 2.3.0
Is there any particular reason you got the dev package? I think those are the libraries for debugging.

@mickelson
Copy link
Owner

mickelson commented Jun 1, 2018 via email

@oomek
Copy link
Collaborator

oomek commented Jun 1, 2018

Actually to be precise it’s about constructing custom blend modes which I used for non standard blending. The standard blending modes were present in earlier sfml versions

@oomek
Copy link
Collaborator

oomek commented Jun 1, 2018

What do you do in that kind of situations?

@oomek
Copy link
Collaborator

oomek commented Jun 3, 2018

Andrew, would you please explain to me what is the reason of keeping the compatibility with the old SFML libraries?

@mickelson
Copy link
Owner

mickelson commented Jun 4, 2018 via email

@mickelson
Copy link
Owner

Hi there, I'm unable to reproduce this here but some changes have been made that might fix this. Could you try compiling again with the latest code from master and let me know if it fixes this? thanks

@fanfani
Copy link
Author

fanfani commented Jul 2, 2018

hi, I tried to compile again on the same system (debian jessie) and after issuing git pull.

it fails in the very same way (except for slightly different line numbers):

Compiling obj/fe_blend.o...
src/fe_blend.cpp: In static member function ‘static sf::BlendMode FeBlend::get_blend_mode(int)’:
src/fe_blend.cpp:35:78: error: expression list treated as compound expression in functional cast [-fpermissive]
    retval = sf::BlendMode(sf::BlendMode::One, sf::BlendMode::OneMinusSrcColor);
[...]

@oomek
Copy link
Collaborator

oomek commented Jul 2, 2018

Calling BlendMode constructor will fail on older SFML versions. Some additional checks for the SFML versions will be required or just simple try catch block.

@mickelson
Copy link
Owner

ok i think I've got it now, could you try updating and compiling again??

@fanfani
Copy link
Author

fanfani commented Jul 3, 2018

it works! thank you :-)

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

3 participants