Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have built a static library which consists of a c++ wrapper around some FORTRAN routines. My hope was that once I had built the library on a PC wich has the FORTRAN compiler, I could link my static library with my app on another PC without having to have the FORTRAN compiler installed but when I try to build the app, it is saying it cannot find ifconsol.lib which is one of the FORTRAN compile's library files.

Is there a way to make my lib truly self-contained or will I always need to have the FORTRAN compiler installed on the same PC?

I haven't got to the stage of getting a running app yet so it may well ask for some FORTRAN DLLs also but I think these are redistributable and so can legally be installed.

Thanks
Posted

The problem you're seeing is that a static library won't really have it's dependencies linked until you actually use it in an exe (or dll). A dynamic library however, does result in a binary (versus object files) that is independent, so you should be able to do that.

If you'd like to stick to using the static method however, being dependent on a lib is not the same as requiring a whole compiler, so it is valid to use the lib as a dependency in the project.
 
Share this answer
 
I figured out the solution.

It appears that the FORTRAN library files needed by the linker are in fact contained in the redistributable package but Visual Studio was not picking them up. I had to add the full path to the FORTRAN redistributable folder in Visual Studio's 'Directories'. In case anyone has a similar problem, the directory settings are under...

Tools->Options>Project and Solutions->VC++ Directories->Library Files
 
Share this answer
 
Comments
Albert Holguin 27-Jan-14 16:12pm    
In another words, the linking is occurring when you're actually using the static library, as I had previously stated.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900