c++ - VC12 Command Line Error when Linking .lib Files -


i'm trying compile c++ program vs2013 command window includes , linked libraries. pretty standard stuff. however, microsoft's website explaining syntax not clear me.

i'm trying following command:

cl /ehsc program.cpp /i "\path\to\includes"     /libpath:"\path\to\library\directory" /link libfile1.lib libfile2.lib 

note: it's on 1 line when execute it, readability i've split here.

the quotes because of directories in paths have whitespace in them beyond control (like program files).

i'm trying adapt command property sheet made using visual studio interface, if helps, mapping i'm making is:

  • includepath --> /i
  • librarypath --> /libpath:
  • additionaldependencies (under link) --> /link

i running admin in x64 native tools command prompt on machine running 64-bit windows 10. however, gives me these warnings , errors:

cl: command line warning d9002: ignoring unknown option '/libpath:\path\to\library\directory' cl: command line warning d9002: ignoring unknown option '/link' link : fatal error lnk1181: cannot open input file 'libfile1.lib' 

where going wrong?

the /link option must lowercase , place /libpath option after it:

cl /ehsc program.cpp /i "\path\to\includes" /link /libpath:"\path\to\library\directory" libfile1.lib libfile2.lib 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -