On 11/14/2013 01:34, André Guerreiro wrote:
> Hello all,
> sorry if this is a really basic question, I'm a MingW newbie.
>
> I'm trying to build this code with Mingw-w64 4.6.3
>
> #include <stdio.h>
>
> int main()
> {
> FILE *fp = fopen("SOME_FILE", "r");
> _lock_file(fp);
> return 0;
>
> }
>
> Using the following command:
> /usr/bin/i686-w64-mingw32-gcc -o hello.exe hello.c
>
> it throws the following error:
> /tmp/cc9120Ls.o:hello.c:(.text+0x30): undefined reference to
> `__imp___lock_file'
> collect2: ld returned 1 exit status
>
> I may be missing some linker flag but no idea which one...
>
> Thanks in advance
> Looks like _lock_file isn't expprted by msvcrt at all until Windows 8. msvcrt def needs updating. Note that your program will not run on anything earlier than 8.
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
