0

I have the following files

example.asd:

(defsystem example
    :serial t
    :components ((:file "first")
                 (:file "second")))

first.lisp:

(defun first-print-hello ()
  (format t "Hello from first.lisp!~%"))

second.lisp:

(format t "Hello from second.lisp!~%")
(first-print-hello)

I can successfully load the system, but doing (asdf:make-build :example :type :program :move-here ".") gives the following error:

LINK : fatal error LNK1149: output filename matches input filename 'C:\path\to\example.lib'

Is there something I'm not configuring properly? It seems to be creating example.lib, then making example.exe link example.lib, and cl does not like them being named the same. Is there a way to specify the name of the resulting executable? Or is this just a bug in ECL's asdf:make-build?

I'm using ECL on Windows 10 with Visual Studio 2015's developer tools.

Rainer Joswig
  • 136,269
  • 10
  • 221
  • 346
jefftime
  • 442
  • 5
  • 14

1 Answers1

0

Don't use make-build, use (asdf:operate :program-op "example")

Or don't use :move-here "."

Faré
  • 952
  • 5
  • 4
  • (asdf:operate :program-op "example") still compiles a .lib and tries to make an executable of the same name. So I'm still getting the LNK1149 error. I looked through the asdf:make-build source, and it indeed does look like it is deprecated. The ECL docs need to be updated. Any other suggestions? – jefftime Dec 06 '15 at 22:05
  • Can you trace uiop:run-program so as to see what link command is getting the error? – Faré Dec 08 '15 at 03:15
  • And can you also trace perform to see which action is failing? – Faré Dec 08 '15 at 03:16
  • 1> (asdf/action:perform # #) was the last command before the compilation fails and I get the LNK1149 error. Error code 2 when executing (run-program "cl" ("-FeC:/path/to/example.exe" "C:/path/to/e65EBtmp.obj" ...)) – jefftime Dec 09 '15 at 05:03
  • Can you trace ext:run-program to get the entire command line? Since this is ECL, can you also trace uiop:create-image and c::builder ? – Faré Dec 09 '15 at 08:18
  • 1
    Thanks a lot! I believe I understand what's happening: the MSVC compiler and linker, cl, is asked to make an example.exe from a series of libraries, including example.lib. Unhappily, that means it first tries to make a library called example.lib, I suppose to contain all the non-MS code in example.exe; and then the same MSVC cl complains that there is already an example.lib in one of the inputs — which suggests that it wants different file names every time. – Faré Dec 12 '15 at 23:00
  • So it seems that it's a combination of a nasty restriction in MSVC cl, that neither ECL nor ASDF knows or tries to deal with. Sigh. – Faré Dec 12 '15 at 23:01
  • 1
    A "solution" would be for ASDF to add plenty of prefixes or suffixes to all these file names. Maybe use the full component-find-path, with / replaced by double underscores, as the output-files names when running on Windows? I'm too tired to figure it out. – Faré Dec 12 '15 at 23:04
  • 1
    You should probably be filing a bug about both ECL and ASDF on this topic. – Faré Dec 12 '15 at 23:04