Looking at this thread you can see that it can be done. The guys at GNU suggest
gcc foo.c -Wl,-Bstatic -lbar -lbaz -lqux -Wl,-Bdynamic -lcorge -o foo.exe
More Related Contents:
- Why does the order of ‘-l’ option in gcc matter? [duplicate]
- Static variables initialisation order
- How to make weak linking work with GCC?
- gcc will not properly include math.h
- `bash: ./a.out: No such file or directory` on running executable produced by `ld`
- Linking against older symbol version in a .so file
- Creating static Mac OS X C build
- Why can’t the size of a static array be made variable?
- Linking a C program directly with ld fails with undefined reference to `__libc_csu_fini`
- c math linker problems on Ubuntu 11.10 [duplicate]
- How to link to a different libc file?
- Query on -ffunction-section & -fdata-sections options of gcc
- Removing trailing newline character from fgets() input
- Undefined reference to `pow’ and `floor’
- Adding leading underscores to assembly symbols with GCC on Win32?
- What is the difference between C, C99, ANSI C and GNU C?
- Why didn’t gcc (or glibc) implement _s functions?
- GCC fatal error: stdio.h: No such file or directory
- C++: When (and how) are C++ Global Static Constructors Called?
- Why doesn’t GCC optimize structs?
- How can I multiply 64 bit operands and get 128 bit result portably?
- Status of __STDC_IEC_559__ with modern C compilers
- What is the default C -std standard version for the current GCC (especially on Ubuntu)?
- Check glibc version for a particular gcc compiler
- Why we need Clobbered registers list in Inline Assembly?
- What is “…” in switch-case in C code
- How are static variables with the same name in different functions identified by the System?
- Compiler changes printf to puts
- Linking C++ code with ‘gcc’ (without g++)
- How do I compile the asm generated by GCC?