From: Richard M. <jp...@gm...> - 2009-09-08 20:14:25
|
On 09/08/2009 03:44 PM, Paul Osmialowski wrote: > > > On Tue, 8 Sep 2009, Richard Mattes wrote: > >> Hi Sebastian, >> >> You're using Eclipse, which means it's probably managing your makefile >> for you. In order to get it to compile correctly, you have to add a few >> things to the project properties. These will tell Eclipse to include >> the necessary files to compile your test program. >> >> 1. You can go ahead and remove all of those Player source files from >> your project, you don't need them there. We'll tell Eclipse how to find >> them where they're installed. >> >> 2. Right click on your project in the left pane, and go to Properties. >> Under C/C++ Build, click on Settings. >> >> In the "GCC C++ Compiler" options, you'll see a folder called >> "Directories". Go into that, and add the directory >> "/home/$USER/PlayerStage/include/player-2.1" (assuming that's where you >> have Player installed). When you install with the default settings, >> they'll go to "/usr/local/include/player-2.1" >> >> In the "GCC C++ Linker" options, you'll see a folder called "Libraries" >> You'll want to add the library "playercore" to the Libraries box. If >> you haven't installed the libraries to /usr/lib or /usr/local/lib, >> you'll have to add an additional Library Search Path (probably >> "/home/$USER/PlayerStage/lib" from the looks of what you've done.) >> >> 3. Change your include path to >> #include<libplayerc++/playerc++.h> >> >> >> >> The "Undefined Reference" error you're getting usually means that GCC >> can't find a library that accompanies a header file you're using. In >> this case, GCC can't find what's in playerc++.h because you're not >> including the library at compile time. By adding the library to your >> project settings, Eclipse will add them to your compile options when it >> calls g++. >> >> Hope this helps >> >> Rich Mattes >> >> > Gosh, how harsh is it! Is there any better way to cause Eclipse to use > pkg-config instead of doing manual setting?! > > Paul > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Playerstage-users mailing list > Pla...@li... > https://lists.sourceforge.net/lists/listinfo/playerstage-users Hi Paul, There is a better way: Don't let Eclipse manage your Makefiles. There's an option to create what's called a "Makefile Project" in the project wizard. You can select the Linux GCC toolchain, and it autogenerates a blank source file and a blank makefile for you. From there, just use the example makefile for playerc++ as a starting point. You just have to add the include folder path if you want Eclipse's code indexer and auto-completion to work. It's still a lot easier than adding every library you need, especially once your project gets really big (or you need to include a big library like GTK.) Other than that, I don't know of an easy way to use pkg-config or cmake within the Eclipse environment (actually I haven't even tried cmake yet...) And to Sebastian: glad I could help. Rich Mattes |