Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > problem with #import MacWindow.h

problem with #import MacWindow.h
Thread Tools
Fresh-Faced Recruit
Join Date: Feb 2001
Location: Amstelveen, Netherlands
Status: Offline
Reply With Quote
Feb 11, 2001, 09:32 AM
 
Hello,

I tried out Apples example but I am having problems with the including of the MacWindow.h

For some strange reason when building it , it can not find the MacWindow.h and also not the QuiDraw.h

I have set up projectbuilder in such a way that the build files are generated in the users own directory.

My question is now, how do I set the main.m and my other .m files up so that they can find the frameworks??
How do you set the path?

I hope someone can help me because if this doesn't work I am basically stuck before I can even start thinking of writing any code.

Thanks heaps.

Regards
Merijn
     
Mac Enthusiast
Join Date: Feb 2000
Location: Storrs,Connecticut, USA
Status: Offline
Reply With Quote
Feb 11, 2001, 09:53 AM
 
It sounds like you are using Cocoa. In that case what is MacWindow.h? You don't need to import anything like that in order to display a window. NSWindow is part of the cocoa framework and that is usually included automatically when you generate the source files. (#import <Cocoa/Cocoa.h&gt Also, why are you playing with main.m. Usually you never have to do anything in the main function, in Cocoa. I can think of some examples where you'd have to but if you are new then I'd doubt that you'd need to. Here is everything that I usually have inside of main.m:
Code:
#import <AppKit/AppKit.h> int main(int argc, const char *argv[]) { return NSApplicationMain(argc, argv); }
That's it. Everything else is handled by different classes that I write. Also, in Cocoa, quickdraw is gone so of course you won't find quickdraw.h. Read Apple's documentation on NSView if you want to draw 2D in a window or NSOpenGlView if you want to draw 3d stuff in a window. Apple's Cocoa documentation can be found at http://developer.apple.com/techpubs/...coaTopics.html

From your post it looks like you read a Carbon tutorial and mistook it for Cocoa. If you are new to programming I'd suggest that you learn Cocoa because it's easier and will probably replace carbon in a few years.

For a sample program written in Objective C/Cocoa, take a look at http://developer.apple.com/samplecod...leCocoaApp.htm and the corresponding technote at http://developer.apple.com/technotes/tn/tn2005.html
     
evdmeer  (op)
Fresh-Faced Recruit
Join Date: Feb 2001
Location: Amstelveen, Netherlands
Status: Offline
Reply With Quote
Feb 12, 2001, 02:25 AM
 
Hello,

Thanks for replying.
Okay I think I should clarify my question I think.

Because I got two things mixed up.
I am starting with cocoa and thought I try out Apples example that is included on the developer CD.

That is the example Hello world in carbon.

However at the stage where you need to write the #include hello.h in your main I canīt find the statement for #include QuickDraw.h and #MacWindows as is described in the pdf file.

When it builds it says it can not find these files.
So that is very strange.

I hope this better explains what the problem was I was facing.

I appreciate it if someone could look into this.
Thanks

Regards
Merijn
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:21 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2