From: Ian L. <dr...@gm...> - 2006-08-08 20:16:35
|
Hello all, I'm trying to access a windows.h function with mingw. My test program compiles fine, but then complains about an undefined reference during linking. Here's the test program: #include <windows.h> int main(){ CreateHardLink("C:\\iantest.txt", "C:\\msys\\1.0\\home\\Ian\\ian.txt", 0x0); return 0; } And I'm compiling with: gcc test.c (and I also tried "gcc test.c -lkernel32") Which gives me this error: C:/DOCUME~1/IANLAR~1/LOCALS~1/Temp/ccoFaaaa.o(.text+0x42):test.c: undefined reference to `CreateHardLink' collect2: ld returned 1 exit status Looking in the kernel32.dll with objdump, there definitely seem to be symbols for CreateHardLink. What gives? Thanks in advance for the help, Ian Larsen |