compiling help for code blocks

  • theblaze
    8th Dec 2011 Member 0 Permalink
    when i try to compile in code blocks it gives me an :
    cc1.exe: error: invalid option argument '-Ofast'  error and if i leave the option out then it generates lots of errors. help?
  • MasterMind555
    8th Dec 2011 Member 0 Permalink
    @theblaze (View Post)
    Errors or warnings? BIG difference.
  • cctvdude99
    8th Dec 2011 Member 0 Permalink
    @MasterMind555 (View Post)

    theblaze:

    cc1.exe: error


    @theblaze (View Post)
    I use Code::Blocks. It's a real bugger to use, but I love it. :)

    I haven't really been modding much lately, but I can try and help you.
    At a guess, replacing the line with '-Ofast' on (in the 'Other Options' tab) with:
    -w -m32 -std=c99 -D_POSIX_C_SOURCE=200112L -O3 -ffast-math -ftree-vectorize -funsafe-math-optimizations -mmmx -DX86 -mwindows -DWIN32 -lws2_32
    may or may not work.
    That's the line I currently use (I set that as default for a blank project) and I think it compiles alright.


    Also, in future, this section is for Development, not Development Help. We have a Development Assistance subforum. Use it. ;)
  • abczyx123987
    8th Dec 2011 Member 0 Permalink
    Try replacing the -Ofast with -O3.

    Older versions of MinGW GCC don't have the -Ofast option...
    (when I updated the wiki, I had apparently wrongly assumed that everyone would just follow it from top to bottom, so then you would have the latest version of MinGW installed, which has the -Ofast option...)

    ...and as for your other errors, can you post a pastebin of them?
  • MasterMind555
    8th Dec 2011 Member 0 Permalink
    @cctvdude99 (View Post)

    theblaze:

    it generates lots of errors. help?
    I meant there.
  • theblaze
    8th Dec 2011 Member 0 Permalink
    when i leave out -Ofast i get 
    http://pastebin.com/MvRv9cc3 but il'l try updating my mingw
  • abczyx123987
    8th Dec 2011 Member 0 Permalink
    Hmm...your MinGW installation doesn't seem to have pthread in there.

    The easiest thing to do would be to reinstall MinGW, because last time I checked, a standard MinGW installation contains the pthread libraries.

    If you don't feel like doing that, then do this:

    Download this:
    ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.exe

    When you run it and then click "Extract", it'll create three folders.
    You'll just need these files:
    Pre-built.2\include\pthread.h
    Pre-built.2\include\sched.h
    Pre-built.2\lib\libpthreadGC2.a
    Pre-built.2\lib\pthreadGC2.dll
    (.h files go in the include folder of your MinGW installation, .a and .dll files go to the lib folder)

    Also, for the linker options, find "-lpthread" and change it to "-lpthreadGC2".
    Or just remove it altogether and add the libpthreadGC2.a file to the linker libraries.