Compiling on Cygwin

Posted by Orik on Mon 16 Jul 2007 12:08 AM — 22 posts, 87,152 views.

USA #0
When I compile on cygwin straight out of the tgz after uncommenting the makefile, I get a slew of errors in the imc.c file.

I would say in about every function it says:

error: dereferencing pointer to incomplete type

It doesn't make it past imc.c.
USA #1
Could you please show:

- the version of gcc you are using
- a sample line that is generating an error
- exactly what you did to the makefile

Other than the warning
Quote:
lua_bits.c:65: warning: pointer targets in initialization differ in signedness

that was covered on the forums already, and needing to adjust the Lua include path slightly, it compiled cleanly for me.

I have gcc 4.1.2 running on Linux.
USA #2
I have gcc 3.4.4

a line of the error is:

imc.c:8443: error: dereferencing pointer to incomplete type

And that error is pretty much in every function of imc.c it looks like.

I uncommented CYGWIN and commented NEED_DL

I believe it might have to do with my version. Considering my desktop doesn't have internet access it will be hard to update if it is the version that's the culprit.
USA #3
Hrm. Are there any other errors in there? I'd go to the top and bottom of the error list and see if there's anything different.

That error is telling you that you've got a forward declaration of CHAR_DATA, but no actual declaration.

This can happen is, for example, you haven't properly included mud.h -- which can happen if gcc failed to find e.g. the Lua headers and stopped processing mud.h.
Australia Forum Administrator #4
I have:

$ gcc --version
gcc (GCC) 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)

When I did the stuff on this page:

http://www.gammon.com.au/forum/?id=8000&page=3

... it compiled OK for me.

As David said, fix the first error first. I have been finding that with gcc these days, if you leave off a semicolon it generates about 40 errors.
USA #5
I can't see the very top of the errors because I can't scroll up that far. I tried make > error.txt but it just showed the file that was compiling and then stopped before the errors.

This is straight from Nick's download link. So I'm not sure, I'm guessing it's just my compiler.
USA #6
Try 2>error.txt; the errors are printed to sterr, not stdout.

You can also change the dosbox scroll-back by right-clicking on the icon in the task bar and going through the properties a bit (I think it might be in "buffer", but I don't remember).
USA #7
Alright Nick, I must have missed that post. I'll look into it more from that post.
Australia Forum Administrator #8
I wouldn't guess that because I have the same one, as I said.

Try:


make &> error.txt


Try adjusting your window scrollback size so you keep more lines.

Make sure you copied the header files as I suggested in the link above.
USA #9
Too many people posting at the same time here! :-)
USA #10
It compiled cleanly now. Thanks guys.

one last question. I downloaded gcc 4.1.2 do I just untar it and then put it in my lib/gcc or how would I make it update it?
USA #11
For posterity, what did you have to fix?

For gcc: I would install it via Cygwin's package installer. I think you can do local install, if you don't have direct internet access. If you got the archive from source, you will have a fun time installing it...
USA #12
I pretty much did exactly what this link said to do:

http://www.gammon.com.au/forum/?id=8000&page=3

followed it step by step and it worked first time.

I downloaded it from gnu project site. Would I be able to local install it still? How would I do it?
USA #13
I don't really know, to be honest. I would be very uneasy about manually installing gcc, unless it comes with documentation tailored for cygwin.

I think you can only do local installations for Cygwin packages. I'm not sure where exactly you'd get those, as I've never had the need for one.
USA #14
bummer. Well, I guess it doesn't really matter since everything I've compiled so far is all I need to compile on it. Hopefully down the line I'll have internet to update all my cygwin files. It isn't much fun being poor. :)
USA #15
Well, gcc 3.4.4 is more than adequate for compiling. The newer versions usually add more standards compliance, and fix some rather obscure bugs you are likely to never encounter anyhow.

I'm assuming you're on a laptop of some kind? Can you set up internet connection sharing, with your laptop hosting and the desktop wired to the laptop?
USA #16
I don't know how I would do that. I'm using my work laptop with their cingular aircard. How would I wire the desktop to the laptop to gain the connection?
Australia Forum Administrator #17
Quote:

I downloaded gcc 4.1.2 do I just untar it and then put it in my lib/gcc or how would I make it update it?


I wouldn't bother. The version you have compiles and works. Why fiddle with it?
USA #18
Yea, I'm not going too. I'm just curious to see if I can connect my desktop to my laptop and get internet on my desktop. I don't know if this is possible or not. I don't have a hub or anything. Just ethernet cables.
USA #19
If your laptop is running Windows, I think their internet connection wizard will do most of the work for you. You will need to add an ethernet cable between the desktop and the laptop, and also run the wizard on the desktop saying it will be getting its connection from elsewhere.

I've not actually done this before, but I've done similar things and have seen people do it, so I know it's possible.

You should try poking around in the wizards, but be warned that it's easy to break your existing configuration; if you don't know how to fix your laptop's settings in case this breaks, I'd advise against doing much here because you might lose both sources of internet access. :-)
USA #20
nah, I don't really know what I'm doing...heh. I messed around a bit with it, but nothing's happening. So I don't want to try and mess anything up. I don't want to explain to my company that I screwed up their laptop. :)
USA #21
> one last question. I downloaded gcc 4.1.2 do I just untar it and then put it in my lib/gcc or how would I make it update it?

gcc 4.x will not build and install on Cygwin... yet.