Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #67003

Re: minGW problem - linking

From James Kuyper <jameskuyper@verizon.net>
Newsgroups comp.lang.c
Subject Re: minGW problem - linking
Date 2015-08-08 11:28 -0400
Organization Self
Message-ID <55C6201D.5000808@verizon.net> (permalink)
References <mq38qh$mvs$1@dont-email.me>

Show all headers | View raw


On 08/07/2015 05:45 PM, bilsch wrote:
> I have a program I developed on a Ubuntu machine using gcc compiler and 
> I want to modify it to rum on Win7.  The program uses SDL for graphics 
> and ncurses for UI.  I installed minGW because it has gcc that runs in 
> Windows and also because the SDL site offers SDL libraries and header 
> files for minGW.  I also got a curses package for Windows. The compiler 
> found several incompatibilities between my program and curses - which I 
> successfully fixed.  Now the linker errors show up.  ld.exe cannot find 
> the libraries for SDL and curses - no matter how I write the linker 
> options on the command line.  For instance if I write the library file 
> path prefixed with capital -L then followed by library file name 
> prefixed with low case -l. Or write the whole path and file name 
> together prefixed with low case -l.  Or if I copy the library files into 
> the build directory and simply write -lSDL2.dll as the link option with 
> no path.  Nothing works.  Here's a typical error message:
> 
> C:/Program 
> Files/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: 
> cannot find -lC:\Users\Owner\SDL2-2.0.3\lib\x64\SDL.dll
> 
> Also I don't understand why the /../../ in the message.  The location of 
> ld.exe is simply C:/Program Files/mingw/mingw64/bin.

Path names like that occur on Unix-like systems as the result of
symbolic links containing ../ sequences, which mean "go up one level in
the directory tree". I'm not sufficiently familiar with Win7 to be sure
whether it behaves similarly. However, the use of the forward slash
instead of the backslash suggests that the message may be being printed
by a program that treats the Win7 file system as if it were a Unix-like
one. On a Unix-like system, one way to get such a message would be if:

/Program Files/mingw/mingw64/bin/ld.exe is a symbolic link to
../lib/gcc/x86_64-w64-mingw32/5.1.0/ld.exe, or, equivalently,
/Program Files/mingw/mingw64/lib/gcc/x86_64-w64-mingw32/5.1.0/ld.exe

That, in turn, is a symbolic link to
../../../../x86_64-w64-mingw32/bin/ld.exe, or, equivalently,
/Program Files/mingw/mingw64/x86_64-w64-mingw32/bin/ld.exe

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

minGW problem - linking bilsch <bilsch01@gmail.com> - 2015-08-07 14:45 -0700
  minGW problem - linking "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-07 17:53 -0700
    Re: minGW problem - linking bilsch <bilsch01@gmail.com> - 2015-08-07 18:56 -0700
  Re: minGW problem - linking Lőrinczy Zsigmond <nospam@for.me> - 2015-08-08 06:37 +0200
    Re: minGW problem - linking bilsch <bilsch01@gmail.com> - 2015-08-07 23:40 -0700
    Re: minGW problem - linking Lőrinczy Zsigmond <zsiga@nospam.for.me> - 2015-08-08 10:27 +0200
  Re: minGW problem - linking James Kuyper <jameskuyper@verizon.net> - 2015-08-08 11:28 -0400
    Re: minGW problem - linking bilsch01 <king621@comcast.net> - 2015-08-08 16:07 -0700

csiph-web