|
Register or have you forgotten your password?
|
|
|
| Amiga OS -- Development This particular forum deals with issues regarding development for all versions of AmigaOS. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | |||||||||
|
Cult Member
![]()
|
Once again, I'd ordinarily post this on UtilityBase but they haven't gotten rid of their "bad juju" at the moment...
![]() Trying to compile a MUI example, I'm getting lots of errors. Instead of compiling this in AmiDevCpp like I normally do, I tried compiling it in G++ directly in UAE using this command: g++ -noixemul -I InclMUID: -I InclOS39: -o MUITest MUITest.cpp This is the results: Quote:
Ed. |
|||||||||
|
|
|
|
|
#2 | ||||||||
|
Resident blue troll
Join Date: Feb 2002
Posts: 3,871
|
Well, it would have helped had you posted the piece of code in question instead of just the error-message (I only have the MorphOS-Version of the MUI-includes at hand and I'm quite sure the inlines are somewhat different here).
But .... MUI and C++ don't allways mix that well, so just calling gcc instead of g++ might allready make a differnce.
__________________
1. Make an announcment. 2. Wait a while. 3. Check if it can actually be done. 4. Wait for someone else to do it. 5. Start working on it while giving out hillarious progress-reports. 6. Deny that you have ever announced it 7. Blame someone else |
||||||||
|
|
|
|
|
#3 | ||||||||
|
Cult Member
![]()
|
Except I get the exact same results when I compile using gcc, Kronos.
![]() The code looks like this: Code:
#ifndef PROTO_MUIMASTER_H #define PROTO_MUIMASTER_H #ifndef LIBRARIES_MUI_H #include <libraries/mui.h> #endif /* !LIBRARIES_MUI_H */ #include <clib/muimaster_protos.h> #ifdef __GNUC__ #include <inline/muimaster.h> #endif /* __GNUC__ */ #ifndef __NOLIBBASE__ extern struct Library * #ifdef __CONSTLIBBASEDECL__ __CONSTLIBBASEDECL__ #endif /* __CONSTLIBBASEDECL__ */ MUIMasterBase; #endif /* !__NOLIBBASE__ */ #endif /* !PROTO_MUIMASTER_H */ Ed. |
||||||||
|
|
|
|
|
#4 | |||||||||
|
Cult Member
![]()
|
These are the errors I get, BTW, when I compile it in AmiDevCpp:
Quote:
|
|||||||||
|
|
|
|
|
#5 | ||||||||
|
Resident blue troll
Join Date: Feb 2002
Posts: 3,871
|
I would have needed the actual header file (you know the line where "res" is defined (without a type).
But... ;-) Since you allready include <clib/muimaster_protos.h> you might get away with commenting <inline/muimaster.h> out.
__________________
1. Make an announcment. 2. Wait a while. 3. Check if it can actually be done. 4. Wait for someone else to do it. 5. Start working on it while giving out hillarious progress-reports. 6. Deny that you have ever announced it 7. Blame someone else |
||||||||
|
|
|
|
|
#6 | ||||||||
|
Cult Member
![]()
|
I get an undefined reference to main when I comment it out in both compilers.
The code in question looks like this: Code:
static __inline Object * MUI_NewObjectA(char * a0arg, struct TagItem * tags)
{
return ((Object * (*)(char * __asm("a0"), struct TagItem * __asm("a1"), struct Library * __asm("a6")))
(((char *) MUIMASTER_BASE_NAME) - 30))(a0arg, tags, MUIMASTER_BASE_NAME);
Ed. |
||||||||
|
|
|
|
|
#7 | ||||||||
|
Resident blue troll
Join Date: Feb 2002
Posts: 3,871
|
main() certainly is NOT those headers, and if your missing it, something is rotten with your source-code.
I've just located a copy of the MUI3.8SDK on my hard-disk (sometimes being a messy pays ......), and the examples seem to only include <inline/...> when compiled with GNU and <clib/..> otherwise. Could you try some of those ?
__________________
1. Make an announcment. 2. Wait a while. 3. Check if it can actually be done. 4. Wait for someone else to do it. 5. Start working on it while giving out hillarious progress-reports. 6. Deny that you have ever announced it 7. Blame someone else |
||||||||
|
|
|
|
|
#8 | ||||||||
|
Cult Member
![]()
|
Sure, if you got examples that do compile, I'd welcome the chance to try them. I could at least know then the problem was definitely me, although I'm fairly convinced of that anyway.
![]() Now, taking your point seriously about the missing main, I switched my source code examples and compiled a different example after commenting out the inline/muimaster.h. I'm still getting the error in question when compiling against gcc, but they disappear when compiling against AmiDevCpp. I still have errors in both, but at least there's some clues here. Perhaps a difference in include files? Ed. |
||||||||
|
|
|
|
|
#9 | |||||||||
|
Cult Member
![]()
|
Pursuing things further in AmiDevCpp, following Kronos' advice and commenting out that inline/muimaster.h reduces my errors to just these:
Quote:
Ed. |
|||||||||
|
|
|
|
|
#10 | ||||||||
|
Cult Member
![]()
|
[bump]
OK, so no one can tell me how to get rid of this implicit declaration error? I assume it's some compiler or linker setting... Ed. |
||||||||
|
|
|
|
|
#11 | ||||||||
|
Technoid
![]()
Join Date: Jan 2006
Location: Tacoma, Wa
Posts: 312
|
Assumptions aren't going to help you.
I get the feeling you are trying to jump right into the meat of development without understanding the basics. Do you have an MuiTest.h file where you have declared the methods that it is complaining about? Or have you setup your declarations at the top of your .cpp files instead? such as: void DoMethod(); |
||||||||
|
|
|
|
|
#12 | ||||||||
|
Cult Member
![]()
|
Maybe you wanna try it with -fno-strict-prototype or kick the -ansi, -traditional and/or -pedantic option(s).
x303 :-D :-D :-D |
||||||||
|
|
|
|
|
#13 | ||||||||
|
Resident blue troll
Join Date: Feb 2002
Posts: 3,871
|
DoMethod() is in amiga.lib, so you have to include the stubs for that. set ? I'm not 100% sure, but probraly it's just some macro falling back to SetAttrs() in intuition.
If you don't know how and where to include those stubs, you are obviously trying step 15 before step 8. You may still go back to downloading the MUI-SDK (it's on the Aminet) adn try one of those examples.
__________________
1. Make an announcment. 2. Wait a while. 3. Check if it can actually be done. 4. Wait for someone else to do it. 5. Start working on it while giving out hillarious progress-reports. 6. Deny that you have ever announced it 7. Blame someone else |
||||||||
|
|
|
|
|
#14 | |||||||||
|
Cult Member
![]()
|
Ummm... the problem is, Kronos, I *AM* using the MUI SDK examples. I am assuming that this is a difference in compilers and/or environments as I am now attempting this is AmiDevCpp. I've made better progress there than using GCC on UAE.
And, c'mon guys, gimmee a break. :-) It's not like I can go out and buy a book on this stuff. Believe me, I'd love to, but all the different (and meager) sources I can find don't clue me in on a whole lot, otherwise I wouldn't be buggin' you here. If you've got something out there that explains all the proper steps in the proper order, by all means, clue me in... Now, having said all that, the only library I can find that has a reference to the DoMethod procedure is the clib/alib_protos.h which looks right but for all I know isn't. It certainly changes my errors to this: Quote:
Code:
while (DoMethod(app,MUIM_Application_NewInput,&sigs) != MUIV_Application_ReturnID_Quit) |
|||||||||
|
|
|
|
|
#15 | ||||||||
|
Beginner
![]()
Join Date: Sep 2006
Posts: 37
|
Easy one. C++ is much more strict about types and doesn't allow implicit casting to (void *).
As DoMethod() expect "Object *" as object, either define your MUI objects as Object * instead of APTR, or cast them to (Object*) in DoMethod() call. Having compiled mui classes for OWB-MorphOS in C++, I can safely say casts are the main difference to C. Can't remember any other issue so far. |
||||||||
|
|
|
![]() |
| Bookmarks |
| Tags |
| c++ , `res , type , forbids , declaration , ansi |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ansi capable telnet application for OS3.x? | AmiKit | Amiga Software Issues and Discussion | 5 | 04-09-2009 12:37 PM |
| How do I check size/date of a file in ANSI C? | ChaosLord | Amiga OS -- Development | 10 | 02-16-2006 04:17 AM |
| Karlos' weekly GNU/ANSI C++ on amiga bash :-) | Karlos | Amiga OS -- Development | 5 | 04-08-2004 04:43 PM |
| More GNU C++ (ANSI C++ mode) oddness | Karlos | Amiga OS -- Development | 14 | 03-26-2004 11:02 AM |
| Longs, ints and printf (ansi-C) | elendil | Amiga OS -- Development | 7 | 03-15-2004 08:56 AM |