I am working on an avr project in eclipse and include files supplied by the compiler. Eclipse recognize the includes in code (i.e. no question mark by the #include) but it does not resolve the defines in the included files, i.e. PINA is not recognized as a memory address.
I've tried to add the include directory as a library path in Paths and Symbols. I've tried to add it as a library path to the build settings. Neither one worked.
I am using Eclipse Indigo and ImageCraft compiler. Furthermore, in the projects I've included imagecraft's include directory as a link (to enable search).
Any ideas?
Project should be created as a standard C project. Under Project / Properties / C/C++ General / Paths and Symbols in the Includes tab. Choose Add... and point it to the library path (in my case: C:\icc7avr\include). That seems to solve it for most projects.
However I have a nested project (project is a subset of another project) where this doesn't work.
Related
I have an autotools project that references an external directory containing build output of a different project (headers, libs, etc...). configuring and building via command line works fine. After importing via eclipse as an existing autotools project, none of the headers/references in that second project are found by eclipse.
Eclipse also fails to find a few libraries/headers that are in non-standard system locations like /opt, etc... Thus, autocomplete, ctrl+click, etc... doesn't work on a lot of things.
Both the second project and the non-standard libraries are correctly referenced when building/compiling and are found properly by configure
I'm able to manually add the necessary paths in the C/C++ build settings to get all of the includes resolved, but I was under the impression that importing an autotools project should automatically find these references. Am I incorrect in that assumption?
An additional note, our configure script requires the use of --prefix to know where to find the second project. when importing the project the first time, it of course tries to autoconf everything without --prefix set and subsequently fails. I then go back in and modify eclipse to use the appropriate prefix OR manually re-run autogen and configure with --prefix=/some/path. Then re-index the project. so everything should be setup fine at this point.
The actual question seems to be this:
I'm able to manually add the necessary paths in the C/C++ build
settings to get all of the includes resolved, but I was under the
impression that importing an autotools project should automatically
find these references. Am I incorrect in that assumption?
Your own experience tells you otherwise, notwithstanding your prior expectation.
In an Eclipse Autotools project, an Autotools build system is used to (configure and) build the project instead of any of Eclipse's built-in builders. To the extent that there is a data flow between components, it is from Eclipse to the project, not the other way around. The distributed Autotools artifacts (Makefile.am, configure.ac, etc.) are opaque to Eclipse, except inasmuch as it has content highlighting for those file types (IIRC). Artifacts built by configuring the project are not only opaque, but also ignored by policy.
I have a project that containst source/header files that are from 3rd party. In my project I have the same filename in a different path (e.g. version.h). The scanner is resolving the includes to the wrong file and therefore fails to parse my source files properly.
That's what I have done:
I explicitly configured the project path to not be part of the source path.
Third party libraries are not on include path nor on source path (but a still a subfolder in the project).
The toolchain is "No ToolChain", as it is a NMAKE project created by CMake.
The include directories has been hand selected to exclude not wanted includes and explicitly add wanted includes.
How can I force eclipse to only resolve the files based on the configured include and source pathes?
You can try turning off Allow heuristic resolution of includes. This is a global setting in Preferences -> C/C++ -> Indexer. It can also be overridden per project in the project's settings.
My workspace contains 4 static lib projects and one executable project (which links these static libs).
Now I want to create separate build configuration where TEST_GATE is set, so in c++ code this #ifdef TEST_GATE evaluates to true.
So in all of my 5 projects I've copied Release configuration, named it ReleaseTest and added TEST_GATE symbol in project properties.
Now all 5 projects are build into new folder ReleaseTest and my problem is that i need to link static libs in the main project properties. I do this in C/C++ Build / Settings / GCC C++ Linker / Libraries, and this configuration is NOT configuration dependent. So I should select either "Release" version of static library or "ReleaseTest" version of static library. But I need to switch this automatically depending on what confuguration i'm currently building.
How can I solve/workaround this issue?
In the Project / C/C++ General / Paths and Symbols / References you can change the configuration for every referenced project. After you change the checkboxes you can check the folder where eclipse is going to look for the libraries in the Library Paths tab.
I have an eclipse plug-in working fine within eclipse environment.
I wanted to export it into a jar file, so I chose Export > Deployable plug-ins and fragments.
I could get a jar file, but an error was reported.
Opening the log file, it reports that I have 1242 problems (191 errors, 1051 warnings). This is some copy from the error log.
2. ERROR in /Users/LSclipse/src/lsclipse/LSDiffRunner.java (at line 61)
import edu.washington.cs.induction.OnePipeLineScript;
^^^
The import edu cannot be resolved
----------
3. ERROR in /Users/LSclipse/src/lsclipse/LSDiffRunner.java (at line 261)
OnePipeLineScript.getMatchingForRefFinder(projName, proj1, proj1Loc
^^^^^^^^^^^^^^^^^
OnePipeLineScript cannot be resolved
Why I got errors? I had 2049 warnings, but no error when I compile the plugin in eclipse IDE.
ADDED
The main project references two other projects, and references many external libraries. I attach the package view and Java build path.
There were multiple issues involved for this problem. However, the core issue was that the project apimatching and originanalysis were not eclipse plugins but just java projects. As a result, those two projects were not included in the final jar file to break the build.
Symbolic linking the two projects into the main project
I solved this issue by symbolic link the src directory into the main eclipse plugin project.
ln -s /workspace/seal/edu.ucsc.originanalysis/src /LSclipse/originanalysis
ln -s /workspace/seal/edu.ucsc.apimatching/src /LSclipse/apimatching
From the Java Build Path/Source tab, I added those two included projects as source. Eclipse Java Missing required source folder: 'src'
Now I have eclipse plugin jar file without error.
Then click F-5 to refresh the project explorer and check they are java src directory.
Select the included projects in Build tab.
Updating bin.include and source.. in build.properties tab is important. One should understand that in bin.include the ordering is also critical. lib/cdtparser.jar and lib/cdtcore.jar should be placed prior to the user of them - origin analysis/.
Copying jar files for included project into main project
I also had to copy some jar files in those projects file into the main project, and select them in Binary Build tab.
And add tim in Runtime/Classpath tab.
Select the JavaSE-1.6 in Execution Environments.
I have lots of "Must Override a Superclass Method" errors. With the hint from this post - 'Must Override a Superclass Method' Errors after importing a project into Eclipse , I removed the J2SE-1.5 to resolve this issue.
You can not add third party libraries into class path of Java when developing a plug-in. It is the way to build standard Java application, but plug-in is a kind of OSGi bundle that has itself rule for class loading.
The correct way is adding third party libraries into the class path of your plug-in.
Add below declaration into MANIFEST.MF of your plug-in,
Bundle-ClassPath: lib/log4j-1.2.7.jar,
xml-apis.jar,
...
Check those links [1], [2] for understanding it.
This is what have a question on and see as potential solutions to potential problems.
Is this class comfing from a referenced jar or is it in the actual plugin edu.washington.cs.induction.OnePipeLineScript;
You seem to have a lot of soure folders and wondering if your build.properties file is showing any warnings and that you also have this defined for each of the source folders in your build.properties source.. = src/
Your external jar libraries appear to be in a folder that is of type source which is not correct. It should be a non-source folder (which you can tell a source folder by the package icon decorator) and you should make sure in your manifest editor that for runtime you have the lib checked so that it includes the jars in the build. To unmark it as a source folder select the drop down menu in your navigator view go to filters and uncheck .resources which will then show the .classpath file in that file you will see the folder to be kind="src" (i believe) remove that.
Somehow it also looks like you have linked source folders which is a practice I would not suggest and am not sure if that will cause problems when exporting the plugin. If you can avoid linked source folders that would be better.
Also it seems like you are confusing java build path configuration for plain java applications with plugins running in OSGI which is not configured through java build path but your manifest.editor So as a rule of thumb if its a plugin don't even bother trying to configure the java build path because OSGI is different, that could be causing issues as well
Select "Use class files complied in the workspace" in Options works for me.
Ctrl+Shift+G used to find references to the current selection within ALL projects in my Workspace.
Now is seems to only return references within the current Project.
Details:
I have 3 projects in the same database. 1 project is common code. The other 2 projects include the source folder of the common code on the build path. I prefer to link to common source instead of including the common code as a Project on the build path because then when I deploy by exporting WAR each project has its own self-contained version of the common code.
However Ctrl+Shift+G seems to work when I include the common code as a Project. So it looks like I need to do both. I just don't know why the searching results have changed. I did install JBoss Tools and as a result of Jboss needed to install a newer version of Indigo.
Similar issue, but no good answer.
EDIT:
Open two editors with a common class file, one from the linked source folder and one for the actual project folder. When the Ctrl+Shift+G is performed on the linked source, only references with in the project containing the linked folder are found. Ctrl+Shift+G from the actual common project finds references to all projects in the workspace, when those projects have the common project referenced on the build path.
The problem is when I am in a project and I control click a common code method I am taken to the linked source class file. So then when I do a Ctrl+Shift+G on that method, I miss all the other projects that reference this common method, because the editor contains the file from the linked source. This never used behaved this way and used to find all projects that referenced this method regardless of which file (linked or actual) was used.
I find the command..It is
Ctrl+ALT +G // search through out workspace
not
Ctrl +shift +G // searching within class/project
And one tip
Ctrl+shift+L to see all commands in Eclipse
This can occur if you are using Maven and your version numbers do not match. I had a dependent project with <version>1.0.0.RELEASE</version> that was being referenced in another project as <version>1.0.0-SNAPSHOT</version>. Fixing the mismatch so that versions were correct allowed CTRL-SHIFT-G to find the references in the workspace that it could not find before.