Skip to content

Conversation

Copy link

Copilot AI commented Aug 22, 2025

This PR fixes multiple build system issues that were preventing the SRPG engine project from compiling successfully.

Issues Fixed

1. Missing C Standard Library Include

The common.hpp file was using uint8_t without including <cstdint>, causing compilation failures:

// Before: compilation error
using byte = uint8_t;  // error: 'uint8_t' does not name a type

// After: fixed
#include <cstdint>
using byte = uint8_t;  // ✓ compiles successfully

2. SOL2 Template Compilation Errors

The embedded SOL2 v2.15.7 library had template ambiguity issues with modern C++ compilers. Fixed by making template calls explicit:

// Before: ambiguous template call
return stack::push<const wchar_t*>(L, str, str + sz);

// After: explicit template specialization
return pusher<const wchar_t*>::push(L, str, str + sz);

3. Incorrect Library Paths

All CMakeLists.txt files were looking for libraries in /bin/ directories instead of /lib/:

# Before: libraries not found
link_directories(${CMAKE_INSTALL_PREFIX}/srpg-engine/bin/)
link_directories(${CMAKE_INSTALL_PREFIX}/lua53/bin/)

# After: correct library paths  
link_directories(${CMAKE_INSTALL_PREFIX}/srpg-engine/lib/)
link_directories(${CMAKE_INSTALL_PREFIX}/lua53/lib/)

4. C++ Syntax Error

Fixed malformed copy constructor and assignment operator declarations in simple-position-system:

// Before: syntax error
TilePositionSystem (const &TilePositionSystem){}
TilePositionSystem& operator=(const &TilePositionSystem){}

// After: correct C++ syntax
TilePositionSystem(const TilePositionSystem&){}
TilePositionSystem& operator=(const TilePositionSystem&){ return *this; }

Components Now Building Successfully

  • lua53 - Lua 5.3 library foundation
  • srpg-engine - Main game engine library
  • simple-position-system - Position management system
  • action-system - Action handling system
  • s2dge-tilepos-adapter - Tile position adapter

Testing

All major components build cleanly with CMake and make:

cd srpg-engine && mkdir build && cd build && cmake .. && make  #
cd simple-position-system && mkdir build && cd build && cmake .. && make  #
cd action-system && mkdir build && cd build && cmake .. && make  #

The changes are minimal and surgical, preserving all existing functionality while making the project buildable again.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] fix this project Fix build system: resolve compilation errors and library path issues Aug 22, 2025
Copilot AI requested a review from Immac August 22, 2025 02:04
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