Hi. I'm trying to compile file "test.c" with gcc 8.1 on Windows. The file contains following code: __declspec( dllimport ) void foo(void); __declspec( dllexport ) void bar(void) { foo(); } The compilation step works fine: C:\test>gcc -m64 -c test.c -o test.o The linking step fails: C:\test>gcc -m64 -shared -o Test.dll test.o test.o:test.c:(.text+0xb): undefined reference to `__imp_foo' collect2.exe: error: ld returned 1 exit status Similar code on Linux works fine and generates a shared library with undefined symbol "foo". That is what I want to do on Windows too. The goal is to create an application that uses Test.dll and also another shared library FooLib.dll which _does_ define the "foo()" function - i.e. at the dynamic linking step during process creation the symbol _will_ be available. I would prefer to _not_ add library FooLib to the linking step of Test.dll due circular dependencies. How can this be solved? -- regards Rastislav Stanik