Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Shared Library and linked sources
Shared Library and linked sources [message #1719600] Sat, 09 January 2016 16:02 Go to next message
Spongebob Schwammkopf is currently offline Spongebob SchwammkopfFriend
Messages: 1
Registered: January 2016
Junior Member
Hi, i am failing since two days to set up a new Shared Library project with linked sources under linux. What i did was to create a new wokspace and inside this workspace i created a new Shared Library project (Linux GCC). Because i don't want the sources to be in the workspace nor in the project folder i created a linked folder like that:

Quote:
File -> New -> Folder -> Advanced -> Link to alternate Location (Linked Folder)


The structure looks like this:
Workspace: /media/username/MyHDD/C++/MyWorkSpace
Project: /media/username/MyHDD/C++/MyWorkSpace/MyProject
Source Folder: /media/username/MyHDD/C++/Common/MySources

GCC C++ Compiler Settings:
-std=c++0x -DNDEBUG -DUNICODE -D_UNICODE -I/media/username/MyHDD/C++/Common/MySources -O3 -Wall -c -fmessage-length=0


But building this i got the following error:

Quote:
Nothing to build for project MyProject


So i added the linked source folder as an include path:

-I/media/username/MyHDD/C++/Common/MySharedLib

Quote:
Properties -> C/C++ Gerneral -> Paths and Symbols -> GNU C++ -> Includes


but failing again because some sources in sub folders of this linked folder could not be found:

FolderXY/subdir.mk:39: recipe for target 'FolderXY/FileXY.o' failed


Even adding the source files like this to the project

Quote:
File -> Import -> File System -> Advanced -> Create links in workspace


had no success. So please tell my why eclipse can't do, what every other IDE can do.
Or what is the right proceeding to accomplish this setup.
Re: Shared Library and linked sources [message #1719766 is a reply to message #1719600] Mon, 11 January 2016 21:25 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Ecliipse doesn't seem to know about your source files. At least that's the impression I got from your -std=c++0x -DNDEBUG -DUNICODE -D_UNICODE -I/media/username/MyHDD/C++/Common/MySources -O3 -Wall -c -fmessage-length=0. Where did this come from? The build log? If so, there is no source file in it.


You apparently don't realize that FolderXY/subdir.mk:39: recipe for target 'FolderXY/FileXY.o' failed is a message saying the make failed but it isn't telling you why. For that. you need to look at the error messages which preceded it.

The -I flag tells the compiler where to look for included files and not where to look for the source.

You haven't given enough information to see what you've really done.
Can you post an image of the full tree of your project file?
Also a copy of the complete build log when you try to build.

Are you trying to use a relative path? That seems to be checked by default. It must end up somewhere that actually exists. I'd recommend absolute file paths (staring with '/' root) until you get something working.

After you link the files it should look something like this:

index.php/fa/24586/0/

Once it looks something like the above (subfolders are OK), you can select the file and right-click Properties ==> Resource. It should say Linked File. If you press the Edit... button it will show you where and give the opportunity to change it.




[Updated on: Mon, 11 January 2016 21:31]

Report message to a moderator

Previous Topic:undefined reference to Structure error
Next Topic:Eclipse won't show me the finished program (C)
Goto Forum:
  


Current Time: Fri Apr 26 16:58:46 GMT 2024

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

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

Back to the top