Hi all!

I'm building a static library named `lightclient` on macOS via this command 
invocation:
    
    
    nim c --app:staticlib --header:lightclient.h --noMain lightclient.nim
    
    
    Run

During the final stage, when the build process invokes `ar` tool, i get this 
error:
    
    
    Error: execution of an external program failed: 'ar  
@lightclient_linkerArgs.txt'
    
    
    Run

Seems that is because Nim compiler by default invokes version of `ar` from 
Xcode command line tools, which does not support reading parameters from files. 
I tried modifying the path for Nim compiler invocation:
    
    
    PATH=/usr/local/opt/binutils/bin:$PATH nim c ...`
    
    
    Run

which works. However, later on, when i try to link the resulting static library 
with another executable, i get `ld` linker errors, complaining that
    
    
    ld: warning: ignoring file liblightclient.a, building for macOS-x86_64 but 
attempting to link with file built for macOS-x86_64
    
    
    Run

so i'm at loss now.

Can someone please shed some light on this? Maybe there is a way to tell Nim to 
use macOS's default tools without fiddling with the `PATH`, or some other 
options?

Thanks a lot.

Reply via email to