Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indexer and Conan CMake Projects #938

Open
joesulewski opened this issue Nov 13, 2024 · 1 comment
Open

Indexer and Conan CMake Projects #938

joesulewski opened this issue Nov 13, 2024 · 1 comment

Comments

@joesulewski
Copy link

Hello,

I have a project that I created with Conan.io for package management which generates a CMake project. I am able to successfully use CMake on Windows to generate a Visual Studio configuration to build and edit my code on Windows. On Linux I would like to use Eclipse CDT to build, debug and edit. I was able to generate Unix Make files that will clean and build the project without issue.

I created a new CMake (new or existing code) project and pointed the directory of the code to the root directory of my project which has the CMakeLists.txt file. I can compile, execute and debug within Eclipse. However, the indexer cannot find standard and external library classes and functions such as std::string, boost, oatpp, log4cxx and others. I have tried every tutorial I can find but it seems I can't get the indexer to find anything.

I could post some of the CMake but there is probably a log file somewhere that would be more helpful.

I'm using WSL Ubuntu 24.04 and the latest Eclipse and CMake plugin.

Eclipse 24.09 (4.33.0)
cmake4eclipse 5.0.0

Below is a screen capture that displays the issue, notice the includes has the right paths. What I find interesting is that I couldn't get the includes to show up until I started eclipse to get a screen capture for this note. Not sure why they showed up this time. But the problem still manifests. Notice how std::string test in main is showing an error and when I hover it says it can't be resolved.

image

Thanks,
Joe

I looked at the workspace/.metadata/.log and I see a lot but that is the only thing I can find

!SESSION 2024-11-12 18:44:23.840 -----------------------------------------------
eclipse.buildId=4.33.0.20240905-0613
java.version=21.0.4
java.vendor=Eclipse Adoptium
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
Framework arguments: -product org.eclipse.epp.package.cpp.product
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.cpp.product

!ENTRY org.eclipse.equinox.p2.repository 2 0 2024-11-12 18:45:27.943
!MESSAGE Server returned lastModified <= 0 for https://raw.githubusercontent.com/15knots/cmake4eclipse/master/releng/comp-update/compositeArtifacts.xml

!ENTRY org.eclipse.equinox.p2.repository 2 0 2024-11-12 18:45:30.940
!MESSAGE Server returned lastModified <= 0 for https://raw.githubusercontent.com/15knots/cmake4eclipse/master/releng/comp-update/compositeContent.xml

!ENTRY org.eclipse.ui 4 0 2024-11-12 18:45:31.572
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.IllegalArgumentException: Argument not valid
at org.eclipse.swt.SWT.error(SWT.java:4903)
at org.eclipse.swt.SWT.error(SWT.java:4837)
at org.eclipse.swt.SWT.error(SWT.java:4808)
at org.eclipse.swt.graphics.Image.init(Image.java:1189)
at org.eclipse.swt.graphics.Image.(Image.java:210)

@joesulewski
Copy link
Author

joesulewski commented Nov 13, 2024

Last night I was able to get the indexer working and I noticed that the include subfolder appeared in the project as per my screen shot above.

I came into work today, restarted Eclipse and there is no include subfolder and the indexer is of course failing.

image

Something is preventing the system from properly parsing the build information from CMake and not generating the include folder reliably. I have been tailing the .metadata/.log file and the only issue I saw was yesterday when the following errors appeared,

Any ideas would be very helpful.

Thanks,
Joe


The indexer did throw the following errors:
!ENTRY org.eclipse.cdt.core 4 0 2024-11-12 19:04:49.189
!MESSAGE Unexpected overload for binary operator 5: 'operator -'

!ENTRY org.eclipse.cdt.core 4 0 2024-11-12 19:05:16.465
!MESSAGE Unexpected overload for binary operator 28: 'operator =='

!ENTRY org.eclipse.cdt.core 4 0 2024-11-12 19:05:16.481
!MESSAGE Unexpected overload for binary operator 28: 'operator =='

!ENTRY org.eclipse.cdt.core 4 0 2024-11-12 19:05:16.532
!MESSAGE Unexpected overload for binary operator 28: 'operator =='

!ENTRY org.eclipse.cdt.core 4 0 2024-11-12 19:05:17.280
!MESSAGE Error: is not a member of has_value_types
!STACK 0
java.lang.IllegalArgumentException: is not a member of has_value_types
at org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper.invalidMember(ClassTypeHelper.java:1155)
at org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper.getVisibility(ClassTypeHelper.java:1081)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassTemplate.getVisibility(CPPClassTemplate.java:281)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.getVisibility(PDOMCPPLinkage.java:933)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.addChild(PDOMCPPLinkage.java:943)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.createBinding(PDOMCPPLinkage.java:895)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.addBinding(PDOMCPPLinkage.java:710)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.adaptOrAddBinding(PDOMCPPLinkage.java:1311)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.adaptOrAddParent(PDOMCPPLinkage.java:1306)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.addBinding(PDOMCPPLinkage.java:702)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.adaptOrAddBinding(PDOMCPPLinkage.java:1311)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.adaptOrAddParent(PDOMCPPLinkage.java:1306)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.addBinding(PDOMCPPLinkage.java:702)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.addBinding(PDOMCPPLinkage.java:630)
at org.eclipse.cdt.internal.core.pdom.dom.PDOMFile.createPDOMName(PDOMFile.java:524)
at org.eclipse.cdt.internal.core.pdom.dom.PDOMFile.addNames(PDOMFile.java:490)
at org.eclipse.cdt.internal.core.pdom.WritablePDOM.addFileContent(WritablePDOM.java:158)
at org.eclipse.cdt.internal.core.index.WritableCIndex.setFileContent(WritableCIndex.java:90)
at org.eclipse.cdt.internal.core.pdom.PDOMWriter.storeFileInIndex(PDOMWriter.java:692)
at org.eclipse.cdt.internal.core.pdom.PDOMWriter.storeSymbolsInIndex(PDOMWriter.java:330)
at org.eclipse.cdt.internal.core.pdom.PDOMWriter.addSymbols(PDOMWriter.java:287)
at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.writeToIndex(AbstractIndexerTask.java:1295)
at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.parseFile(AbstractIndexerTask.java:1107)
at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.parseLinkage(AbstractIndexerTask.java:910)
at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.runTask(AbstractIndexerTask.java:572)
at org.eclipse.cdt.internal.core.pdom.indexer.PDOMIndexerTask.run(PDOMIndexerTask.java:164)
at org.eclipse.cdt.internal.core.pdom.indexer.PDOMRebuildTask.run(PDOMRebuildTask.java:94)
at org.eclipse.cdt.internal.core.pdom.PDOMIndexerJob.run(PDOMIndexerJob.java:160)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

!ENTRY org.eclipse.cdt.core 4 0 2024-11-12 19:05:17.281
!MESSAGE Error: is not a member of has_error_types
!STACK 0
java.lang.IllegalArgumentException: is not a member of has_error_types
at org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper.invalidMember(ClassTypeHelper.java:1155)
at org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper.getVisibility(ClassTypeHelper.java:1081)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassTemplate.getVisibility(CPPClassTemplate.java:281)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.getVisibility(PDOMCPPLinkage.java:933)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.addChild(PDOMCPPLinkage.java:943)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.createBinding(PDOMCPPLinkage.java:895)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.addBinding(PDOMCPPLinkage.java:710)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.adaptOrAddBinding(PDOMCPPLinkage.java:1311)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.adaptOrAddParent(PDOMCPPLinkage.java:1306)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.addBinding(PDOMCPPLinkage.java:702)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.adaptOrAddBinding(PDOMCPPLinkage.java:1311)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.adaptOrAddParent(PDOMCPPLinkage.java:1306)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.addBinding(PDOMCPPLinkage.java:702)
at org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPLinkage.addBinding(PDOMCPPLinkage.java:630)
at org.eclipse.cdt.internal.core.pdom.dom.PDOMFile.createPDOMName(PDOMFile.java:524)
at org.eclipse.cdt.internal.core.pdom.dom.PDOMFile.addNames(PDOMFile.java:490)
at org.eclipse.cdt.internal.core.pdom.WritablePDOM.addFileContent(WritablePDOM.java:158)
at org.eclipse.cdt.internal.core.index.WritableCIndex.setFileContent(WritableCIndex.java:90)
at org.eclipse.cdt.internal.core.pdom.PDOMWriter.storeFileInIndex(PDOMWriter.java:692)
at org.eclipse.cdt.internal.core.pdom.PDOMWriter.storeSymbolsInIndex(PDOMWriter.java:330)
at org.eclipse.cdt.internal.core.pdom.PDOMWriter.addSymbols(PDOMWriter.java:287)
at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.writeToIndex(AbstractIndexerTask.java:1295)
at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.parseFile(AbstractIndexerTask.java:1107)
at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.parseLinkage(AbstractIndexerTask.java:910)
at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.runTask(AbstractIndexerTask.java:572)
at org.eclipse.cdt.internal.core.pdom.indexer.PDOMIndexerTask.run(PDOMIndexerTask.java:164)
at org.eclipse.cdt.internal.core.pdom.indexer.PDOMRebuildTask.run(PDOMRebuildTask.java:94)
at org.eclipse.cdt.internal.core.pdom.PDOMIndexerJob.run(PDOMIndexerJob.java:160)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant