Solved

compile error

Posted on 1998-11-23
12
202 Views
Last Modified: 2013-12-26
I am writing a code resource that needs to uses System 8.5  Icon Services, the code resource worked fine until I called a procedure declared in the the Icons.h file (which I included in my header file) I get a link error: function has no prototype, yet the procedure is declared in the file Icons.h, am I missing a file? I tried to add the IconServicesLib file but this is a PowerPc Lib and I am writing a 68k code resource. Any suggestions?
0
Comment
Question by:dwp090598
12 Comments
 
LVL 3

Expert Comment

by:boonstra
Comment Utility
Which function in Icon.h is giving you trouble?

What libraries do you already have in your code resource?
0
 

Author Comment

by:dwp090598
Comment Utility
Libraries: MacOS.lib

Procedure: IconSuiteToIconFamily()

and IconFamilyHandle

Worked fine before adding these calls and identifiers, I also added Icons.h which does declare these procedures. Added IconServicesLib and got an error.
0
 

Expert Comment

by:paulsat
Comment Utility
I use Code Warrior Pro 4 and looked in Icons.h and could not find your two routine prototypes.  Where did you get your copy of Icons.h?  If you got it from the web or oither than what c ame with CodeWarrior, are you sure it is being included and not the one in the CodeWarrior MacOS Support folder?  To be sure, make a copy of the Icons.h file that has your two routines in it and give it a new name and include that.  The full lib search tool in CodeWarrior does not show either of these two routines so I assume they are new to MacOS 8.5 and you must have a very, very new copy of icons.h?
0
 

Author Comment

by:dwp090598
Comment Utility
These new IconFamily routines are included in the Interfaces-Libraries.3.2.sit at Apple developer. I have written a  PPC and 68k application that calls these new Icon procedures and they compile and run fine. I just can't seem to get the 68k code resource to compile after adding Icons.h and calling the procedure. I can eamil anyone the Icons.h file if they do not want to download the Interfaces-Libraries.3.2.sit at apple.
0
 
LVL 2

Expert Comment

by:roov
Comment Utility
Do you use pre-compiled headers?
If so, it might be possible you pch uses the old Icons.h, in which case you'll have to re-create your PCH using Universal Headers 3.2...

Good luck
0
 

Author Comment

by:dwp090598
Comment Utility
I don't think that is the answer because my 68k application and PPC application that I created make calls to Icons.h, I am only having problems with the 68k code resource. But I am willing to try to re-create my pch, but I don't know how.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 3

Expert Comment

by:boonstra
Comment Utility
You can recompile pch by opening the project MacHeaders.mcp that lives in ...":MacOS Support:MacHeaders:" and building it.  However, I don't think that is your problem.  I suspect the 68K library doesn't yet exist for these routines.  
0
 

Author Comment

by:dwp090598
Comment Utility
You can recompile pch by opening the project MacHeaders.mcp that lives in ...":MacOS Support:MacHeaders:" and building it.  However, I don't think that is your problem.  I suspect the 68K library doesn't yet exist for these routines.  
0
 

Author Comment

by:dwp090598
Comment Utility
If that were true why would my 68k application compile and run fine while calling the same IconSuiteToIconFamily()?  I am only having problems with the code resource - can I email you the project and files?

email me at:

webconnect@argo.net
0
 
LVL 3

Accepted Solution

by:
boonstra earned 50 total points
Comment Utility
If that were true why would my 68k application compile and run fine while calling the same IconSuiteToIconFamily()?  I am only having problems with the code resource - can I email you the project and files?

email me at:

webconnect@argo.net
0
 
LVL 3

Expert Comment

by:boonstra
Comment Utility
In looking at dwp's code for the 68K app (which compiled) and the 68K INIT (which did not), the following facts were apparent:
- dwp's projects included both the default CWPro4 headers in the include path, as well as the Interfaces&Libraries3.2 headers
- the prefix file for the app was ansi_prefix.mac.h, while the prefix file for the INIT was MacHeaders.h.  

Therefore, when compiling the app, the compiler did not find Icons.h in the prefix file, and went to Interfaces&Libraries3.2, found the declarations for the routines, and compiled correctly.

When compiling the INIT, the compiler found the old Icons.h in the prefix file, never found the definition for IconFamilyHandle, and failed.  It wasn't a link error, it was a compile error.

Placing the new Icons.h file in the Metrowerks MacOS Support directory (and recompiling the precompiled headers, although dwp wasn't using them) fixed the problem.
0
 

Author Comment

by:dwp090598
Comment Utility
The ExpertsExchange system is incorrectly showing a comment from dwp as the proposed answer to this question.  dwp and I exchanged files via private email, including his 68K project that worked and the INIT which did not.  The correct answer should be as follows:

If you compare the preferences between the 68K app and the init, you can see why the former worked and the latter did not.  The 68K app was using a prefix file of ansi_prefix.mac.h, while the init was using MacHeaders.h.  Neither was actually using precompiled headers.  For the init, MacHeaders.h includes <Icons.h> which in dwp's environment was the _old_ Icons.h.  He did have the new Icons.h included in the path, but it found the old one first.  For the app, ansi_prefix.mac.h does _not_ include <Icons.h>, so the new Icons.h was not masked.

By replacing Icons.h in the Metrowerks MacOS Support directory, the problem was corrected.

0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now