Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Intel C++ compiler optimization flag


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 lride   Members   -  Reputation: 638

Like
0Likes
Like

Posted 05 October 2012 - 06:21 PM

I need to compile a source with full optimization; however, I get the following error

Command line error D8016: '/ZI' and '/Ox' command-line options are incompatible

the source:


[source lang="cpp"]#include <SFML/System.hpp>#include <algorithm> #include <iostream> void func1() { // generate data const unsigned arraySize = 32768; int data[arraySize]; for (unsigned c = 0; c < arraySize; ++c) data[c] = std::rand() % 256; //std::sort(data, data + arraySize); // test long long sum = 0; sf::Clock clock; for (unsigned i = 0; i < 50000; ++i) //just to see the difference { // primary loop for (unsigned c = 0; c < arraySize; ++c) { //int t = (data[c] - 128) >> 31; //sum += ~t & data[c]; if (data[c] >= 128) sum += data[c]; } } float elapsedTime=clock.getElapsedTime().asSeconds(); std::cout << elapsedTime << std::endl; std::cout << "sum = " << sum << std::endl; std::cin.get();}int main(){ func1();}[/source]

Edited by lride, 05 October 2012 - 06:24 PM.

An invisible text.

Sponsor:

#2 Bacterius   Crossbones+   -  Reputation: 11541

Like
2Likes
Like

Posted 06 October 2012 - 07:04 AM

Nothing to do with the source, you're trying to combine compiler optimization flag Ox with debug flag ZI which is invalid. Go into your project options and uncheck the debug flag.

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”


#3 lride   Members   -  Reputation: 638

Like
0Likes
Like

Posted 06 October 2012 - 12:03 PM

There are three options. I tried all of them and still get errors

1)C7 compatible(/Z7) 1>cl : Command line error D8016: '/Ox' and '/RTC1' command-line options are incompatible
2)Program Database(/Zi) 1>cl : Command line error D8016: '/Ox' and '/RTC1' command-line options are incompatible
3)Program Database for Edit and Continue(/ZI) 1>cl : Command line error D8016: '/ZI' and '/Ox' command-line options are incompatible

Edited by lride, 06 October 2012 - 12:09 PM.

An invisible text.

#4 lride   Members   -  Reputation: 638

Like
0Likes
Like

Posted 06 October 2012 - 12:37 PM

Never mind, I fixed it.
Thanks for the reply
An invisible text.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS