[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Linking C main() to shlibs with Fortran sources using ccc/fort



Greetings,

I'd like to link some shlibs with some Fortran source to some C programs using the Compaq compilers to compile everything. Trouble is, some of the Fortran objects need symbols like for_write..., which are provided by libfor.so, and that in turn needs this "MAIN__()" symbol, which is *only* provided by an fort-compiled object file with a Fortran PROGRAM statement, it's not in any of the libs which come with fort, nor in for_main.o.

I've noticed that if the libs are static, linking works just fine, but if I rebuild objects to shared libs using:

${LD} -shared -soname,$$LIBNAME.${SLSUFFIX} -o $$LIBNAME.${SLSUFFIX} *.o

then linking against the resulting shlibs fails with an undefined reference to MAIN__() in libfor.so. Also, if I provide a C function like:

void MAIN__()
{
   printf ("hello world\n");
}

then it links fine, but hello world is never printed, so the function is never entered. I'd really like to not have to provide this bit of code for this one arch/compiler combo...

Is there a way to do this?

Thanks,
--

-Adam P.

GPG fingerprint: D54D 1AEE B11C CE9B A02B  C5DD 526F 01E8 564E E4B6

Welcome to the best software in the world today cafe! <http://lyre.mit.edu/%7Epowell/The_Best_Stuff_In_The_World_Today_Cafe.ogg>




--
To UNSUBSCRIBE, email to debian-alpha-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: