|
Next: Mac OS X: How can I get the file access date/time
|
| Author |
Message |
External

Since: Nov 20, 2005 Posts: 13
|
(Msg. 1) Posted: Thu Jan 05, 2006 4:53 am
Post subject: What library to link against? Archived from groups: comp>sys>mac>programmer>codewarrior (more info?)
|
|
|
Hello,
I'm trying to solve my other problem (mentioned in "fopen() to open a
HFS path") by creating a small test program to look for the error. It
is a Mach-O C++ Console program as CW10 created it for me. In the
program, I need both C++-style iostream (cout and company) and plain
vanilla fopen-fread-fclose. I can compile but I get tons of undefined
reference errors when linking (eg. PBHOpenDFSync, FSOpenFork,
ResolveAliasFile). CW makes me link against ctr1.o and
MSL_All_Mach-O.lib but what else do I need to link against to resolve
these references? I tried quite a few libraries provided by CW but none
of them worked.
Thanks,
Gábor |
|
| Back to top |
|
 |  |
External

Since: Nov 20, 2005 Posts: 13
|
(Msg. 2) Posted: Thu Jan 05, 2006 5:34 am
Post subject: Re: What library to link against? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
|
| Unfortunately for my current case, this framework has been added by
default by CodeWarrior, yet it fails to link.
Bye,
Gábor
|
|
|
| Back to top |
|
 |  |
External

Since: Sep 20, 2005 Posts: 4
|
(Msg. 3) Posted: Thu Jan 05, 2006 6:04 am
Post subject: Re: What library to link against? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
djg.DeleteThis@tramontana.co.hu wrote:
> Unfortunately for my current case, this framework has been added by
> default by CodeWarrior, yet it fails to link.
Of course, you need to add the Carbon framework.
Thorsten |
|
| Back to top |
|
 |  |
External

Since: Nov 20, 2005 Posts: 13
|
(Msg. 4) Posted: Thu Jan 05, 2006 6:54 am
Post subject: Re: What library to link against? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Thorsten,
yes, that helped, thanks. However, the program still shows very strange
behavior when run:
#define MAXENTRIES 50000
typedef struct tagENTRY {
WORD w1; // WORD and similar are defined elsewhere
WORD w2;
WORD w3;
BYTE f;
BYTE h;
} ENTRY, *LPENTRY;
ENTRY Table[MAXENTRIES];
FILE* f = NULL;
fdict = fopen ("/Users/djg/Documents/...", "rb");
fread (&Table[0], sizeof(ENTRY), 1, f);
and this fread() results in an immediate Bus Error (I omitted the error
handling here but the file is opened all right).
Bye,
Gábor |
|
| Back to top |
|
 |  |
External

Since: Nov 20, 2005 Posts: 13
|
(Msg. 5) Posted: Thu Jan 05, 2006 9:04 am
Post subject: Re: What library to link against? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
Scott,
only if it were that simple...  )
No, it was my mistake when editing the snippet to make it more generic,
fdict is actually f, I just forgot to modify that instance. So, it is f
= fopen(), it isn't NULL because I check for it, it is opened, then
comes the fread() and the fireworks.
Bye,
Gábor |
|
| Back to top |
|
 |  |
External

Since: Jun 10, 2005 Posts: 11
|
(Msg. 6) Posted: Thu Jan 05, 2006 9:57 am
Post subject: Re: What library to link against? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
in article 1136472870.222560.161150 DeleteThis @g49g2000cwa.googlegroups.com,
djg DeleteThis @tramontana.co.hu at djg DeleteThis @tramontana.co.hu wrote on 1/5/06 7:54 AM:
> FILE* f = NULL;
> fdict = fopen ("/Users/djg/Documents/...", "rb");
> fread (&Table[0], sizeof(ENTRY), 1, f);
>
> and this fread() results in an immediate Bus Error (I omitted the error
> handling here but the file is opened all right).
Well, f is NULL because you never assign anything to it. But then again, you
don't define fdict in this snippet so it wouldn't compile anyway. Try
posting the snippet again? |
|
| Back to top |
|
 |  |
External

Since: Jan 05, 2006 Posts: 1
|
(Msg. 7) Posted: Thu Jan 05, 2006 1:07 pm
Post subject: Re: What library to link against? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On 05-01-2006 12:53, in article
1136465625.129811.270110.RemoveThis@o13g2000cwo.googlegroups.com,
"djg@tramontana.co.hu" <djg.RemoveThis@tramontana.co.hu> wrote:
> I'm trying to solve my other problem (mentioned in "fopen() to open a
> HFS path") by creating a small test program to look for the error. It
> is a Mach-O C++ Console program as CW10 created it for me. In the
> program, I need both C++-style iostream (cout and company) and plain
> vanilla fopen-fread-fclose. I can compile but I get tons of undefined
> reference errors when linking (eg. PBHOpenDFSync, FSOpenFork,
> ResolveAliasFile). CW makes me link against ctr1.o and
> MSL_All_Mach-O.lib but what else do I need to link against to resolve
> these references? I tried quite a few libraries provided by CW but none
> of them worked.
>
I think you should just add the "System.framework" in the framework tab of
your project. You will find the various frameworks in
/System/Library/Frameworks on your HD.
Koen |
|
| Back to top |
|
 |  |
External

Since: Aug 01, 2005 Posts: 27
|
(Msg. 8) Posted: Thu Jan 05, 2006 8:17 pm
Post subject: Re: What library to link against? [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
In article <1136472870.222560.161150 RemoveThis @g49g2000cwa.googlegroups.com>,
djg RemoveThis @tramontana.co.hu wrote:
> typedef struct tagENTRY {
> WORD w1; // WORD and similar are defined elsewhere
> WORD w2;
> WORD w3;
> BYTE f;
> BYTE h;
> } ENTRY, *LPENTRY;
>
> ENTRY Table[MAXENTRIES];
>
> FILE* f = NULL;
> fdict = fopen ("/Users/djg/Documents/...", "rb");
> fread (&Table[0], sizeof(ENTRY), 1, f);
>
> and this fread() results in an immediate Bus Error (I omitted the error
> handling here but the file is opened all right).
Was the file saved by the same code? Are you familiar with structure
padding?
<http://www.goingware.com/tips/getting-started/alignment.html> |
|
| Back to top |
|
 |  |
| Related Topics: | Mcho Library and Bundle - I have a CodeWarrior 9 based Library which is built for both Mach-o and
CFM. targets. This library loads a Macho based bundle which is USB
driver. When I linked the CFM based version of the lib with a CFM App.
everything works fine. If I create a Macho....
Static library in Codewarrior - Hello, Can some one clarify me if the way I am building static libs in Metrowreks Codewarrior7.0 is correct? File-->New-->Project tab -->NetwareStationary-->Projectname-->OK-->Server-->NKS-Libc-->Generic C++ Select output type ...
Porting a Shared Library Project to Xcode 2.0 - Hi, I am in the process of porting a Shared Library CFM project from CodeWarrior 9.5 to Xcode 2.0. It has targets for both the Shared Library as well as the calling test app. I used the standard import functionality from Xcode 2.0 to bring in the..
[ANN] VersyPDF Library Releases Its Version 1.0 - New high quality PDF library allows creating and modifying PDF files on the fly. VersyPDF 1.0 is a high quality PDF library that allows software developers to PDF-enable their applications with ease. More specifically, VersyPDF makes it possible to..
Mach-O dynamic library init/term functions? - I have a CFM shared library that I'm converting to Mach-O, currently in CW 9.6, and soon to be in XCode 2.x as well. One thing that I haven't figured out is how to specify initialization/termination functions for the Mach-O version of the library.. |
|
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum
|
|
|
|