Qt return during release

Asked

Viewed 73 times

3

When I compile my project as debug, it works normally, but when I try to compile in release appears the following message in the Output Compile:

cc1plus: error: argument to '-O' should be a non-negative integer, 'g', ’s' or 'fast' make: *** [main. o] Error 1 ... The process "/usr/bin/make" exited with code 2.

Error while building/deploying project 'project name' (kit: Desktop Qt 5.4.0 GCC 64bit) When executing step "Make"

Would anyone know why?

  • 3

    The problem is probably in your .pro. Add it to your question. Also add the command line being executed at the time of the error.

  • I had this problem a while back, but I really don’t remember how I solved it.

  • 1

    Thanks @Viníciusgobboa.deOliveira for the tip, really helped.

1 answer

2


The problem for the following reason, because my application is cross-platform (windows/linux), I added:

-QMAKE_CXXFLAGS_RELEASE -= -O2

-QMAKE_CXXFLAGS_RELEASE += -Od

To remove messages from my compiler C windows, but did not tag win32: in these lines and the linux c compiler did not understand, after adding it, it worked correctly.

  • As you said this solution solved your problem you have the option to mark this answer as accepted.

  • 1

    @Giovaniracipaganini yes, but only after two days after posting the reply.

  • Ah yes, I had forgotten hehe.

  • The good answer, unfortunately no one would be able (I think) to answer why there was no code .pro as Vinicius requested. But still good tip :)

  • @Guilhermenascimento agrees with his statement, but as soon as the friend Vinicius commented I looked at him. pro and then I noticed the error, so I saw no need to post the wrong part in the question but an answer already with the solution.

  • Yes, that’s not really what I mean, what I mean is that I always post relevant codes following these tips: http://answall.com/help/mcve :) In the case of the next questions that you will make

  • @Guilhermenascimento yes, thank you very much for your suggestion.

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.