Author Topic: CodeBlocks MacOS doubled linker arguments  (Read 5468 times)

Offline criesbeck

  • Multiple posting newcomer
  • *
  • Posts: 10
CodeBlocks MacOS doubled linker arguments
« on: January 14, 2010, 11:47:54 pm »
MacOS X Leopard on a MacBook, CodeBlocks 8.02

A toy GLUT project compiles but fails to link because the linker call is
 
  g++  -o bin/Debug/glutBegin obj/Debug/glutStart.o   -framework OpenGL
-framework GLUT -framework Cocoa -framework GLUT
-framework
OpenGL
-framework Cocoa
i686-apple-darwin10-g++-4.2.1: OpenGL‚Ä®-framework: No such file or
directory
i686-apple-darwin10-g++-4.2.1: Cocoa: No such file or directory
 

I presume the duplicated -frameworks are the problem but where are they coming from? If I copy g++ through the first 3 -framework options, and paste it into a Terminal window in the project directory, the build succeeds.

The .cbp file is below and looks fine to me, and like a project that works fine on a MacOS/CB desktop. Any idea where else to look for the source of the duplicated -frameworks? CB has been uninstalled and reinstalled to no effect.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
   <FileVersion major="1" minor="6" />
   <Project>
      <Option title="glutStart" />
      <Option pch_mode="2" />
      <Option compiler="gcc" />
      <Build>
         <Target title="Debug">
            <Option output="bin/Debug/glutStart" prefix_auto="1" extension_auto="1" />
            <Option object_output="obj/Debug/" />
            <Option type="1" />
            <Option compiler="gcc" />
            <Compiler>
               <Add option="-g" />
            </Compiler>
         </Target>
         <Target title="Release">
            <Option output="bin/Release/glutStart" prefix_auto="1" extension_auto="1" />
            <Option object_output="obj/Release/" />
            <Option type="1" />
            <Option compiler="gcc" />
            <Compiler>
               <Add option="-O2" />
            </Compiler>
            <Linker>
               <Add option="-s" />
            </Linker>
         </Target>
      </Build>
      <Compiler>
         <Add option="-Wall" />
         <Add option="-fexceptions" />
         <Add option="-DGLUT_DISABLE_ATEXIT_HACK" />
      </Compiler>
      <Linker>
         <Add option="-framework GLUT" />
         <Add option="-framework OpenGL" />
         <Add option="-framework Cocoa" />
      </Linker>
      <Unit filename="glut.h" />
      <Unit filename="glutStart.cpp" />
      <Unit filename="glutStart.h" />
      <Extensions>
         <code_completion />
         <debugger />
         <envvars />
      </Extensions>
   </Project>
</CodeBlocks_project_file>



Offline criesbeck

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: CodeBlocks MacOS doubled linker arguments
« Reply #1 on: January 14, 2010, 11:53:42 pm »
It didn't show in the copy/paste but the second set of -framework options are not separated correctly, i.e., it's

  g++  ...  -framework OpenGL -framework GLUT -framework Cocoa -framework GLUT
?-framework
OpenGL?
-framework Cocoa

where I don't know what ? but I'm guessing a line terminator that shouldn't be there. But I can't find any source for these build options or the .cbp file.

Offline criesbeck

  • Multiple posting newcomer
  • *
  • Posts: 10
[SOLVED] Re: CodeBlocks MacOS doubled linker arguments
« Reply #2 on: January 15, 2010, 12:18:47 am »
The bad ones were up in the global compiler settings. D'oh!