Author Topic: CB 10.05 unusable under MAC OSX 10.6.4. - Workaround for GCC4.4 under 8.05?  (Read 16261 times)

Offline er

  • Multiple posting newcomer
  • *
  • Posts: 34
Re: CB 10.05 unusable under MAC OSX 10.6.4. - Workaround for GCC4.4 under 8.05?
« Reply #15 on: November 12, 2010, 08:26:33 pm »
And if I revert to the default compiler, GCC4.2, rather than the ported GCC4.4, and a check the i386 compiler flag, I get,

"error : CPU you selected does not support x86-64 instruction set",

which seems consistent with the error I get under GCC4.4...
Code::Blocks 10.05/ Mac OS X 10.6.4/GCC

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: CB 10.05 unusable under MAC OSX 10.6.4. - Workaround for GCC4.4 under 8.05?
« Reply #16 on: November 12, 2010, 08:50:33 pm »
Update : there is no problem in building the same program from the command line, .e.g

/sw/bin/g++-4 -o helloworld main.cpp

and it executes as it should...

And if you looked at the Full Compiler log you would be able to say something is different.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline er

  • Multiple posting newcomer
  • *
  • Posts: 34
Re: CB 10.05 unusable under MAC OSX 10.6.4. - Workaround for GCC4.4 under 8.05?
« Reply #17 on: November 12, 2010, 09:01:55 pm »
Thanks.

As I've mentioned, I have set Compiler logging to Full Command Line. I guess this is what you meant?

In the Build log, this is what I get:


-------------- Build: Debug in cpp_0x ---------------

g++  -o bin/Debug/cpp_0x obj/Debug/main.o   
ld: warning: in obj/Debug/main.o, file was built for i386 which is not the architecture being linked (x86_64)
Undefined symbols:
  "_main", referenced from:
      start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 1 warnings
Code::Blocks 10.05/ Mac OS X 10.6.4/GCC

Offline er

  • Multiple posting newcomer
  • *
  • Posts: 34
Re: CB 10.05 unusable under MAC OSX 10.6.4. - Workaround for GCC4.4 under 8.05?
« Reply #18 on: November 12, 2010, 09:07:08 pm »
And this is what the staff from Fink tells me :

"You're on a 32-bit Fink  (according to the link, unless you changed
something) and for some reason the CodeBlocks IDE appears to be linking
64-bit stuff as well, and the two don't mix.

We see similar errors when packages try to build as 64-bit by default
and try to link 32-bit libraries.  This normally happens because the
Xcode compilers default to 64-bit mode.

gcc4.4 hasn't changed since your prior message, and we haven't had any
other reports of altered behavior.  I'm inclined to think that something
has changed in Codeblocks.  Is this the _same_ version that used to work
for you?"

I think I'm using the same version of CB, though.

Code::Blocks 10.05/ Mac OS X 10.6.4/GCC

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: CB 10.05 unusable under MAC OSX 10.6.4. - Workaround for GCC4.4 under 8.05?
« Reply #19 on: November 12, 2010, 10:14:18 pm »
You need to do a re-build so the compiler command is seen in the build log!

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline er

  • Multiple posting newcomer
  • *
  • Posts: 34
Re: CB 10.05 unusable under MAC OSX 10.6.4. - Workaround for GCC4.4 under 8.05?
« Reply #20 on: November 12, 2010, 11:01:17 pm »
Thanks,

This is the Build log after a rebuild:


-------------- Clean: Debug in cpp_0x ---------------

Cleaned "cpp_0x - Debug"

-------------- Build: Debug in cpp_0x ---------------

g++-4 -Wall -fexceptions  -g    -I/usr/local/trunk  -c /Users/Me/dev/cpp/projects/cpp_0x/main.cpp -o obj/Debug/main.o
g++  -o bin/Debug/cpp_0x obj/Debug/main.o   
ld: warning: in obj/Debug/main.o, file was built for i386 which is not the architecture being linked (x86_64)
Undefined symbols:
  "_main", referenced from:
      start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 1 warnings


For comparison, this is the Build log, after re-setting the compiler settings to the default, and rebuilding:

-------------- Clean: Debug in cpp_0x ---------------

Cleaned "cpp_0x - Debug"

-------------- Build: Debug in cpp_0x ---------------

Compiling: main.cpp
Linking console executable: bin/Debug/cpp_0x
Output size is 8.76 KB
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
 
Code::Blocks 10.05/ Mac OS X 10.6.4/GCC

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: CB 10.05 unusable under MAC OSX 10.6.4. - Workaround for GCC4.4 under 8.05?
« Reply #21 on: November 13, 2010, 01:39:24 am »
Why are you mixing two separate commands; please change them to match. Either use  "g++-4" or "g++" Not both.
Check the c++ Compiler and the linker command under compiler tool chain.

Please Turn ON Full Compiler Logging for Comparison to default settings.

For comparison, this is the Build log, after re-setting the compiler settings to the default, and rebuilding:

-------------- Clean: Debug in cpp_0x ---------------

Cleaned "cpp_0x - Debug"

-------------- Build: Debug in cpp_0x ---------------

Compiling: main.cpp
Linking console executable: bin/Debug/cpp_0x
Output size is 8.76 KB
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
 


Tim S.
« Last Edit: November 13, 2010, 01:53:19 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline er

  • Multiple posting newcomer
  • *
  • Posts: 34
Compiler settings for GCC4.4 (Fink)
« Reply #22 on: November 15, 2010, 06:29:58 pm »

"Why are you mixing two separate commands; please change them to match. Either use  "g++-4" or "g++" Not both."

Indeed. This should be the set up

Compiler's installation dir : Auto-detect
Other paths : the path to the non-default compiler, in my case /sw/bin

C compiler : gcc-4
C++ compiler : g++-4
Linker for dynamic libs : g++-4

I had forgotten the last one.

One last question : how do I save the Settings (such as Search directorie)? Saving the project or the workspace does not suffice. If I close and restart CB, the changes are not kept.
Code::Blocks 10.05/ Mac OS X 10.6.4/GCC

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Compiler settings for GCC4.4 (Fink)
« Reply #23 on: November 15, 2010, 10:15:44 pm »
I had forgotten the last one.

One last question : how do I save the Settings (such as Search directorie)? Saving the project or the workspace does not suffice. If I close and restart CB, the changes are not kept.

Note: Try doing the search directories changes and then use "save all projects" or/and "save projects" before doing the below steps.

Note: Also, Try doing "project save as"; if it works, it means likely you do not have permission or file is read-only.

If Code::Blocks does not crash on shut-down it should save the setting in the project.
Try turning off/disabling all the plug-ins except for the Compiler Plug-in.
Shut down Code::Blocks.
Re-Open Code::Blocks are all the plug-ins except for the Compiler Plug-in disabled?
If yes, open project and change search directories.
Shut down Code::Blocks.
Re-Open Code::Blocks are all the changes to search directories still there?
If yes, try the turning on the Plugins you use one at a time to figure out which needs to be off to save the project changes.


Tim S.
« Last Edit: November 15, 2010, 10:20:54 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org