Skip to content

Conversation

Copy link

Copilot AI commented Jul 26, 2025

Resolves a C++ compilation error in MOSES where the ostream_container utility function was not being found during builds, particularly when compiling feature selection algorithms.

Problem

The MOSES build was failing with a missing symbol error for ostream_container in moses/moses/comboreduct/table/table.h. While the header opencog/util/iostreamContainer.h was properly included, the function calls were not using explicit namespace qualification, causing symbol visibility issues during compilation.

The error occurred in two template visitor classes:

  • push_back_visitor::operator() (line 119)
  • insert_at_visitor::operator() (line 209)

Both classes are used for error handling in the table manipulation code and contain calls to ostream_container without the opencog:: namespace prefix.

Solution

Added explicit namespace qualification to the ostream_container function calls:

// Before
ostream_container(ss, seq);

// After  
opencog::ostream_container(ss, seq);

This ensures the compiler can properly resolve the function from the opencog namespace, even when called from within the nested opencog::combo namespace context.

Changes

  • moses/moses/comboreduct/table/table.h: Added opencog:: prefix to two ostream_container calls (lines 119 and 209)

This is a minimal, surgical fix that resolves the symbol visibility issue without affecting any other functionality. The change restores build integrity and enables further development of cognitive diagnostics in MOSES.

Testing

Verified the fix through isolated compilation tests that confirm:

  • The namespace-qualified function calls compile successfully
  • The ostream_container function works correctly with the explicit qualification
  • No other header files in the MOSES codebase have the same critical issue

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

This pull request was created as a result of the following prompt from Copilot chat.

Problem Identification

MOSES build fails due to missing symbol 'ostream_container' in 'moses/moses/comboreduct/table/table.h'. The header 'opencog/util/iostreamContainer.h' is not included, causing the utility function to be out of scope and breaking compilation during feature selection algorithm builds.

Solution

  1. Add the following include directive at the top of 'moses/moses/comboreduct/table/table.h':

    #include <opencog/util/iostreamContainer.h>
  2. If the error persists, ensure all source files (.cc) using 'ostream_container' directly or indirectly via table.h also include this header.

  3. Where the function is called, use the fully qualified name if necessary:

    opencog::ostream_container(ss, seq);
  4. Rebuild and verify that the compilation error is resolved.

Actionable Steps

  • Edit the file 'moses/moses/comboreduct/table/table.h' to add the missing include.
  • Confirm symbol visibility in all relevant translation units.
  • Rebuild the project and rerun the CI workflow (CI Org v8 @ 0f1491ad).

Justification

This resolves a C++ symbol visibility error due to missing header inclusion, restoring build integrity and enabling further cognitive diagnostics and development in MOSES.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

…r calls

Co-authored-by: drzo <15202748+drzo@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix build failure: Add missing include for ostream_container in table.h Fix MOSES build failure due to missing ostream_container symbol visibility Jul 26, 2025
Copilot finished work on behalf of drzo July 26, 2025 23:00
Copilot AI requested a review from drzo July 26, 2025 23:00
Copy link

@drzo drzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome

@drzo drzo marked this pull request as ready for review July 26, 2025 23:01
@drzo drzo merged commit a1761ad into main Jul 26, 2025
0 of 5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants