Kongregate's Kartridge SDK Extension mac help

I’ve finished some work on an extension for Kongregate’s Kartridge SDK, for their platform launching Nov 1st:

Currently it only works for windows since I can’t figure out how or what files to link for mac. It’s my first time writing an extension though so the solution is probably something very simple I’m missing. I got an ndll to build but trying to build a project results “could not load module kartridge@kartridge_initialize__1” but have run out of ideas to try.

This seems to help:

Thanks! I think I tried that but I’m having some architecture problems that are probably just local to my macbook…

Currently I get many errors like this when doing “lime rebuild . mac”:

clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: warning: object file (lib/kartridge-sdk/OSX/libkartridge-sdk.a(constants.o)) was built for newer OSX version (10.11) than being linked (10.6)
ld: warning: object file (lib/kartridge-sdk/OSX/libkartridge-sdk.a(kongregate.o)) was built for newer OSX version (10.11) than being linked (10.6)
ld: warning: object file (lib/kartridge-sdk/OSX/libkartridge-sdk.a(kongregate-api.o)) was built for newer OSX version (10.11) than being linked (10.6)

Is the libstdc++ deprecated warning related? I may need to update something but I don’t know what, and other things tend to break whenever I update several things. I’m on OSX 10.13.4 though so that should be fine?

These are warnings, I don’t think they’re really an issue. The SDK isn’t compatible with older macOS releases, though we do target them ourselves. It just means the binary will only work on the Kartridge minimum OS version

EDIT: Got it working! I was able to build the ndll with the .a file with “lime rebuild . mac -64 -clean” after upgrading to hxcpp 4.0.4. (I was using 3.4.188) I already typed this post out though so I figured I’d leave it up to help any potential users in the future googling a similar issue

Sorry, I wasn’t clear enough describing my problem (the build fails) and cut too much out since the full output is so long - Here’s where I currently stand:

Building the ndll with “lime rebuild . mac” after your change to use the .a file instead of .dylib in build.xml:

Dustins-MacBook-Air:project dustinaux$ lime rebuild . mac
Link: …/ndll/Mac64/kartridge.ndll
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: warning: object file (lib/kartridge-sdk/OSX/libkartridge-sdk.a(constants.o)) was built for newer OSX version (10.11) than being linked (10.6)
ld: warning: object file (lib/kartridge-sdk/OSX/libkartridge-sdk.a(kongregate.o)) was built for newer OSX version (10.11) than being linked (10.6)
ld: warning: object file (lib/kartridge-sdk/OSX/libkartridge-sdk.a(kongregate-api.o)) was built for newer OSX version (10.11) than being linked (10.6)
ld: warning: object file (lib/kartridge-sdk/OSX/libkartridge-sdk.a(utils.o)) was built for newer OSX version (10.11) than being linked (10.6)
ld: warning: object file (lib/kartridge-sdk/OSX/libkartridge-sdk.a(services.o)) was built for newer OSX version (10.11) than being linked (10.6)
ld: warning: object file (lib/kartridge-sdk/OSX/libkartridge-sdk.a(statistics.o)) was built for newer OSX version (10.11) than being linked (10.6)
ld: warning: object file (lib/kartridge-sdk/OSX/libkartridge-sdk.a(api-message.o)) was built for newer OSX version (10.11) than being linked (10.6)
ld: warning: object file (lib/kartridge-sdk/OSX/libkartridge-sdk.a(osx-utils.o)) was built for newer OSX version (10.11) than being linked (10.6)
ld: warning: object file (lib/kartridge-sdk/OSX/libkartridge-sdk.a(api-client.o)) was built for newer OSX version (10.11) than being linked (10.6)
ld: warning: object file (lib/kartridge-sdk/OSX/libkartridge-sdk.a(api-request.o)) was built for newer OSX version (10.11) than being linked (10.6)
ld: warning: object file (lib/kartridge-sdk/OSX/libkartridge-sdk.a(api-connection.o)) was built for newer OSX version (10.11) than being linked (10.6)
ld: warning: object file (lib/kartridge-sdk/OSX/libkartridge-sdk.a(osx-api-connection.o)) was built for newer OSX version (10.11) than being linked (10.6)
ld: warning: object file (lib/kartridge-sdk/OSX/libkartridge-sdk.a(exception.o)) was built for newer OSX version (10.11) than being linked (10.6)
Undefined symbols for architecture x86_64:
“std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::find(char, unsigned long) const”, referenced from:
easyloggingpp::Configurations::Parser::parseLine(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&, unsigned int&, easyloggingpp::Configurations*) in libkartridge-sdk.a(kongregate.o)
“std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::rfind(char, unsigned long) const”, referenced from:
kongregate::Utils::last_token(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, char) in libkartridge-sdk.a(utils.o)
“std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::compare(char const*) const”, referenced from:
easyloggingpp::internal::RegisteredLoggers::RegisteredLoggers() in libkartridge-sdk.a(kongregate.o)
easyloggingpp::Configurations::setToDefault() in libkartridge-sdk.a(kongregate.o)
easyloggingpp::Configurations::set(unsigned int, unsigned int, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, bool) in libkartridge-sdk.a(kongregate.o)
easyloggingpp::Configurations::Parser::parseLine(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&, unsigned int&, easyloggingpp::Configurations*) in libkartridge-sdk.a(kongregate.o)
easyloggingpp::Level::convertFromString(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) in libkartridge-sdk.a(kongregate.o)
easyloggingpp::ConfigurationType::convertFromString(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) in libkartridge-sdk.a(kongregate.o)
easyloggingpp::internal::TypedConfigurations::parse(easyloggingpp::Configurations const&) in libkartridge-sdk.a(kongregate.o)

“std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >::compare(unsigned long, unsigned long, char const*, unsigned long) const”, referenced from:
easyloggingpp::Configurations::Parser::parseLine(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&, unsigned int&, easyloggingpp::Configurations*) in libkartridge-sdk.a(kongregate.o)

similar output for hundreds of other methods cut here - you get the picture

and the end:

construction vtable for std::__1::basic_iostream<char, std::__1::char_traits >-in-std::__1::basic_fstream<char, std::__1::char_traits > in libkartridge-sdk.a(kongregate.o)
construction vtable for std::__1::basic_iostream<char, std::__1::char_traits >-in-std::__1::basic_fstream<char, std::__1::char_traits > in libkartridge-sdk.a(kongregate-api.o)
construction vtable for std::__1::basic_iostream<char, std::__1::char_traits >-in-std::__1::basic_stringstream<char, std::__1::char_traits, std::__1::allocator > in libkartridge-sdk.a(kongregate-api.o)
construction vtable for std::__1::basic_iostream<char, std::__1::char_traits >-in-std::__1::basic_stringstream<char, std::__1::char_traits, std::__1::allocator > in libkartridge-sdk.a(utils.o)
construction vtable for std::__1::basic_iostream<char, std::__1::char_traits >-in-std::__1::basic_stringstream<char, std::__1::char_traits, std::__1::allocator > in libkartridge-sdk.a(statistics.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

In fact the only way I’ve been able to produce an ndll at all is with “lime rebuild . mac -64” while using the .dylib file instead of .a in build.xml.

But then trying to actually use that ndll to build the example with “lime test mac” with or without -64 results in this, my original error at the start of the thread:

Dustins-MacBook-Air:Example dustinaux$ lime test mac
Creating /Users/dustinaux/Desktop/kartridge/Example/bin/macos/obj/obj/darwin64/__pch/haxe/hxcpp.h.gch…
Compiling group: haxe
xcrun --sdk macosx10.13 clang++ -Iinclude -c -fvisibility=hidden -stdlib=libstdc++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -O2 -I/usr/local/lib/haxe/lib/hxcpp/3,4,188/include -DHX_MACOS -m64 -Wno-parentheses -Wno-null-dereference -Wno-unused-value -Wno-format-extra-args -Wno-overflow -Wno-bool-conversion -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_API_LEVEL=331(haxe) … tags=[haxe,static]- src/ApplicationMain.cpp
src/lime/utils/AssetCache.cpp [haxe,release]
Link: ApplicationMain
clang: warning: libstdc++ is deprecated; move to libc++ [-Wdeprecated]
Error : Could not load module kartridge@kartridge_initialize__1

…so if I need to be using the .a file in build.xml it seems I have fallen back a step now and can’t even create the ndll.

1 Like

Great job on building this out, and thank you for sharing it with everyone :slight_smile: