How do I use boost bcp?

只谈情不闲聊 提交于 2020-01-01 10:02:08

问题


I have the bcp tool, it came pre-built with the boost installer. I'd like to extract the dependencies I need from boost into a smaller file, since I'd like to be able to build this project at school. I'm trying to use bcp, but I don't understand how to use it, despite these instructions: http://www.boost.org/doc/libs/1_52_0/tools/bcp/doc/html/index.html#bcp.syntax

I've tried typing: bcp boost/thread.hpp /"E:\documents\Dropbox\School\Comp 445\Comp445_Assign2_v2\boost2" from the command prompt, from within my boost folder: C:\Program Files (x86)\boost\boost_1_51

It just spits out a "usage" guide: bcp {dbtable | query} {in | out | queryout | format} datafile

I've also tried: bcp timed_mutex /, bcp mutex / to no avail.

I find this really confusing; it doesn't look at all like what they say in the boost documentation, and I'm not sure what a lot of this means in any case. I've found a lot of threads where people recommend bcp, but I've had a hard time finding any where people are asking how to use it.


回答1:


As @Rup pointed out in the comments, the likely error is that you have SQL Server's Bulk Copy Program present on your system. That program is also named bcp.exe and is most likely present in your PATH environment variable. The Boost bcp is either not present in your PATH, or is preceded by the SQL bcp (Windows will stop searching for other programs as soon as it finds a match).

To call the Boost bcp you should either

  1. Rename it to something else (e.g. boost-bcp) and update your PATH variable to reflect that and make sure there are no other conflicting names. Then call with "boost-bcp" --YOUR_OPTIONS.
  2. Call the Boost bcp with the full path to its current location, e.g. "C:\Boost\bcp.exe" --YOUR_OPTIONS


来源:https://stackoverflow.com/questions/13407664/how-do-i-use-boost-bcp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!