SoftwareNetwork / sw

Software Manager. Build System, Build System Generator and Package Manager. C/C++ and other languages. Tools and libraries for Software Management.
https://software-network.org
Other
118 stars 24 forks source link

Building sw on macOS - error: incomplete type; error: cannot initialize object parameter #65

Closed SamuelMarks closed 2 years ago

SamuelMarks commented 3 years ago

Describe the bug Last output of sw build -static after running on 7ce601e30bffd31598b746831a439b181eaa6b04:

[830/833] generate: ".sw/storage/pkg/8e/71/b3e2/obj/bld/591737/bd/options_cl.generated.cpp", ".sw/storage/pkg/8e/71/b3e2/obj/bld/591737/bd/options_cl.generated.h"
[831/833] [config pch]
Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:764, function execute1: When executing: [config pch]
In file included from <built-in>:433:
<command line>:151:9: warning: 'SW_BUILDER_API' macro redefined [-Wmacro-redefined]
#define SW_BUILDER_API 
        ^
<command line>:150:9: note: previous definition is here
#define SW_BUILDER_API SW_EXPORT
        ^
<command line>:153:9: warning: 'SW_CORE_API' macro redefined [-Wmacro-redefined]
#define SW_CORE_API 
        ^
<command line>:152:9: note: previous definition is here
#define SW_CORE_API SW_EXPORT
        ^
<command line>:155:9: warning: 'SW_DRIVER_CPP_API' macro redefined [-Wmacro-redefined]
#define SW_DRIVER_CPP_API 
        ^
<command line>:154:9: note: previous definition is here
#define SW_DRIVER_CPP_API SW_EXPORT
        ^
<command line>:160:9: warning: 'SW_MANAGER_API' macro redefined [-Wmacro-redefined]
#define SW_MANAGER_API 
        ^
<command line>:159:9: note: previous definition is here
#define SW_MANAGER_API SW_EXPORT
        ^
<command line>:163:9: warning: 'SW_SUPPORT_API' macro redefined [-Wmacro-redefined]
#define SW_SUPPORT_API 
        ^
<command line>:162:9: note: previous definition is here
#define SW_SUPPORT_API SW_EXPORT
        ^
In file included from .sw/storage/tmp/pch/28/sw.1.a2a6fd.c270ea.h:1:
In file included from .sw/storage/pkg/8e/71/b3e2/src/sdir/src/sw/driver/sw.h:7:
In file included from .sw/storage/pkg/8e/71/b3e2/src/sdir/src/sw/driver/build.h:6:
In file included from .sw/storage/pkg/8e/71/b3e2/src/sdir/src/sw/driver/checks_storage.h:6:
In file included from .sw/storage/pkg/8e/71/b3e2/src/sdir/src/sw/driver/checks.h:6:
In file included from .sw/storage/pkg/8e/71/b3e2/src/sdir/src/sw/driver/options.h:6:
In file included from .sw/storage/pkg/8e/71/b3e2/src/sdir/src/sw/driver/dependency.h:9:
In file included from .sw/storage/pkg/9d/ae/0e34/src/sdir/src/sw/core/target.h:8:
.sw/storage/pkg/0b/f8/87ab/src/sdir/src/sw/builder/command.h:167:10: error: incomplete type 'std::__1::thread' named in nested name specifier
    std::thread::id tid;
    ~~~~~^~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__threading_support:404:24: note: forward declaration of 'std::__1::thread'
class _LIBCPP_TYPE_VIS thread;
                       ^
In file included from .sw/storage/tmp/pch/28/sw.1.a2a6fd.c270ea.h:1:
In file included from .sw/storage/pkg/8e/71/b3e2/src/sdir/src/sw/driver/sw.h:7:
In file included from .sw/storage/pkg/8e/71/b3e2/src/sdir/src/sw/driver/build.h:6:
In file included from .sw/storage/pkg/8e/71/b3e2/src/sdir/src/sw/driver/checks_storage.h:6:
In file included from .sw/storage/pkg/8e/71/b3e2/src/sdir/src/sw/driver/checks.h:6:
In file included from .sw/storage/pkg/8e/71/b3e2/src/sdir/src/sw/driver/options.h:6:
In file included from .sw/storage/pkg/8e/71/b3e2/src/sdir/src/sw/driver/dependency.h:9:
In file included from .sw/storage/pkg/9d/ae/0e34/src/sdir/src/sw/core/target.h:8:
.sw/storage/pkg/0b/f8/87ab/src/sdir/src/sw/builder/command.h:273:38: error: cannot initialize object parameter of type 'const sw::builder::Command' with an expression of type 'sw::builder::CommandSequence'
        auto c = std::make_shared<C>(getContext(), std::forward<Args>(args)...);
                                     ^~~~~~~~~~
In file included from .sw/storage/tmp/pch/28/sw.1.a2a6fd.c270ea.h:1:
In file included from .sw/storage/pkg/8e/71/b3e2/src/sdir/src/sw/driver/sw.h:15:
.sw/storage/pkg/9d/ae/0e34/src/sdir/src/sw/core/sw_context.h:70:20: error: incomplete type 'std::__1::thread' named in nested name specifier
    void stop(std::thread::id);
              ~~~~~^~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__threading_support:404:24: note: forward declaration of 'std::__1::thread'
class _LIBCPP_TYPE_VIS thread;
                       ^
In file included from .sw/storage/tmp/pch/28/sw.1.a2a6fd.c270ea.h:1:
In file included from .sw/storage/pkg/8e/71/b3e2/src/sdir/src/sw/driver/sw.h:15:
.sw/storage/pkg/9d/ae/0e34/src/sdir/src/sw/core/sw_context.h:92:19: error: incomplete type 'std::__1::thread' named in nested name specifier
    std::map<std::thread::id, SwBuild *> active_operations;
             ~~~~~^~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__threading_support:404:24: note: forward declaration of 'std::__1::thread'
class _LIBCPP_TYPE_VIS thread;
                       ^
5 warnings and 4 errors generated.
command failed: exit code = 1
Total errors: 1

Expected behavior It to build without error (warnings are ok I guess…)

To Reproduce Run on macOS

Information:

egorpugin commented 3 years ago

I've pushed a fix, but there are more issues probably. I'm crosscompiling to macos from windows, so some issues may be hidden for me.

egorpugin commented 3 years ago

It seems github CI uses macos-10.15. See green status https://github.com/SoftwareNetwork/sw/runs/2277395294

egorpugin commented 3 years ago

Added 11.0 CI https://github.com/SoftwareNetwork/sw/runs/2277798754

SamuelMarks commented 3 years ago

Interesting. I suppose Travis CI could be used? - I can port your GitHub Actions for you on the weekend if you like?

EDIT: Great to see GitHub Actions does have a config option for that :)

egorpugin commented 3 years ago

No, I removed travis and appveyor some time ago. Travis-CI is not in a very good shape now.

egorpugin commented 3 years ago

Try now with -sd flag. It should update packages db.

SamuelMarks commented 3 years ago

CMakeLists.txt

cmake_minimum_required(VERSION 3.2)
project(pp VERSION 0.0.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 14)

file(DOWNLOAD https://raw.githubusercontent.com/ocornut/imgui/6a161b8/examples/example_allegro5/main.cpp src/main.cpp
     EXPECTED_HASH SHA256=1138d4b862d4349beeaea984005b958c185c44ef4edba6a96db7d8c6bde33cb4)

set(src ${CMAKE_CURRENT_BINARY_DIR}/src/main.cpp)

find_package(SW REQUIRED)
sw_add_package(org.sw.demo.ocornut.imgui)
sw_execute()

add_executable(${PROJECT_NAME} ${src})
target_link_libraries(${PROJECT_NAME} PRIVATE org.sw.demo.ocornut.imgui)

sh

$ sudo sw --self-upgrade -sd
$ sw --self-upgrade -sd
$ rm -rf build && mkdir $_ && cd $_
$ cmake ..
/tmp/imgui3/build $ cmake ..
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found SW: /usr/local/bin/sw  
-- sw: processing dependencies
Downloading database from origin remote
Downloading: [org.sw.demo.google.grpc.proto-1.37.0]/[Source Archive]
Downloading: [org.sw.demo.google.grpc.core.tsi-1.37.0]/[Source Archive]
Downloading: [org.sw.demo.google.grpc.core.plugin_registry-1.37.0]/[Source Archive]
Downloading: [org.sw.sw.client.builder-0.4.2]/[Source Archive]
Downloading: [org.sw.demo.google.grpc.cpp-1.37.0]/[Source Archive]
Downloading: [org.sw.demo.google.grpc.core.lib-1.37.0]/[Source Archive]
Downloading: [org.sw.sw.client.protos-0.4.2]/[Source Archive]
Downloading: [org.sw.sw.client.manager-0.4.2]/[Source Archive]
Downloading: [org.sw.sw.client.core-0.4.2]/[Source Archive]
Downloading: [org.sw.demo.google.abseil-2021.3.24.0]/[Source Archive]
Unpacking  : [org.sw.demo.google.grpc.core.plugin_registry-1.37.0]/[Source Archive]
Downloading: [org.sw.sw.client.driver.cpp-0.4.2]/[Source Archive]
Unpacking  : [org.sw.sw.client.builder-0.4.2]/[Source Archive]
Downloading: [org.sw.demo.google.grpc.plugin_support-1.37.0]/[Source Archive]
Unpacking  : [org.sw.sw.client.protos-0.4.2]/[Source Archive]
Unpacking  : [org.sw.demo.google.grpc.cpp-1.37.0]/[Source Archive]
Downloading: [org.sw.demo.google.grpc.cpp.plugin-1.37.0]/[Source Archive]
Unpacking  : [org.sw.sw.client.core-0.4.2]/[Source Archive]
Unpacking  : [org.sw.demo.google.grpc.core.tsi-1.37.0]/[Source Archive]
Downloading: [org.sw.demo.google.grpc.third_party.address_sorting-1.37.0]/[Source Archive]
Downloading: [org.sw.sw.client.driver.cpp.self_builder-0.4.2]/[Source Archive]
Unpacking  : [org.sw.sw.client.manager-0.4.2]/[Source Archive]
Downloading: [org.sw.sw.client.driver.cpp.cl_generator-0.4.2]/[Source Archive]
Downloading: [org.sw.sw.client.support-0.4.2]/[Source Archive]
Unpacking  : [org.sw.demo.google.grpc.core.lib-1.37.0]/[Source Archive]
Downloading: [org.sw.demo.google.grpc.core.ext-1.37.0]/[Source Archive]
Unpacking  : [org.sw.demo.google.grpc.plugin_support-1.37.0]/[Source Archive]
Unpacking  : [org.sw.sw.client.driver.cpp.cl_generator-0.4.2]/[Source Archive]
Unpacking  : [org.sw.sw.client.support-0.4.2]/[Source Archive]
Unpacking  : [org.sw.sw.client.driver.cpp-0.4.2]/[Source Archive]
Unpacking  : [org.sw.demo.google.abseil-2021.3.24.0]/[Source Archive]
Unpacking  : [org.sw.demo.google.grpc.third_party.address_sorting-1.37.0]/[Source Archive]
Unpacking  : [org.sw.sw.client.driver.cpp.self_builder-0.4.2]/[Source Archive]
Unpacking  : [org.sw.demo.google.grpc.core.ext-1.37.0]/[Source Archive]
Unpacking  : [org.sw.demo.google.grpc.proto-1.37.0]/[Source Archive]
Unpacking  : [org.sw.demo.google.grpc.cpp.plugin-1.37.0]/[Source Archive]
[22/150] [org.sw.sw.client.driver.cpp.cl_generator-0.4.2]/src/sw/driver/tools/cl_generator.cpp
[146/150] [org.sw.sw.client.driver.cpp.cl_generator-0.4.2]
[147/150] generate: ".sw/storage/pkg/8e/71/b3e2/obj/bld/591737/bd/options_cl.generated.cpp", ".sw/storage/pkg/8e/71/b3e2/obj/bld/591737/bd/options_cl.generated.h"
[148/150] [config pch]
[149/150] .sw/storage/pkg/8e/51/3b0b/src/sdir/sw.cpp
[150/150] .sw/storage/tmp/cfg/591737/libloc.sw.self.191eb4-0.0.28.dylib
Downloading: [org.sw.demo.stb.all-master]/[Source Archive]
Unpacking  : [org.sw.demo.stb.all-master]/[Source Archive]
[140/150] .sw/storage/pkg/eb/20/82cc/src/sdir/sw.cpp
[150/150] .sw/storage/tmp/cfg/591737/libloc.sw.self.d06fce-0.0.28.dylib
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/imgui3/build
/tmp/imgui3/build $ cmake --build .
[ 33%] sw: building dependencies
[ 66%] Building CXX object CMakeFiles/pp.dir/src/main.cpp.o
/tmp/imgui3/build/src/main.cpp:6:10: fatal error: 'allegro5/allegro.h' file not found
#include <allegro5/allegro.h>
         ^~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/pp.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/pp.dir/all] Error 2
make: *** [all] Error 2
egorpugin commented 3 years ago

You did not provide allegro5 dependency.

SamuelMarks commented 3 years ago

Okay so I need to explicitly? - Now getting a different error:

CMakeLists.txt

cmake_minimum_required(VERSION 3.2)
project(pp VERSION 0.0.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 14)

file(DOWNLOAD https://raw.githubusercontent.com/ocornut/imgui/6a161b8/examples/example_allegro5/main.cpp src/main.cpp
     EXPECTED_HASH SHA256=1138d4b862d4349beeaea984005b958c185c44ef4edba6a96db7d8c6bde33cb4)

set(src ${CMAKE_CURRENT_BINARY_DIR}/src/main.cpp)

find_package(SW REQUIRED)
sw_add_package(org.sw.demo.ocornut.imgui)
sw_add_package(org.sw.demo.liballeg.allegro5)
sw_execute()

add_executable(${PROJECT_NAME} ${src})
target_link_libraries(${PROJECT_NAME} PRIVATE org.sw.demo.ocornut.imgui org.sw.demo.liballeg.allegro5)

sh

$ rm -rf build && mkdir $_ && cd $_
$ cmake ..
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found SW: /usr/local/bin/sw  
-- sw: processing dependencies
Downloading database from origin remote
Downloading: [org.sw.demo.liballeg.allegro5-5.2.7.0]/[Source Archive]
Unpacking  : [org.sw.demo.liballeg.allegro5-5.2.7.0]/[Source Archive]
Downloading: [org.sw.demo.unicode.icu.stub.genccode-69.1.0]/[Source Archive]
Downloading: [org.sw.demo.unicode.icu.stub.common-69.1.0]/[Source Archive]
Downloading: [org.sw.demo.unicode.icu.stub.toolutil-69.1.0]/[Source Archive]
Downloading: [org.sw.demo.unicode.icu.data-69.1.0]/[Source Archive]
Downloading: [org.sw.demo.unicode.icu.stub.data-69.1.0]/[Source Archive]
Downloading: [org.sw.demo.unicode.icu.common-69.1.0]/[Source Archive]
Downloading: [org.sw.demo.unicode.icu.i18n-69.1.0]/[Source Archive]
Downloading: [org.sw.demo.unicode.icu.stub.i18n-69.1.0]/[Source Archive]
Unpacking  : [org.sw.demo.unicode.icu.stub.data-69.1.0]/[Source Archive]
Unpacking  : [org.sw.demo.unicode.icu.stub.genccode-69.1.0]/[Source Archive]
Unpacking  : [org.sw.demo.unicode.icu.stub.toolutil-69.1.0]/[Source Archive]
Unpacking  : [org.sw.demo.unicode.icu.common-69.1.0]/[Source Archive]
Unpacking  : [org.sw.demo.unicode.icu.stub.common-69.1.0]/[Source Archive]
Unpacking  : [org.sw.demo.unicode.icu.i18n-69.1.0]/[Source Archive]
Unpacking  : [org.sw.demo.unicode.icu.stub.i18n-69.1.0]/[Source Archive]
Unpacking  : [org.sw.demo.unicode.icu.data-69.1.0]/[Source Archive]
[143/152] .sw/storage/pkg/44/82/9c04/src/sdir/sw.cpp
[152/152] .sw/storage/tmp/cfg/591737/libloc.sw.self.1c2241-0.0.28.dylib
Performing 13 check(s): org.sw.demo.liballeg.allegro5-5.2.7.0 (x), config 808281
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/imgui3/build
$ cmake --build .
[ 33%] sw: building dependencies
[1/76] [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/mousenu.c
[2/76] [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/cpu.c
[3/76] [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/bitmap_type.c
[4/76] [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/timernu.c
[5/76] [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/threads.c
[6/76] [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/macosx/hidjoy.m
[7/76] [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/bitmap_pixel.c
[8/76] [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/config.c
[9/76] [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/macosx/system.m
[11/76] [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/unix/uxthread.c
Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:764, function execute1: When executing: [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/cpu.c
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/cpu.c:18:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/allegro.h:26:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/base.h:50:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/alconfig.h:53:5: error: platform not supported
   #error platform not supported
    ^
1 error generated.
command failed: exit code = 1
Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:764, function execute1: When executing: [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/mousenu.c
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/mousenu.c:24:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/allegro.h:26:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/base.h:50:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/alconfig.h:53:5: error: platform not supported
   #error platform not supported
    ^
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/mousenu.c:26:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_bitmap.h:9:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_display.h:8:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_events.h:4:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:4:10: error: expected "FILENAME" or <FILENAME>
#include ALLEGRO_INTERNAL_THREAD_HEADER
         ^
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/mousenu.c:26:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_bitmap.h:9:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_display.h:8:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_events.h:16:14: error: field has incomplete type '_AL_MUTEX' (aka 'struct _AL_MUTEX')
   _AL_MUTEX mutex;
             ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:12:16: note: forward declaration of 'struct _AL_MUTEX'
typedef struct _AL_MUTEX _AL_MUTEX;
               ^
3 errors generated.
command failed: exit code = 1
Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:764, function execute1: When executing: [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/macosx/system.m
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/system.m:19:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/allegro.h:26:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/base.h:50:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/alconfig.h:53:5: error: platform not supported
   #error platform not supported
    ^
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/system.m:20:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:23:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_system.h:5:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_display.h:8:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_events.h:4:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:4:10: error: expected "FILENAME" or <FILENAME>
#include ALLEGRO_INTERNAL_THREAD_HEADER
         ^
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/system.m:20:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:23:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_system.h:5:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_display.h:8:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_events.h:16:14: error: field has incomplete type '_AL_MUTEX' (aka 'struct _AL_MUTEX')
   _AL_MUTEX mutex;
             ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:12:16: note: forward declaration of 'struct _AL_MUTEX'
typedef struct _AL_MUTEX _AL_MUTEX;
               ^
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/system.m:20:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:49:2: error: Cannot target OS X versions before 10.4
#error Cannot target OS X versions before 10.4
 ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:121:44: error: unknown type name 'NSEvent'
void _al_osx_keyboard_handler(int pressed, NSEvent *event, ALLEGRO_DISPLAY*);
                                           ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:125:35: error: unknown type name 'NSEvent'
void _al_osx_mouse_generate_event(NSEvent*, ALLEGRO_DISPLAY*);
                                  ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:126:28: error: unknown type name 'NSEvent'
void _al_osx_mouse_handler(NSEvent*);
                           ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:142:34: error: a parameter list without types is only allowed in a function definition
void _al_osx_mouse_was_installed(BOOL);
                                 ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:147:37: error: a parameter list without types is only allowed in a function definition
void _al_osx_keyboard_was_installed(BOOL);
                                    ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:151:1: error: unknown type name 'NSView'
NSView* _al_osx_view_from_display(ALLEGRO_DISPLAY*);
^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:153:1: error: unknown type name 'NSImage'
NSImage* NSImageFromAllegroBitmap(ALLEGRO_BITMAP* bmp);
^
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/system.m:25:5: error: something is wrong with the makefile
   #error something is wrong with the makefile
    ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/system.m:56:1: error: unknown type name 'NSBundle'
NSBundle *_al_osx_bundle = NULL;
^
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/system.m:67:35: error: use of undeclared identifier 'kCurrentProcess'
   ProcessSerialNumber psn = { 0, kCurrentProcess };
                                  ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/system.m:68:4: error: implicit declaration of function 'TransformProcessType' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   TransformProcessType(&psn, kProcessTransformToForegroundApplication);
   ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/system.m:68:31: error: use of undeclared identifier 'kProcessTransformToForegroundApplication'
   TransformProcessType(&psn, kProcessTransformToForegroundApplication);
                              ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/system.m:69:6: error: use of undeclared identifier 'NSApplication'
   [[NSApplication sharedApplication] performSelectorOnMainThread: @selector(activateIgnoringOtherApps:)
     ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/system.m:158:4: error: use of undeclared identifier 'CGDirectDisplayID'
   CGDirectDisplayID display;
   ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/system.m:166:4: error: use of undeclared identifier 'display'
   display = CGMainDisplayID();
   ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
command failed: exit code = 1
Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:764, function execute1: When executing: [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/bitmap_pixel.c
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/bitmap_pixel.c:17:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/allegro.h:26:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/base.h:50:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/alconfig.h:53:5: error: platform not supported
   #error platform not supported
    ^
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/bitmap_pixel.c:18:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_bitmap.h:9:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_display.h:8:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_events.h:4:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:4:10: error: expected "FILENAME" or <FILENAME>
#include ALLEGRO_INTERNAL_THREAD_HEADER
         ^
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/bitmap_pixel.c:18:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_bitmap.h:9:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_display.h:8:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_events.h:16:14: error: field has incomplete type '_AL_MUTEX' (aka 'struct _AL_MUTEX')
   _AL_MUTEX mutex;
             ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:12:16: note: forward declaration of 'struct _AL_MUTEX'
typedef struct _AL_MUTEX _AL_MUTEX;
               ^
3 errors generated.
command failed: exit code = 1
Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:764, function execute1: When executing: [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/macosx/hidjoy.m
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/hidjoy.m:19:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/allegro.h:26:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/base.h:50:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/alconfig.h:53:5: error: platform not supported
   #error platform not supported
    ^
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/hidjoy.m:20:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:23:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_system.h:5:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_display.h:8:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_events.h:4:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:4:10: error: expected "FILENAME" or <FILENAME>
#include ALLEGRO_INTERNAL_THREAD_HEADER
         ^
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/hidjoy.m:20:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:23:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_system.h:5:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_display.h:8:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_events.h:16:14: error: field has incomplete type '_AL_MUTEX' (aka 'struct _AL_MUTEX')
   _AL_MUTEX mutex;
             ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:12:16: note: forward declaration of 'struct _AL_MUTEX'
typedef struct _AL_MUTEX _AL_MUTEX;
               ^
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/hidjoy.m:20:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:49:2: error: Cannot target OS X versions before 10.4
#error Cannot target OS X versions before 10.4
 ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:121:44: error: unknown type name 'NSEvent'
void _al_osx_keyboard_handler(int pressed, NSEvent *event, ALLEGRO_DISPLAY*);
                                           ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:125:35: error: unknown type name 'NSEvent'
void _al_osx_mouse_generate_event(NSEvent*, ALLEGRO_DISPLAY*);
                                  ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:126:28: error: unknown type name 'NSEvent'
void _al_osx_mouse_handler(NSEvent*);
                           ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:142:34: error: a parameter list without types is only allowed in a function definition
void _al_osx_mouse_was_installed(BOOL);
                                 ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:147:37: error: a parameter list without types is only allowed in a function definition
void _al_osx_keyboard_was_installed(BOOL);
                                    ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:151:1: error: unknown type name 'NSView'
NSView* _al_osx_view_from_display(ALLEGRO_DISPLAY*);
^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/platform/aintosx.h:153:1: error: unknown type name 'NSImage'
NSImage* NSImageFromAllegroBitmap(ALLEGRO_BITMAP* bmp);
^
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/hidjoy.m:26:2: error: something is wrong with the makefile
#error something is wrong with the makefile
 ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/hidjoy.m:68:8: error: unknown type name 'IOHIDManagerRef'; did you mean 'IOHIDValueRef'?
static IOHIDManagerRef hidManagerRef;
       ^~~~~~~~~~~~~~~
       IOHIDValueRef
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hid/IOHIDBase.h:49:51: note: 'IOHIDValueRef' declared here
typedef struct CF_BRIDGED_TYPE(id) __IOHIDValue * IOHIDValueRef;
                                                  ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/hidjoy.m:148:23: error: implicit declaration of function 'IOHIDElementGetName' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   CFStringRef name = IOHIDElementGetName(elem);
                      ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/hidjoy.m:148:16: warning: incompatible integer to pointer conversion initializing 'CFStringRef' (aka 'const struct __CFString *') with an expression of type 'int' [-Wint-conversion]
   CFStringRef name = IOHIDElementGetName(elem);
               ^      ~~~~~~~~~~~~~~~~~~~~~~~~~
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/hidjoy.m:200:19: error: implicit declaration of function 'IOHIDElementGetUsage' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      int usage = IOHIDElementGetUsage(elem);
                  ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/hidjoy.m:201:11: error: implicit declaration of function 'IOHIDElementGetType' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      if (IOHIDElementGetType(elem) == kIOHIDElementTypeInput_Button) {
          ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/hidjoy.m:201:11: note: did you mean 'IOHIDElementGetUsage'?
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/hidjoy.m:200:19: note: 'IOHIDElementGetUsage' declared here
      int usage = IOHIDElementGetUsage(elem);
                  ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/hidjoy.m:215:21: error: implicit declaration of function 'IOHIDElementGetLogicalMin' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
         long min = IOHIDElementGetLogicalMin(elem);
                    ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/hidjoy.m:216:21: error: implicit declaration of function 'IOHIDElementGetLogicalMax' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
         long max = IOHIDElementGetLogicalMax(elem);
                    ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/hidjoy.m:216:21: note: did you mean 'IOHIDElementGetLogicalMin'?
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/hidjoy.m:215:21: note: 'IOHIDElementGetLogicalMin' declared here
         long min = IOHIDElementGetLogicalMin(elem);
                    ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/macosx/hidjoy.m:221:18: error: use of undeclared identifier 'kHIDUsage_GD_X'
            case kHIDUsage_GD_X:
                 ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
command failed: exit code = 1
Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:764, function execute1: When executing: [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/bitmap_type.c
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/bitmap_type.c:17:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/allegro.h:26:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/base.h:50:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/alconfig.h:53:5: error: platform not supported
   #error platform not supported
    ^
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/bitmap_type.c:19:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_bitmap.h:9:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_display.h:8:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_events.h:4:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:4:10: error: expected "FILENAME" or <FILENAME>
#include ALLEGRO_INTERNAL_THREAD_HEADER
         ^
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/bitmap_type.c:19:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_bitmap.h:9:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_display.h:8:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_events.h:16:14: error: field has incomplete type '_AL_MUTEX' (aka 'struct _AL_MUTEX')
   _AL_MUTEX mutex;
             ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:12:16: note: forward declaration of 'struct _AL_MUTEX'
typedef struct _AL_MUTEX _AL_MUTEX;
               ^
3 errors generated.
command failed: exit code = 1
Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:764, function execute1: When executing: [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/timernu.c
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/timernu.c:21:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/allegro.h:26:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/base.h:50:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/alconfig.h:53:5: error: platform not supported
   #error platform not supported
    ^
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/timernu.c:24:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_events.h:4:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:4:10: error: expected "FILENAME" or <FILENAME>
#include ALLEGRO_INTERNAL_THREAD_HEADER
         ^
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/timernu.c:24:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_events.h:16:14: error: field has incomplete type '_AL_MUTEX' (aka 'struct _AL_MUTEX')
   _AL_MUTEX mutex;
             ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:12:16: note: forward declaration of 'struct _AL_MUTEX'
typedef struct _AL_MUTEX _AL_MUTEX;
               ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/timernu.c:102:12: error: implicit declaration of function '_al_get_thread_should_stop' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   while (!_al_get_thread_should_stop(self)) {
           ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/timernu.c:102:12: note: did you mean 'al_get_thread_should_stop'?
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/threads.h:47:15: note: 'al_get_thread_should_stop' declared here
AL_FUNC(bool, al_get_thread_should_stop, (ALLEGRO_THREAD *outer));
              ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/alconfig.h:177:57: note: expanded from macro 'AL_FUNC'
   #define AL_FUNC(type, name, args)               type name args
                                                        ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/timernu.c:213:35: error: invalid application of 'sizeof' to an incomplete type '_AL_THREAD' (aka 'struct _AL_THREAD')
         timer_thread = al_malloc(sizeof(_AL_THREAD));
                                  ^     ~~~~~~~~~~~~
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/memory.h:43:29: note: expanded from macro 'al_malloc'
   (al_malloc_with_context((n), __LINE__, __FILE__, __func__))
                            ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:11:16: note: forward declaration of 'struct _AL_THREAD'
typedef struct _AL_THREAD _AL_THREAD;
               ^
5 errors generated.
command failed: exit code = 1
Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:764, function execute1: When executing: [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/threads.c
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:19:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/allegro.h:26:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/base.h:50:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/alconfig.h:53:5: error: platform not supported
   #error platform not supported
    ^
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:21:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:4:10: error: expected "FILENAME" or <FILENAME>
#include ALLEGRO_INTERNAL_THREAD_HEADER
         ^
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:22:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_system.h:5:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_display.h:8:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_events.h:16:14: error: field has incomplete type '_AL_MUTEX' (aka 'struct _AL_MUTEX')
   _AL_MUTEX mutex;
             ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:12:16: note: forward declaration of 'struct _AL_MUTEX'
typedef struct _AL_MUTEX _AL_MUTEX;
               ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:38:15: error: field has incomplete type '_AL_THREAD' (aka 'struct _AL_THREAD')
   _AL_THREAD thread;
              ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:11:16: note: forward declaration of 'struct _AL_THREAD'
typedef struct _AL_THREAD _AL_THREAD;
               ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:39:14: error: field has incomplete type '_AL_MUTEX' (aka 'struct _AL_MUTEX')
   _AL_MUTEX mutex;
             ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:12:16: note: forward declaration of 'struct _AL_MUTEX'
typedef struct _AL_MUTEX _AL_MUTEX;
               ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:40:13: error: field has incomplete type '_AL_COND' (aka 'struct _AL_COND')
   _AL_COND cond;
            ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:13:16: note: forward declaration of 'struct _AL_COND'
typedef struct _AL_COND _AL_COND;
               ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:49:14: error: field has incomplete type '_AL_MUTEX' (aka 'struct _AL_MUTEX')
   _AL_MUTEX mutex;
             ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:12:16: note: forward declaration of 'struct _AL_MUTEX'
typedef struct _AL_MUTEX _AL_MUTEX;
               ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:54:13: error: field has incomplete type '_AL_COND' (aka 'struct _AL_COND')
   _AL_COND cond;
            ^
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:13:16: note: forward declaration of 'struct _AL_COND'
typedef struct _AL_COND _AL_COND;
               ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:71:4: error: implicit declaration of function '_al_mutex_lock' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   _al_mutex_lock(&outer->mutex);
   ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:71:4: note: did you mean '_al_mutex_init'?
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:24:6: note: '_al_mutex_init' declared here
void _al_mutex_init(_AL_MUTEX*);
     ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:73:7: error: implicit declaration of function '_al_cond_wait' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      _al_cond_wait(&outer->cond, &outer->mutex);
      ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:75:4: error: implicit declaration of function '_al_mutex_unlock' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   _al_mutex_unlock(&outer->mutex);
   ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:75:4: note: did you mean '_al_mutex_lock'?
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:71:4: note: '_al_mutex_lock' declared here
   _al_mutex_lock(&outer->mutex);
   ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:107:4: error: implicit declaration of function '_AL_MARK_MUTEX_UNINITED' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   _AL_MARK_MUTEX_UNINITED(outer->mutex); /* required */
   ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:121:4: error: implicit declaration of function '_al_cond_init' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   _al_cond_init(&outer->cond);
   ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:137:4: error: implicit declaration of function '_al_cond_init' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   _al_cond_init(&outer->cond);
   ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:166:10: error: implicit declaration of function '_al_mutex_lock' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
         _al_mutex_lock(&thread->mutex);
         ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:168:10: error: implicit declaration of function '_al_cond_broadcast' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
         _al_cond_broadcast(&thread->cond);
         ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:168:10: note: did you mean '_al_cond_timedwait'?
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:42:5: note: '_al_cond_timedwait' declared here
int _al_cond_timedwait(_AL_COND*, _AL_MUTEX*, const ALLEGRO_TIMEOUT *timeout);
    ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:169:10: error: implicit declaration of function '_al_mutex_unlock' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
         _al_mutex_unlock(&thread->mutex);
         ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:210:10: error: implicit declaration of function '_al_mutex_lock' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
         _al_mutex_lock(&thread->mutex);
         ^
.sw/storage/pkg/44/82/9c04/src/sdir/src/threads.c:212:10: error: implicit declaration of function '_al_cond_broadcast' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
         _al_cond_broadcast(&thread->cond);
         ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
command failed: exit code = 1
Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:764, function execute1: When executing: [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/config.c
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/config.c:22:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/allegro.h:26:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/base.h:50:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/alconfig.h:53:5: error: platform not supported
   #error platform not supported
    ^
1 error generated.
command failed: exit code = 1
Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:764, function execute1: When executing: [org.sw.demo.liballeg.allegro5-5.2.7.0]/src/unix/uxthread.c
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/unix/uxthread.c:24:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/allegro.h:26:
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/base.h:50:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/alconfig.h:53:5: error: platform not supported
   #error platform not supported
    ^
In file included from .sw/storage/pkg/44/82/9c04/src/sdir/src/unix/uxthread.c:26:
.sw/storage/pkg/44/82/9c04/src/sdir/include/allegro5/internal/aintern_thread.h:4:10: error: expected "FILENAME" or <FILENAME>
#include ALLEGRO_INTERNAL_THREAD_HEADER
         ^
2 errors generated.
command failed: exit code = 1
Total errors: 10
make[2]: *** [CMakeFiles/sw_build_dependencies] Error 1
make[1]: *** [CMakeFiles/sw_build_dependencies.dir/all] Error 2
make: *** [all] Error 2
egorpugin commented 3 years ago

I did not package that allegro5 package properly. I'll try to do it (couple of days). See its current spec - https://software-network.org/org.sw.demo.liballeg.allegro5/specification

Also note that you need allegro5 imgui backend. Run sw list allegro or on the website.

Okay so I need to explicitly?

Yes, otherwise how else everyone will know your intentions? Imgui has many backends.


Actually you need only https://software-network.org/org.sw.demo.ocornut.imgui.backend.allegro5 dependency. It must provide allegro5 library for you. Something like this

find_package(SW REQUIRED)
sw_add_package(org.sw.demo.ocornut.imgui.backend.allegro5)
sw_execute()

(I need to fix that package first.)

egorpugin commented 3 years ago

Try it now. Excerpt from my cmake config:

set(deps
    org.sw.demo.ocornut.imgui.backend.allegro5
)

find_package(SW REQUIRED)
sw_add_package(${deps})
sw_execute()

add_executable(${PROJECT_NAME} ${src})
target_link_libraries(${PROJECT_NAME} PRIVATE ${deps})
SamuelMarks commented 3 years ago

CMakeLists.txt

cmake_minimum_required(VERSION 3.2)
project(pp VERSION 0.0.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 14)

file(DOWNLOAD https://raw.githubusercontent.com/ocornut/imgui/6a161b8/examples/example_allegro5/main.cpp src/main.cpp
     EXPECTED_HASH SHA256=1138d4b862d4349beeaea984005b958c185c44ef4edba6a96db7d8c6bde33cb4)
file(DOWNLOAD https://raw.githubusercontent.com/ocornut/imgui/6a161b8/imgui_impl_allegro5.cpp src/imgui_impl_allegro5.cpp
     EXPECTED_HASH SHA256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)
# Hmm, same hash?
file(DOWNLOAD https://raw.githubusercontent.com/ocornut/imgui/6a161b8/imgui_impl_allegro5.h src/imgui_impl_allegro5.h
     EXPECTED_HASH SHA256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)

set(src ${CMAKE_CURRENT_BINARY_DIR}/src/main.cpp)
set(deps org.sw.demo.ocornut.imgui org.sw.demo.ocornut.imgui.backend.allegro5)

find_package(SW REQUIRED)
sw_add_package(${deps})
sw_execute()

add_executable(${PROJECT_NAME} ${src})
target_link_libraries(${PROJECT_NAME} PRIVATE ${deps})
$ rm -rf build && mkdir $_ && cd $_
/tmp/imgui3 $ rm -rf build && mkdir $_ && cd $_
/tmp/imgui3/build $ cmake ..
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found SW: /usr/local/bin/sw  
-- sw: processing dependencies
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/imgui3/build
/tmp/imgui3/build $ cmake --build . | tee logg
[ 33%] sw: building dependencies
[ 33%] Built target sw_build_dependencies
[ 66%] Building CXX object CMakeFiles/pp.dir/src/main.cpp.o
/tmp/imgui3/build/src/main.cpp:37:5: error: use of undeclared identifier 'ImGui_ImplAllegro5_Init'
    ImGui_ImplAllegro5_Init(display);
    ^
/tmp/imgui3/build/src/main.cpp:70:13: error: use of undeclared identifier 'ImGui_ImplAllegro5_ProcessEvent'
            ImGui_ImplAllegro5_ProcessEvent(&ev);
            ^
/tmp/imgui3/build/src/main.cpp:75:17: error: use of undeclared identifier 'ImGui_ImplAllegro5_InvalidateDeviceObjects'
                ImGui_ImplAllegro5_InvalidateDeviceObjects();
                ^
/tmp/imgui3/build/src/main.cpp:77:17: error: use of undeclared identifier 'ImGui_ImplAllegro5_CreateDeviceObjects'
                ImGui_ImplAllegro5_CreateDeviceObjects();
                ^
/tmp/imgui3/build/src/main.cpp:82:9: error: use of undeclared identifier 'ImGui_ImplAllegro5_NewFrame'
        ImGui_ImplAllegro5_NewFrame();
        ^
/tmp/imgui3/build/src/main.cpp:125:9: error: use of undeclared identifier 'ImGui_ImplAllegro5_RenderDrawData'
        ImGui_ImplAllegro5_RenderDrawData(ImGui::GetDrawData());
        ^
/tmp/imgui3/build/src/main.cpp:130:5: error: use of undeclared identifier 'ImGui_ImplAllegro5_Shutdown'
    ImGui_ImplAllegro5_Shutdown();
    ^
7 errors generated.
make[2]: *** [CMakeFiles/pp.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/pp.dir/all] Error 2
make: *** [all] Error 2

Do I need a target_include_directories line?

egorpugin commented 3 years ago

No, you need to include imgui allegro5 backend header. Check https://github.com/ocornut/imgui/blob/master/examples/example_allegro5/main.cpp#L9 Do you have this line?

SamuelMarks commented 3 years ago

I have this, but I'm not sure this was the right way or if these headers are meant to be packaged:

file(DOWNLOAD https://raw.githubusercontent.com/ocornut/imgui/6a161b8/imgui_impl_allegro5.cpp src/imgui_impl_allegro5.cpp
     EXPECTED_HASH SHA256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)
# Hmm, same hash?
file(DOWNLOAD https://raw.githubusercontent.com/ocornut/imgui/6a161b8/imgui_impl_allegro5.h src/imgui_impl_allegro5.h
     EXPECTED_HASH SHA256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)
egorpugin commented 3 years ago

I think the best starting point it to build imgui example directly. this file - https://github.com/ocornut/imgui/blob/master/examples/example_allegro5/main.cpp

I've tried that, there is the issue with sw's cmake integration. It does not path system libs (and frameworks on macos) to cmake target. This will be fixed later with new sw version.


What you can try now is to use sw as build system instead of cmake. You may add the following snipped to example main.cpp:

/*
deps: org.sw.demo.ocornut.imgui.backend.allegro5
*/ 

And run sw build main.cpp on it. There is still some issue with macos build. I've successfully build it on windows during my tests.


Another way is to create sw.cpp - C++ build config that is used by sw with following contents

void build(Solution &s)
{
    auto &t = s.addExecutable("mytargetname");
    t += "main.cpp";
    t += "org.sw.demo.ocornut.imgui.backend.allegro5"_dep;
} 

And run sw build in current dir.

SamuelMarks commented 3 years ago

Thanks but I depend on a bunch of other C/C++ libraries and need consistent tooling throughout. Will await your CMake fix :)

egorpugin commented 3 years ago

Please note, it won't be available in near future. Such issues are postponed till the next major version.

SamuelMarks commented 3 years ago

Sort-of offtopic: I'm working on a few C++ projects at the moment, some commercial, some open-source, others both. If you want some contract work hit me up and I'll see if my client can get aboard.

Specifically: machine-learning; CMake; C++; C (incl. using C89 to write package managers); video processing, compilers, &etc.

(only sort-of offtopic because this could help fund sw…)

I really like the concept of sw, and appreciate the 1-man effort approach (looking at your GitHub profile and comparing it to mine shows comparable efforts… would be great to work alongside you 😃)

samuel@offscale.io

egorpugin commented 3 years ago

Ok, thank you, I'll think about it.