2

I was wondering if it's possible to create a shared library for Linux from within Visual Studio 2017?

Or would I have to develop on Linux and compile for Windows instead?

Thanks!

JamieRhys
  • 206
  • 6
  • 24
  • The potential dupe is now 7 years old. Nothing has happened since then? – Bo Persson Jan 07 '18 at 10:29
  • Well the new way maybe run gcc/clang insider docker instead of a cross compiler. – Non-maskable Interrupt Jan 07 '18 at 13:44
  • Yes. Use this : https://blogs.msdn.microsoft.com/vcblog/2016/03/30/visual-c-for-linux-development/ You'll need a Linux system with `gcc` etc. installed but it can be a VM or WSL (no need for another box) and you'll work entirely with Visual Studio. – stanthomas Jan 08 '18 at 02:24

2 Answers2

1

Visual studio can't build linux library with its built in toolchain, so you need an extern build system.

You have two option for the external toolchain:

  1. cross compiler
  2. docker

cross compiler is more suited for clean/freestanding environment. If your code rely on certain 3rd party libraries (and your target linux is compatible) it might be more convenient to use docker.

Non-maskable Interrupt
  • 3,841
  • 1
  • 19
  • 26
0

Visual Studio 2017 can run external tools, so if you have a compiler that will generate Linux code while running on Windows you can do it.

If you have a Windows computer and a Linux computer in the same network, you can also set up Visual Studio on the Windows computer to run tools on the Linux computer.

Sid S
  • 6,037
  • 2
  • 18
  • 24