Dylib problem
Hi everyone,
While trying to get a simple dylib that fetches the resolution of Macintosh computers to work, I get this little error. There doesn't seem to be anything wrong with the code, but then again I'm quite new to C so I can't be sure what's wrong with what.
The error(s, 2) I get is:
Any help? I can't reroute this to the main application's code... it must be in a dylib.
While trying to get a simple dylib that fetches the resolution of Macintosh computers to work, I get this little error. There doesn't seem to be anything wrong with the code, but then again I'm quite new to C so I can't be sure what's wrong with what.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <ApplicationServices/ApplicationServices.h>
extern "C" {
__attribute__((visibility("default"))) double GetPixelsWide( double _var );
double
GetPixelsWide( double _bar )
{
//Get display width...
double returnvar;
//uint32_t ioflags;
returnvar=CGDisplayPixelsWide(kCGDirectMainDisplay);
return returnvar;
}
}The error(s, 2) I get is:
Quote: "_CGDisplayPixelsWide", referenced from:
"_CGMainDisplayID", referenced from:
_GetPixelsWide in gethome.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Any help? I can't reroute this to the main application's code... it must be in a dylib.
Vetra Games: http://www.vetragames.com
My Blog: http://www.vetragames.com/blog/
Twitter: http://www.twitter.com/ugriffin
You need to link to the ApplicationServices framework you included.
Ahhh... my noobness shows up... and beautifully this time.
But your fixed worked beautifully. Thanks a lot.
But your fixed worked beautifully. Thanks a lot.
Vetra Games: http://www.vetragames.com
My Blog: http://www.vetragames.com/blog/
Twitter: http://www.twitter.com/ugriffin
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Cocoa fundamentals - the message loop in a dylib | bumperman | 5 | 5,075 |
Nov 8, 2009 11:17 AM Last Post: OneSadCookie |
|
| how to debug a dylib? | sakiel | 1 | 3,378 |
Aug 16, 2007 07:26 PM Last Post: OneSadCookie |
|
| How to force the use of static libs when the dylib is present? | Malarkey | 4 | 4,440 |
Oct 12, 2006 04:33 PM Last Post: Malarkey |
|
| Linking to dylib in xCode | Jones | 6 | 4,694 |
Jun 26, 2006 02:08 PM Last Post: OneSadCookie |
|
| /sw/lib/libcurl.2.dylib to /usr/lib/??? (terminal...???) | BinarySpike | 10 | 5,797 |
May 2, 2005 10:05 AM Last Post: BinarySpike |
|

