Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Cross compiling with pkg-config problems
Cross compiling with pkg-config problems [message #1697831] Mon, 08 June 2015 18:08 Go to next message
Peter Glade is currently offline Peter GladeFriend
Messages: 1
Registered: June 2015
Junior Member
Hallo guys,

I have a question about cross compiling with pkg-config.
I want to develop a c++ program for my raspberry pi 2.
For performance reasons i write my code on my Mac with Eclipse Luna CDT.

The working dir for my project is a shared folder which is located at the raspberry. So I can write and build the code on Mac and directly recompile and run on the pi. That's the plan.

The problem is:

I need library's like gtk+3.0, which i import, for cross compiling reasons, via pkg-config (pkg-config plugin for eclipse).
This writes me the needed library paths and library's to my makefile.
So if I "make" the same build from the raspberry, it searches for the same library path, which it don't find because this are the paths from my Mac.

It there a way to "soft code" these pkg-config routine, that he don't write the paths itselfs to the makefile and writes something like " pkg-config --libs --cflags gtk+-3.0"

Thanks for you help

Greetings from Germany Wink

Peter C. Glade
Re: Cross compiling with pkg-config problems [message #1716978 is a reply to message #1697831] Wed, 09 December 2015 12:18 Go to previous message
Ionut Neicu is currently offline Ionut NeicuFriend
Messages: 1
Registered: December 2015
Junior Member
Hi,

First of all, you should use pkg-config from your cross compile toolchain which is different from the your host uses. Also you have to pass the PKG_CONFIG_PATH environment variable to the folder where the entire RPI stuff is.

For example, if your RPI rootfs is mounted in some folder, modify PGK_CONFIG_PATH to point in that folder + the subdirs pgk-config would look in on target. There are some .pc files pkg-config has to find.

I've been through this so I created a set of scripts at https://github.com/ionutneicu/rpi-cross-scripts

There are "local" and remote versions. Those without "local-" prefix can run directly on PI with sshfs mounts. You could invoke the scripts to set the environment, then you can start Eclipse. You can take a look on what they export and adapt for your needs, there is a step-by-step tutorial behind. I used them with Eclipse CDT/Ubuntu/RPI B+ aand everything worked fine for me.

Ionut
Previous Topic:CDT Outline Not Working
Next Topic:Building CDT plugin
Goto Forum:
  


Current Time: Thu Sep 19 10:05:57 GMT 2024

Powered by FUDForum. Page generated in 0.05967 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top