- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
In VS2015, how do I configure my project to prevent linking (i.e. only create object files)? I have tried using the /c option but VS2015 is still is giving linking errors:
fatal error LNK1120: 1 unresolved externals error LNK2019: unresolved external symbol _MAIN__ referenced in function _main
Thanks...
コピーされたリンク
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
For a single source file, under the Solution Explorer one can right-click and select Compile, or left-click on the source file to set the focus and then use Ctrl-F7.
For a project, under the Solution Explorer one can right-click on the Project, then under Project Only select Build Only, or via the Build menu pull-down do the same; however, this is not functioning as expected with Intel Fortran projects. I’m currently using our PSXE 2017 Fortran integrations (Version 17.0.0036.11 ) with MSVS and this build selection is both compiling and linking with a Fortran project. It behaves as expected with a C/C++ project, compiling the project only.
Unfortunately I could not find a work around.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Create your project as a "Static Library" project rather than Console Application, etc.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Actually, it turns out this isn't behaving for C++ projects either so I may have the wrong impression of this Build Only option. I'll discuss this w/Development.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Build Only works fine - but if your project is an executable (or DLL) project, it will link. That's why I suggested using a Static Library project when you have no main program.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Steve is correct. Development confirmed that for Build Only, if the build normally includes compilation and linking, then both are performed.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Even for a static library project, the build process probably calls LIB.EXE as the last step, although this is unnecessary if no static library is desired. The extra time consumed, however, is probably small. Perhaps there has been little demand for an objects-only project and so there is no corresponding VS template for it.
