Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Using linked resources
Using linked resources [message #1797204] Sun, 28 October 2018 05:06 Go to next message
Victor Nguyen is currently offline Victor NguyenFriend
Messages: 1
Registered: October 2018
Junior Member
I have a C++ Project (GNU compiled, Windows) and am writing a separate unit test project for it. Because both projects are physically separated and I don't want to copy source files into the test project I'd like to use linked resources. The trouble is that the linker does not find the linked files in the test project. I've done the following:
1. Defined the path variable
2. Placed a linked folder using the path variable
3. Declared linked folder as source folder
4. Use the linked folder in code to reference code in test project
Re: Using linked resources [message #1797306 is a reply to message #1797204] Mon, 29 October 2018 16:58 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Eclipse linked resources are not what you think they are.
You will need to specify the headers and objects (libraries) to your major project in your test project.
I presume you are having Eclipse CDT create the makefiles for you.
If so,

    o) You will need to have each unit test in a separate project. Eclipse will not create a makefile with more than one executable,
    o) The easiest place to add the links is Project --> Properties --> C/C++ General --> Paths and Symbols
    o) If you are using Paths and Symbols, you will need to enable the CDT Managed Build Settings provider in Project --> Properties --> C/C++ General --> Preprocessor Include Paths, Macros, etc. --> Providers tab to get the Indexer to see them


You can also provide a symlink to the necessary headers and source in your unit test projects.

You may also want to specify the project build order in
Window --> General --> Preferences --> Workspace --> Build
This order will be used for Project --> Build All



Previous Topic:Can I "automate " build before "Run as"?
Next Topic:how to write data into a Excel file in C++
Goto Forum:
  


Current Time: Thu Apr 25 01:05:41 GMT 2024

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

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

Back to the top