The basic style for linking two objects. I can't gaurantee this is accurate for your linker version.
Code:
C:\usr\home\jgalloway\toy\link>cl /c main.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
main.c
C:\usr\home\jgalloway\toy\link>cl /c foo.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
foo.c
C:\usr\home\jgalloway\toy\link>link /out:foo-style.exe main.obj foo.obj
Microsoft (R) Incremental Linker Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.
C:\usr\home\jgalloway\toy\link>foo-style.exe
Hello World, foo-style!
C:\usr\home\jgalloway\toy\link>
The source files, for reference.
Code:
// foo.c
void foo(void);
int main (void) {
foo();
}
Code:
// main.c
#include <stdio.h>
void foo (void) {
printf ("Hello World, foo-style!");
}