nim


How to change Nim compiler output file location and name


Compiling a Nim program with nim c -r example.nim creates the output file example. I would like to create an output file in another folder with the name bin/example.o which is much easier to gitignore.
What I've tried so far:
nim c -r example.nim -o:bin/example.o
nim c -r example.nim --out:bin/example.o
nim c -r example.nim -o:example.o
nim c -r example.nim --out:example.o
The result of all of these attempts is the same as if I left out the -o/--out option, resulting in an executable example file in the same folder as the example.nim file. The compiler doesn't even accept the option if I don't pass in the -r option (which makes me think I'm misunderstanding the purpose of that option).
I'm using Nim 0.10.3 installed and compiled from the github devel branch source.
What compiler option will allow me to modify the compiled output file?
What you're doing is right, but the options have to be before the file you're compiling. You specify -r to execute the file after compilation, so it will be run with all the arguments specified after the file.
So this should work:
nim c -o:bin/example -r example.nim
nim c -o=bin/example -r example.nim
nim c --out:bin/example -r example.nim
nim c --out=bin/example -r example.nim

Related Links

How do I create a directory?
Why is my string nil?
Nim code parser
What's the meaning of “magic” pragma in nim?
Unpack multiple variables from sequence
Nim: How to prove not nil?
Error: expression has no address
MD5 on an array, array[0..63, uint8] to cstring conversion
Converting a seq[char] to string
Nim: On mac, cannot open standard import
How to compare two typedesc in a template for equality
Is there a “default” file name that can be used for importing modules?
Unable to get StringStream created from marshal to output the data
Initialize a seq of seqs
How to change Nim compiler output file location and name
Compile-time Call Count in Nim

Categories

HOME
batch-file
phpword
telegram
dns
alexa-skills-kit
nunit
powerpoint
camera
devise
edge
entity-framework-core
babeljs
settings
iis-6
webix
github-enterprise
code-generation
shared-libraries
azure-powershell
google-container-registry
sigma.js
selinux
breadth-first-search
googlebot
blade
object-storage
scriptella
google-api-client
xcode-ui-testing
tiki-wiki
onload
beautifier
pylons
jackson-modules
angularjs-components
has-and-belongs-to-many
wcag
rpgle
gp
vex
winpe
eviews
postback
powershell-ise
jbutton
activexobject
indy10
docfx
chef-solo
softmax
congestion-control
drupal-theming
facebook-social-plugins
fwrite
dotnet-httpclient
launchctl
video-conferencing
appdomain
context-sensitive-grammar
reshape
cpu-cache
android-instrumentation
javafx-css
google-cloud-console
uicolor
drawstring
xdoclet
observablecollection
respondcms
swizzling
riot
nss
yajsw
linklabel
grgit
java-money
wiredep
microsoft-reporting
ons-api
opserver
toolkit
finalbuilder
git-ftp
matlab-deployment
cakephp-2.7
umlgraph
public-html
jbake
teaspoon
jqmodal
jammer
observium
floating-point-exceptions
cgimage
jquery-address
hibernateexception
flex-mobile
procedures
denied
android-holo-everywhere
rmdir
multiplatform
unattended-processing
updatesourcetrigger
ajax-polling
opml
sifr
spread
fail-fast-fail-early
sqlobject
flvplayback

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App