-weak_framework CHUD
-weak_framework CHUD
- Subject: -weak_framework CHUD
- From: Lyndsey <email@hidden>
- Date: Mon, 15 May 2006 16:20:09 -0400
- Thread-topic: -weak_framework CHUD
Hello Everyone,
I accidentally sent my question to the Carbon list, so for those of you who
have already read this, please ignore.
I started with:
(FIRST EMAIL) ---------------------------------
Hello Everyone,
After researching CHUD and controlling an application's profiling using the
CHUD APIs, I have been trying to get our application to use these APIs in
our profile configuration. However, I am running into difficulties which I
am hoping you may be able to help me with.
First, our application targets 10.3.9 for PPC and 10.4.x for i386. The
CHUD.framework is installed in different locations for each version of the
OS. To resolve this issue, I tell Xcode to look for the framework in the two
different locations using these build settings:
FRAMEWORK_SEARCH_PATHS = $(CHUD_FRAMEWORK_SEARCH_PATHS_$(CURRENT_ARCH))
CHUD_FRAMEWORK_SEARCH_PATHS_i386 = /System/Library/Frameworks
CHUD_FRAMEWORK_SEARCH_PATHS_ppc = /System/Library/PrivateFrameworks
Also, since there is no header file for the Mac OS X 10.4 version of CHUD,
and I do not want to force each of our Software Engineers to download the
special CHUD SDK just to build our application, I've placed in our profiling
(MyProfiling.h) header file this data:
// ----- code copy/paste begin ----
extern int chudInitialize(void) __attribute__((weak_import));
extern int chudStopRemotePerfMonitor(void) __attribute__((weak_import));
extern int chudStartRemotePerfMonitor(char* label)
__attribute__((weak_import));
extern int chudAcquireRemoteAccess(void) __attribute__((weak_import));
extern int chudReleaseRemoteAccess(void) __attribute__((weak_import));
extern int chudCancelRemotePerfMonitor(void) __attribute__((weak_import));
extern int chudRegisterAsRemotePerfMonitor(void)
__attribute__((weak_import));
extern int chudMarkPID(pid_t pid, int markflag)
__attribute__((weak_import));
extern void chudCleanup(void) __attribute__((weak_import));
extern int chudIsInitialized(void) __attribute__((weak_import));
extern char* chudGetStatusStr(void) __attribute__((weak_import));
// I've also copied the enums, but for my question I'll not paste those into
this email.
// ---- code copy/paste end -----
And, in order to link to the CHUD framework, I've placed on the Other Linker
Flags build setting:
OTHER_LDFLAGS = -lOurLibrary -weak_framework CHUD
However, I'm getting link errors:
(PowerPC)
collect2: ld returned 1 exit status
/usr/bin/ld: Undefined symbols:
chudCleanup()
chudMarkPID(int, int)
chudInitialize()
chudIsInitialized()
chudAcquireRemoteAccess()
chudReleaseRemoteAccess()
chudStopRemotePerfMonitor()
chudStartRemotePerfMonitor(char*)
chudCancelRemotePerfMonitor()
chudGetStatusStr()
collect2: ld returned 1 exit status
cd
(Intel)
/usr/bin/ld: can't locate framework for: -framework CHUD
collect2: ld returned 1 exit status
/usr/bin/ld: can't locate framework for: -framework CHUD
collect2: ld returned 1 exit status
Build failed (2 errors, 39999 warnings)
Can someone explain why I am getting these errors? The Intel portion cannot
even find the CHUD framework, but the PowerPC portion apparently can (?).
Yet, even though the PowerPC portion can find the CHUD framework, the
functions don't exist even though I've copied them from the header file (and
added the "extern" and "__attribute__((weak_import))" parts).
Maybe I am misunderstanding weak_import? I've had it work for dynamic
libraries that may or may not exist, so that seems odd that I would have
misunderstood that portion.
Any thoughts on why our application is not linking? What about why can Xcode
not find the CHUD framework for Intel?
------------------------------- (FIRST EMAIL)
To which Eric Albert kindly responded and I replied:
(SECOND EMAIL) -----------------------------------
On 5/15/06 2:36 PM, "Eric Albert" <email@hidden> wrote:
> On May 15, 2006, at 11:21 AM, Lyndsey wrote:
> Those are backwards. On the Intel systems, CHUD.framework is in /
> System/Library/PrivateFrameworks.
>
> Try switching them and seeing if that helps....
Ok, fixed that, same result....odd
CHUD_FRAMEWORK_SEARCH_PATHS_i386 = /System/Library/PrivateFrameworks
CHUD_FRAMEWORK_SEARCH_PATHS_ppc = /System/Library/Frameworks
Here are the detailed results for the i386:
Ld
/Users/Lyndsey/Documents/PerforceRoot/Engineering/VectorWorks/Mainline/AppSo
urce/./Output/XcodeIntermediateFiles/VectorWorks.build/Profile/VectorWorks.b
uild/Objects-normal/i386/VectorWorks normal i386
cd
/Users/Lyndsey/Documents/PerforceRoot/Engineering/VectorWorks/Mainline/AppSo
urce
/usr/bin/g++-4.0 -o
/Users/Lyndsey/Documents/PerforceRoot/Engineering/VectorWorks/Mainline/AppSo
urce/./Output/XcodeIntermediateFiles/VectorWorks.build/Profile/VectorWorks.b
uild/Objects-normal/i386/VectorWorks
-L/Users/Lyndsey/Documents/PerforceRoot/Engineering/VectorWorks/Mainline/App
Source/Output/AppMac/Profile -LOutput/LibMac/Profile
-LOutput/LibMacThirdParty/Common -LOutput/LibMacThirdParty/Profile
-LOutput/AppMac/Profile/VectorWorks.app/Contents/MacOS
-LThirdPartySource/Dongle/Mac
-L/Developer/SDKs/MacOSX10.4u.sdk/System/Library/PrivateFrameworks
-F/Users/Lyndsey/Documents/PerforceRoot/Engineering/VectorWorks/Mainline/App
Source/Output/AppMac/Profile
-F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/PrivateFrameworks -filelist
/Users/Lyndsey/Documents/PerforceRoot/Engineering/VectorWorks/Mainline/AppSo
urce/./Output/XcodeIntermediateFiles/VectorWorks.build/Profile/VectorWorks.b
uild/Objects-normal/i386/VectorWorks.LinkFileList -framework AGL -framework
ApplicationServices -framework Carbon -framework CoreServices -framework
OpenGL -framework QuickTime -lOurLibrary -arch i386 -prebind -pg
-mmacosx-version-min=10.4 -Wl,-dead_strip -Wl,-Sp -weak_framework CHUD
-isysroot /Developer/SDKs/MacOSX10.4u.sdk
/usr/bin/ld: warning -prebind ignored because MACOSX_DEPLOYMENT_TARGET
environment variable greater or equal to 10.4
/usr/bin/ld: can't locate framework for: -framework CHUD
collect2: ld returned 1 exit status
It is my thought that perhaps instead of trying to put in
/System/Library/PrivateFrameworks in the FrameWork Search Paths, I should
put -F/System/Library/PrivateFrameworks in the Other Linker Flags as Xcode
seems to be adding /Developer/SDKs/MacOSX10.4u.sdk as a prefix. I tried
this, it doesn't work.
--------------------------------- (SECOND EMAIL)
I would appreciate any suggestions.
Sincerely (!),
Lyndsey Ferguson
--
Lyndsey Ferguson
Software Engineer
email@hidden
VectorWorks 12
Go from life without 12 to life without limits.
Visit http://www.vectorworks.net for more information.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden