- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to compile a project under Cygwin(don't know if it matters in this case), and am having a problem getting .lib files to work.
I compile the fortran files with the following options;
ifort /nologo /Zi /libs:static /Od /c /object:i1mach.i i1mach.f
I create the library file with the following line;
lib /out:libncarg_c.lib options.o misc.o ncarg_path.o version.o error.o atoargv.o usleep.o env.o trnspprt.o lblank.o iargct.o rwchinfl.o sdbm.o i1mach.o r1mach.o d1mach.o bcopyswap.o gsbytes.o logic32.o argget.o
I later try to create the target using the lib file;
ifort /Od ccheck.o creb15.o crebin.o dport.o mkmsk.o pcrbin.o xtch.o /link /out:pwritxnt /libpath:../../../.././ncarg2d/src/libncarg /libpath:../../../.././common/src/libncarg_c /libpath:/usr/ncarg/lib /libpath:/usr/X11R6/lib
which gives me the error(among others);
mkmsk.o : error LNK2019: unresolved external symbol _I1MACH referenced in function _MKMSK
I checked the "libncarg_c.lib" and "mkmsk.o" with "dumpbin -symbols" and they both had _I1MACH identified as external. The compilation works when I copy the "i1mach.o" file to the same directory and add it to the ifort command, but that is not going to be possible.
I compile the fortran files with the following options;
ifort /nologo /Zi /libs:static /Od /c /object:i1mach.i i1mach.f
I create the library file with the following line;
lib /out:libncarg_c.lib options.o misc.o ncarg_path.o version.o error.o atoargv.o usleep.o env.o trnspprt.o lblank.o iargct.o rwchinfl.o sdbm.o i1mach.o r1mach.o d1mach.o bcopyswap.o gsbytes.o logic32.o argget.o
I later try to create the target using the lib file;
ifort /Od ccheck.o creb15.o crebin.o dport.o mkmsk.o pcrbin.o xtch.o /link /out:pwritxnt /libpath:../../../.././ncarg2d/src/libncarg /libpath:../../../.././common/src/libncarg_c /libpath:/usr/ncarg/lib /libpath:/usr/X11R6/lib
which gives me the error(among others);
mkmsk.o : error LNK2019: unresolved external symbol _I1MACH referenced in function _MKMSK
I checked the "libncarg_c.lib" and "mkmsk.o" with "dumpbin -symbols" and they both had _I1MACH identified as external. The compilation works when I copy the "i1mach.o" file to the same directory and add it to the ifort command, but that is not going to be possible.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ifort and Microsoft link don't understand cygwin style path names, except with -unix switch. Another possible way is to use doubled backslashes, where the paths are plain Windows paths (no cygwin mounts....). Also, you may want to study the cygpath utility et al.
Possibly of interest, 32-bit static libraries are interchangeable with cygwin .a libraries.
Possibly of interest, 32-bit static libraries are interchangeable with cygwin .a libraries.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually, ifort does understand such path names - all you have to do is add the switch -unix as the leftmost option.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page