Solved

compile error

Posted on 1998-11-23
12
203 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
ID: 1291609
Which function in Icon.h is giving you trouble?

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

Author Comment

by:dwp090598
ID: 1291610
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
ID: 1291611
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
ID: 1291612
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
ID: 1291613
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
ID: 1291614
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:boonstra
ID: 1291615
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
ID: 1291616
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
ID: 1291617
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
ID: 1291618
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
ID: 1291619
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
ID: 1291620
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 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

23 Experts available now in Live!

Get 1:1 Help Now