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

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
How To Convert Slice To Sequence?
Cannonical way to do circular dependency in Nim
toSeq(some_string) Type Mismatch
Why is there a warning not to use system.cmp[string] for Nim string comparison

Categories

HOME
cygwin
delphi-7
prism
rsa
obfuscation
apiblueprint
jsf-2.2
pclxl
seo
database-normalization
web-hosting
crystal-reports-2013
arangodb
32bit-64bit
little-proxy
alamofire
redis-sentinel
jxl
nancy
onedrive-api
magnetic-cards
null-pointer
chargify
undertow
blade
babel
libigl
php-mysqlidb
short-url
google-cloud-print
oculus
progress-bar
angular-translate
tizen-tv
testcomplete
autodesk-designautomation
left-join
cart
erb
pop3
reverse
lint
playframework-2.1
timing
sessionstorage
bc
typesafe-config
dbnull
placeholder
android-exoplayer
oim
openresty
ntvs
yii2-api
configurationmanager
identification
carrot2
otp
offline.js
mapxtreme
microstation
google-cloud-console
iotivity
synonym
simevents
refinerycms
tracker-enabled-dbcontext
data-protection
phpwebsocket
database-relations
findfirst
relativelayout
rewrite
extjs-grid
finalbuilder
alloy-ui
osc
xmltype
public-html
post-commit-hook
teaspoon
psr-4
create.js
wxformbuilder
memset
dot42
draw2d-js
spring-remoting
vbe
clickbank
amslidemenu
qscrollarea
visual-studio-express
device-width
web-farm
adobe-media-server
correlated-subquery
azman
multiplatform
uipagecontrol
inline-formset
facebook-iframe
vs-android
data-mapping
sifr3

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