building an executable?

127 views
Skip to first unread message

jk

unread,
Mar 9, 2012, 12:24:05 PM3/9/12
to vsclojure
I installed vsclojure 2.0.0 on Visual Studio 2010. I created a console
application but there is no executable that results from building the
project. When it is done building, there are some dlls and the *.clj
file in bin/Debug. Is this normal?

Also, when I try debug/run to run the app, I see an indication about a
successful build but nothing else happens. I tried putting a
breakpoint on one of the lines in case it was somehow running so
quickly that I couldn't see it but nothing, it never hit the
breakpoint either (we're talking just a few println's here).

If I run the program in the REPL everything works exactly as expected.
Am I missing something?

KWLisp

unread,
Mar 24, 2012, 11:18:27 PM3/24/12
to vsclojure
I have about 2 hours experience with Visual Studio, but this is what I
found: In the Solution Explorer window, right click the project name
(it's in boldface) and select Properties. For my project, the Startup
File was shown as intro.exe

Doing a search revealed that this .exe was being created not in my
project folder, but in C:\Users\elided\Appdata\Local\Microsoft
\VisualStudio\10.0\Extensions\vsClojure\vsClojure\2.0.0\Runtimes
\1.3.0\intro.exe

I changed intro.exe to include the full path, and it worked! F5
builds the project and runs it

If anyone knows how to configure vsClojure to build the exe in the
project folder, please share the secret

KWL

Daniel Cotter

unread,
Apr 13, 2012, 2:46:44 PM4/13/12
to vsclojure...@googlegroups.com
I'm having the same problem as you. If you look at
https://github.com/clojure/clojure-clr/blob/master/Clojure/Clojure.Compile/Compile.cs,
you can see that the Clojure.Compile executable is looking for an
environment variable called "CLOJURE_COMPILE_PATH", which it uses to
decide where to put the output of compilation. However, once it
compiles everything, it still outputs "Compiling to .", as if the env.
var. were never set and it is having to use its own current directory
instead. I've tried setting it as a user variable and a system
variable, and it doesn't want to work either way. Any ideas, anyone?

Daniel Cotter

unread,
Apr 13, 2012, 4:42:07 PM4/13/12
to vsclojure...@googlegroups.com
I added the following lines to the last target in the .csproj file to get MSBuild to copy the compile executable to the output directory after compilation:

<Copy SourceFiles="$(ClojureRuntimesDirectory)\$(ClojureVersion)\$(StartupFile)" DestinationFolder="$(OutDir)" SkipUnchangedFiles="$(SkipCopyUnchangedFiles)" OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" Retries="$(CopyRetryCount)" RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)" UseHardlinksIfPossible="$(CreateHardLinksForCopyAdditionalFilesIfPossible)">
      <Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
    </Copy>

It is basically a clone of the other copy task in the project file. I've also pushed these changes up to my forked copy of the repository if anybody wants to download the amended version (http://github.com/androidicus/vsClojure). And if there's a more elegant way to be doing this (and I'm sure there is -- this is basically my first foray in to MSBuild-land), feel free to share it.

Daniel

Liang

unread,
Aug 25, 2012, 11:47:25 AM8/25/12
to vsclojure...@googlegroups.com
I have exactly same finding. My one is the default project template, where "Hello world" is print. Run from the same folder as yours, no problem.

Other than how to build the executables under the project folder, I have one more question. How can we create and reference the DLLs (from another project, eg c# console) rather than EXE file?
Reply all
Reply to author
Forward
0 new messages