Objective C: undefined type: found

Started by pTeK, February 08, 2024, 02:28:11 AM

Previous topic - Next topic

pTeK

I'm having a problem similar to this one at https://ftp.nice.ch/peanuts/GeneralData/Usenet/news/1996/_Soft-07.html

QuoteFrom: [email protected] (Stephen Johnson)
Newsgroups: comp.sys.next.software
Subject: undefined type, found `NSCalendarDate' error
Date: 9 Jul 1996 18:11:14 GMT
Organization: Texas A&M University, College Station, TX
Message-ID: <[email protected]>

I'm trying to build a project in ProjectBuilder on NSFIP 3.3 and I get the 
following error in the ProjectBuilder detail window:

cc -g -Wall    -pipe -I/usr/local/Minerva/include    -O    -I./sym -arch 
i386  -I./sym  -c MiniSQLAdaptor.m -o ./i386_obj/MiniSQLAdaptor.o
/NextDeveloper/Headers/eoaccess/EOAdaptorChannel.h:198: undefined type, 
found `NSCalendarDate'
*** Exit 1
Stop.
*** Exit 1
Stop.

NSCalendarDate is defined in NSDate.h, which is located at:
/usr/include/NSDate.h
and linked to the following:
/usr/include/foundation/NSDate.h
/NextDeveloper/Headers/foundation/NSDate.h

Any ideas as to how to fix this problem?

Stephen Johnson, [email protected]
Computer Consulting Int'l, LTD
PO Box 1046
College Station, TX 77841
409-696-9463

I couldn't find the solution. I'm trying to compile EIDE-driver on NS33.
it brings up a error on file IdeCntCmds.h with:
IdeCntCmds.h
undefined type: found 'ide_return_t'
undefined type: found 'ideRegsVal_t'

the problem is that these two are defined in "ata_extern.h" and has already been #import(ed) before the compiler reaches this part of the code. I could copy and paste the code from "ata_extern.h", is this where extern comes in? it's just a simple typedef and a big struct?

fstark

Hard to know without the full source code, but back in the time it often happened when you had header loops.

A includes B
B includes C
C includes A

depending on which one you include first, you can get different results.

You often could wiggle you way out of it by pre-importing one of the header, or with forward declarations.

> the problem is that these two are defined in "ata_extern.h" and has already been #import(ed) before the compiler reaches this part of the code.

I don't have that header. Was it *fully* imported, or is the issue in one of the imports from "ata_extern.h"? I sort of remember tracking those by adding ``#error`` in the system include files to see if the compiler went up to the definition...

pTeK

Quote from: fstark on February 11, 2024, 07:19:45 AMHard to know without the full source code, but back in the time it often happened when you had header loops.

A includes B
B includes C
C includes A

depending on which one you include first, you can get different results.

You often could wiggle you way out of it by pre-importing one of the header, or with forward declarations.

Thanks @fstark This seems to be a problem with gcc on NS33, on OpenStep 4.2 w/Patch and Rhapsody DR2 this problem is not encountered. I think this could be the problem here that you mentioned these circular header includes. I'm on my other laptop which has a different copy of my NS/OS/RDR2 notes which doesn't have the versions of each gcc in it.

I'll look in to the forward declarations (extern) with the headers. But any hints and examples are much appreciated to get it working with the dinosaur gcc that runs in NS33.

Quote from: fstark on February 11, 2024, 07:19:45 AM> the problem is that these two are defined in "ata_extern.h" and has already been #import(ed) before the compiler reaches this part of the code.

I don't have that header. Was it *fully* imported, or is the issue in one of the imports from "ata_extern.h"? I sort of remember tracking those by adding ``#error`` in the system include files to see if the compiler went up to the definition...

https://github.com/evolver56k/Darwin-0.3/tree/master/drvEIDE-1/EIDE.drvproj I was trying to get parts of that to compile on NS33.

https://github.com/evolver56k/Darwin-0.3/blob/master/drvEIDE-1/EIDE.drvproj/EIDE.lksproj/IdeCnt.m
https://github.com/evolver56k/Darwin-0.3/blob/master/drvEIDE-1/EIDE.drvproj/EIDE.lksproj/IdeCnt.h
https://github.com/evolver56k/Darwin-0.3/blob/745305afd074437bb660bcf02146a2754eeef5ae/drvEIDE-1/EIDE.drvproj/EIDE.lksproj/ata_extern.h#L206

Seriously this driver has been a pain in the @$$

fstark

I only have a stock NS33 on black hardware. I'll see if I can get a shot at compiling this tonight and report.

fstark

I copied the headers and objective-c files from https://github.com/evolver56k/Darwin-0.3/blob/master/drvEIDE-1/EIDE.drvproj/EIDE.lksproj on a stock NS33 black hardware.

I created a bundle, and set the type to i386.

I got the same error as you had. This is due to the content of ata_extern.h being guarded by a #ifdef DRIVER_PRIVATE

I added a -DDRIVER_PRIVATE to the compiler option

The compilations goes further, crashing on a driverKit/IOPower.h not found (looks this file is not part of the 3.3 driver kit shipped with NS33).

As I am not sure of what you are trying to achieve, I stopped there.

pTeK

#5
Quote from: fstark on February 11, 2024, 12:51:38 PMI copied the headers and objective-c files from https://github.com/evolver56k/Darwin-0.3/blob/master/drvEIDE-1/EIDE.drvproj/EIDE.lksproj on a stock NS33 black hardware.

I created a bundle, and set the type to i386.

I got the same error as you had. This is due to the content of ata_extern.h being guarded by a #ifdef DRIVER_PRIVATE

I added a -DDRIVER_PRIVATE to the compiler option

The compilations goes further, crashing on a driverKit/IOPower.h not found (looks this file is not part of the 3.3 driver kit shipped with NS33).

Thanks @fstark  8) That has helped me a lot, I'm still working on it now, I've fixed driverKit/IOPower.h, driverkit/IOProperties.h (IOTypeIDE, IOClassIDEController) to a #ifdef (IO_DRIVERKIT_VERSION == 330) patch in IdeCnt.h

I've changed the hardware calls inb(), inw(), inl(), outb(), outw(), outl() from machdep/i386/io_inline.h to driverkit/i386/ioPorts.h and architecture/i386/io.h for io_addr_t in IdeCntInline.h

having problems:
need to sort out the missing header containing undefined type 'pmap_t' https://github.com/RhapsodiOS/Kernel/blob/main/kernel/machdep/i386/pmap.h
undefined type: found '__private_extern__

How do I get around that on NS33 (gcc version 2.5.8)?
https://github.com/evolver56k/Darwin-0.3/blob/master/cctools-2/ld/symbols.h#L24
#if defined(__MWERKS__) && !defined(__private_extern__)
#define __private_extern__ __declspec(private_extern)
#endif
doesn't work also tried
#if !defined(__private_extern__)
#define __private_extern__ __attribute__((visibility("hidden")))
#endif

Quote from: fstark on February 11, 2024, 12:51:38 PMAs I am not sure of what you are trying to achieve, I stopped there.
I want to install Nextstep / Openstep on my Dell laptop ICH4 IDE, but it's not working, so getting this driver to compiler will help me a lot. It will also help those who are compiling the Rhapsody kernel, with a working IDE driver for x86 a lot of possibilities.

pTeK

This is how far I have gotten at the moment with NS33. Attached is a disk that is readable in Virtual Box as I don't have a way to get files out of the system. I have Inet access out but don't have access to any ftp or Omni Web Browser installed.

fstark

I'll try to look at it when I'm done with my first NeXTflix iteration!

pTeK

Quote from: fstark on February 21, 2024, 08:57:10 AMI'll try to look at it when I'm done with my first NeXTflix iteration!
Thanks. Will upload your latest one as I have gotten further