Nick
Nick

Reputation: 5805

Build using G++ on Ubuntu for RedHat

Is there any way to link against RedHat static libraries while building on Ubuntu and using GCC?

Upvotes: 0

Views: 195

Answers (2)

gby
gby

Reputation: 15218

Copy over the RedHat library and header files to a directory preserving directory structure and give GCC the --sysroot directive to tell it to look in that directory as prefix for searching libs and headers

Upvotes: 2

thiton
thiton

Reputation: 36049

I see two obvious solutions:

  1. Copy /usr/lib, /lib and /usr/include from a Red Hat system into a subtree and point -I and -L to this subtree.
  2. Install a minimal RedHat into a chroot and compile there.

The first solution is the easiest, but you might run into libc version issues. The second solution is guaranteed to work, but not far from running a complete RedHat for compilation.

Upvotes: 1

Related Questions