Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: complex number lib with PB and gcc 3.3



Jed Everitt wrote:
| Have just installed the gccUpdate from apple and ProjectBuilder no
| longer links code which uses the complex number libs.
|
| I have tried including both 3.1 and 3.3 libstdc++.a files but I get the
| same error...
|
| ld: Undefined symbols:
| ___dv__H1Zd_RCt7complex1ZX01n1_B0
| ___t7complex1Zddd
| _cos__H1Zd_RCt7complex1ZX01_B0
| _cosh__H1Zd_RCt7complex1ZX01_B0
| _exp__H1Zd_RCt7complex1ZX01_B0
|
| [snip]
|
| _sin__H1Zr_RCt7complex1ZX01_B0
| _sinh__H1Zr_RCt7complex1ZX01_B0
| _sqrt__H1Zr_RCt7complex1ZX01_B0
|
| The readme stated that installing the update shouldn't make any
| difference to ProjectBuilder compiles, I'm not convinced :-(

The operative word is "shouldn't". That is, it's not *supposed* to make any difference. But remember that the release notes also say "This is a pre-release" which means "beta software", and beta software doesn't necessarily do what it's intended to do. Indeed, Apple has stated (in posts here, at least) that the gcc 3.3 compiler *will* require code changes (although they didn't say what changes they were referring to), which suggests that it could well affect *some* builds.

In this case, it probably won't matter *what* library you include, because the std::complex type is a template class, and sqrt(complex<...>) is defined in the <complex> header as a template function (as are the others, I believe). Hence, the mere use of it should have caused the compiler to *create* the routine that the linker is complaining about.

For what it's worth, setting up a "C++ Tool" project per the release notes (with the changed expert settings), and compiling

#include <iostream>
#include <complex>

int main (int argc, const char * argv[]) {
// insert code here...
std::complex<double> a(1,2);
std::complex<double> b(sqrt(a));

std::cout << b << std::endl;

return 0;
}

I have no problems.

Glen Fisher
_______________________________________________
projectbuilder-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/projectbuilder-users
Do not post admin requests to the list. They will be ignored.

References: 
 >complex number lib with PB and gcc 3.3 (From: Jed Everitt <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.