Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-11

fpc can't compile project because a directory exists

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

I just tried to compile a test.pp file inside my /tmp directory. FPC complained because there existed a /tmp/test/ directory!!

Is this a normal or known limitation of FPC? Or does the blame fall onto the ld linker?

----8<-------------8<-------------8<-------------8<-------------8<---- [tmp]$ fpc test.pp
Free Pascal Compiler version 2.5.1 [2011/09/20] for x86_64 Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Linux for x86-64
Compiling test.pp
Linking test
/usr/bin/ld: cannot open output file test: Is a directory test.pp(35,1) Error: Error while linking
test.pp(35,1) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
Error: /opt/fpc-2.5.1/x86_64-linux/bin/ppcx64 returned an error exitcode (normal if you did not specify a source file to be compiled) ----8<-------------8<-------------8<-------------8<-------------8<----

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/
Marco van de Voort
to Graeme Geldenhuys

In our previous episode, Graeme Geldenhuys said:

I just tried to compile a test.pp file inside my /tmp directory. FPC complained because there existed a /tmp/test/ directory!!

Why is that strange?

Is this a normal or known limitation of FPC? Or does the blame fall onto the ld linker?

I'm not sure what you mean here, what did you expect as result?

The error is reported by LD, and the only improvement is that FPC could check for the existence itself, (e.g. to give a better or localized error message)

Sven Barth
to Graeme Geldenhuys: I just tried to compile a test.pp file inside my /tmp directory. FPC complained because…
Graeme Geldenhuys wrote 7 lines
Hi, I just tried to compile a test.pp file inside my /tmp directory. FPC complained because there existed a /tmp/test/ directory!! Is this a normal or known limitation of FPC? Or does the blame fall onto the ld linker?

Of course this is normal. The compiler - or in this case the linker - tries to create a file "test" (as applications don't normally have an extension like on Windows) and as a directory "test" already exists that fails. So nothing special or buggy here (on Windows you could get a similar result by creating a directory "test.exe")

Regards,
Sven