Search code examples
powershellcompiler-errorscompilationmingwlinkage

Compiling a gcc library with 1.0 in name from powershell


I am trying to compile a project using the libusb-1.0 library. When i compile from cmd with the following command

gcc -g main.c -o test.exe -lusb-1.0

my program compiles just fine. However if I try to use the Powershell window inside VSC i get this error

gcc.exe: error: .0: No such file or directory

I've run the same code from both terminals. While I still can compile and run my code, it would be convenient if I could do it from within VSC. How can i fix this error?


Solution

  • Try with (double) quotes around the -lusb-1.0 parameter.