0

actually what i wanted was to compile libusb- 1.0.19 in visual studio ?

sugar
  • 3
  • 2
  • Or if you use VS, just add your file to a console project and compile it [port it] from there. – Ender Aug 29 '14 at 05:42
  • @Ender I am very doubt that MSVS have a headers of GNU/Linux and libraries that realizes GNU/Linux functionality through WinAPI . Sugar have to use Cygwin, as said by Abnishek. – Hi-Angel Aug 29 '14 at 05:52
  • @Hi-Angel - hence the comment about "porting it" if so desired. – Ender Aug 29 '14 at 05:56
  • @Ender oh, well, then I see. You just said it so easily that it looks like Sugar just have to export source into VS and compile it. – Hi-Angel Aug 29 '14 at 06:00

2 Answers2

1

You can use cygwin for the purpose see here and C++ cross-compiler from Windows to Linux

Community
  • 1
  • 1
Abhishek Bansal
  • 5,197
  • 4
  • 40
  • 69
0

Windows is not a POSIX operating system. It means the libraries, the system calls and many other things are not working in the same way in Linux. Microsoft Visual Studio uses the Windows libraries and there is no native way to compile a linux program with MVS unless you spend time to modify your linux program and find workarounds to each build error. It can take a lot of time!

The other solution is to use a POSIX compatible compiler. On Windows there are to main projects:

Both are originally from the same project but they are know two independent projects. Both Cygwin and MinGW provide the compilers gcc and gpp.

The main difference between these two projects is that Cygwin require a dll to run programs compiled on Cygwin. MinGw doesn't not.

If you still want to compile your programs with MSV the solutions are:

  1. Using Cygwin, adjusting your MSV settings to use gcc
  2. Using MinGW, adjusting your MSV settings to use gcc-mingw
  3. Spending time to make your linux progam compatible.
nowox
  • 25,978
  • 39
  • 143
  • 293