I am currently trying the Linux Extension of Visual Studio 2015.
I plan to have several target machines using various distribs. So far, my testing machine is a Windows 7 with an up-to-date Cygwin with all needed packages (
"collect2 : error : ld returned 1 exit status"
printf("hello from SandboxLinux!\n");
Ok, found it! Default VS/Linux project options are not suitable for Cygwin:
When switching the VS project build output from "minimal" (the default) to "normal" I could notice there was a problem with the generated
ld command line:
1> Link: 1> Linking objects 1> Invoking ld 1> g++ -o "/home/xxxxx/projects/xxxxxx/bin/x86/Release/xxxxx.out" -Wl,--no-undefined -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack /home/xxxxx/projects/xxxxx/obj/x86/Release/main.o 1> /bin/ld: unrecognized option '-z' 1> /bin/ld: use the --help option for usage information 1> collect2: error: ld returned 1 exit status
(Note 1: the third one has to be manually set to blank as both proposed options use
(Note 2: all other differences between these two screenshots are not tied to this problem. The first is my
release configuration, kept by default, where the second is my
debug configuration, that uses verbose and print-map.)
The program is properly built, it works, and the link with GDB works fine too in debug mode.
-z thing might be an issue when switching from Cygwin to standard Linux platforms later on.