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

Upgrade to SDL 2.0.9 #483

Merged
merged 22 commits into from
Aug 10, 2019
Merged

Conversation

seyhajin
Copy link
Contributor

@seyhajin seyhajin commented Jun 5, 2019

Hi Mark,

I have upgrade SDL module to latest stable version (2.0.9).

I've tested on :

  • Windows 10 (GCC target x86 & MSVC target x64) + Emscripten target v1.38.19
  • Linux (ElementaryOS) (GCC target x64)
  • MacOS Mojave (GCC target x64)

@blitz-research
Copy link
Owner

Nice job, unfortunately the trouble makers are always android and ios!

Is anyone even using these any more?

@D-a-n-i-l-o
Copy link
Contributor

Mobile targets 'iOS' and 'Android' are very important.

@abakobo
Copy link
Contributor

abakobo commented Jun 6, 2019

Yes mobile is my main release output. I'll try to build to android from win10/osx high sierra+Mojave and to ios as soon as I have some free time.

@abakobo
Copy link
Contributor

abakobo commented Jun 6, 2019

first attempt on W10 (with mojotest.monkey2) failed with the following error (on a system where android target works with latest dev)


Parsing...
Semanting...
Translating...
Compiling...
[armeabi-v7a] Compile++ thumb: mx2_main <= _r.cpp
[armeabi-v7a] Compile++ thumb: mx2_main <= _r.cpp
[armeabi-v7a] Compile++ thumb: mx2_main <= _r.cpp
[armeabi-v7a] Compile++ thumb: mx2_main <= _r.cpp
[armeabi-v7a] Compile++ thumb: mx2_main <= _r.cpp
[armeabi-v7a] Compile++ thumb: mx2_main <= _r.cpp
[armeabi-v7a] Compile++ thumb: mx2_main <= _r.cpp
[armeabi-v7a] Compile++ thumb: mx2_main <= _r.cpp
[armeabi-v7a] Compile++ thumb: mx2_main <= _r.cpp
[armeabi-v7a] Compile++ thumb: mx2_main <= _r.cpp
[armeabi-v7a] Compile++ thumb: mx2_main <= _r.cpp
[armeabi-v7a] Compile++ thumb: mx2_main <= _r.cpp
[armeabi-v7a] Compile++ thumb: mx2_main <= _r.cpp
[armeabi-v7a] Compile++ thumb: mx2_main <= _r.cpp
[armeabi-v7a] Compile++ thumb: mx2_main <= _r.cpp
[armeabi-v7a] Compile++ thumb: mx2_main <= _r.cpp
[armeabi-v7a] Compile++ thumb: mx2_main <= _r.cpp
[armeabi-v7a] Compile++ thumb: mx2_main <= mojotest_mojotest.cpp
[armeabi-v7a] Compile++ thumb: mx2_main <= mojotest_monkey_math.cpp
[armeabi-v7a] Prebuilt       : libopenal.so <= C:/Users/koko/Desktop/monkey2-sld29/modules/openal/openal-soft/jniLibs/armeabi-v7a/
[armeabi-v7a] SharedLibrary  : libmx2_main.so
Build error: System command failed:

ndk-build

jni/../../../SDL/src/audio/SDL_audio.c:617: error: undefined reference to 'SDL_WriteToDataQueue'
jni/../../../SDL/src/audio/SDL_audio.c:575: error: undefined reference to 'SDL_ReadFromDataQueue'
jni/../../../SDL/src/audio/SDL_audio.c:638: error: undefined reference to 'SDL_ReadFromDataQueue'
jni/../../../SDL/src/audio/SDL_audio.c:598: error: undefined reference to 'SDL_WriteToDataQueue'
jni/../../../SDL/src/audio/SDL_audio.c:660: error: undefined reference to 'SDL_CountDataQueue'
jni/../../../SDL/src/audio/SDL_audio.c:656: error: undefined reference to 'SDL_CountDataQueue'
jni/../../../SDL/src/audio/SDL_audio.c:680: error: undefined reference to 'SDL_ClearDataQueue'
jni/../../../SDL/src/audio/SDL_audio.c:1404: error: undefined reference to 'SDL_NewDataQueue'
jni/../../../SDL/src/audio/SDL_audio.c:1138: error: undefined reference to 'SDL_FreeDataQueue'
jni/../../../SDL/src/audio/SDL_audiocvt.c:1358: error: undefined reference to 'SDL_NewDataQueue'
jni/../../../SDL/src/audio/SDL_audiocvt.c:1664: error: undefined reference to 'SDL_FreeDataQueue'
jni/../../../SDL/src/audio/SDL_audiocvt.c:1527: error: undefined reference to 'SDL_WriteToDataQueue'
jni/../../../SDL/src/audio/SDL_audiocvt.c:1493: error: undefined reference to 'SDL_WriteToDataQueue'
jni/../../../SDL/src/audio/SDL_audiocvt.c:1631: error: undefined reference to 'SDL_ReadFromDataQueue'
jni/../../../SDL/src/audio/SDL_audiocvt.c:1638: error: undefined reference to 'SDL_CountDataQueue'
jni/../../../SDL/src/audio/SDL_audiocvt.c:1647: error: undefined reference to 'SDL_ClearDataQueue'
C:/Users/koko/Desktop/monkey2-sld29/modules/sdl2/sdl2.buildv1.1.15/android_release_mx/obj/local/armeabi-v7a/libmx2_sdl2.a(SDL_joystick.o):SDL_joystick.c:SDL_joystick_drivers: error: undefined reference to 'SDL_HIDAPI_JoystickDriver'
jni/../../../SDL/src/joystick/android/SDL_sysjoystick.c:347: error: undefined reference to 'HIDAPI_IsDevicePresent'
clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [obj/local/armeabi-v7a/libmx2_main.so] Error 1

***** Fatal mx2cc error *****

@seyhajin
Copy link
Contributor Author

seyhajin commented Jun 6, 2019

Ok, i looking at that

@seyhajin
Copy link
Contributor Author

seyhajin commented Jun 6, 2019

I pushed a fix for Android target (dd9bcb8). You can test again.

@abakobo
Copy link
Contributor

abakobo commented Jun 7, 2019

building monkey2 side worked, building in android studio worked but the mojotest app directly crashes with the following error in the android studio "Error" logcat

06-07 15:26:18.534 2301-2316/? E/art: Failed sending reply to debugger: Broken pipe
06-07 15:26:18.805 2301-2341/? E/art: No implementation found for int org.libsdl.app.SDLActivity.nativeInit(java.lang.Object) (tried Java_org_libsdl_app_SDLActivity_nativeInit and Java_org_libsdl_app_SDLActivity_nativeInit__Ljava_lang_Object_2)
06-07 15:26:18.805 2301-2341/? E/AndroidRuntime: FATAL EXCEPTION: SDLThread
    Process: com.monkey2.monkey2game, PID: 2301
    java.lang.UnsatisfiedLinkError: No implementation found for int org.libsdl.app.SDLActivity.nativeInit(java.lang.Object) (tried Java_org_libsdl_app_SDLActivity_nativeInit and Java_org_libsdl_app_SDLActivity_nativeInit__Ljava_lang_Object_2)
        at org.libsdl.app.SDLActivity.nativeInit(Native Method)
        at org.libsdl.app.SDLMain.run(SDLActivity.java:1043)
        at java.lang.Thread.run(Thread.java:818)

@abakobo
Copy link
Contributor

abakobo commented Jun 7, 2019

on osx high sierra android builds but app crashes with following error in logcat

06-07 16:22:17.116 3826-3882/? E/art: No implementation found for int org.libsdl.app.SDLActivity.nativeInit(java.lang.Object) (tried Java_org_libsdl_app_SDLActivity_nativeInit and Java_org_libsdl_app_SDLActivity_nativeInit__Ljava_lang_Object_2)
06-07 16:22:17.116 3826-3882/? E/AndroidRuntime: FATAL EXCEPTION: SDLThread
    Process: com.monkey2.monkey2gamet, PID: 3826
    java.lang.UnsatisfiedLinkError: No implementation found for int org.libsdl.app.SDLActivity.nativeInit(java.lang.Object) (tried Java_org_libsdl_app_SDLActivity_nativeInit and Java_org_libsdl_app_SDLActivity_nativeInit__Ljava_lang_Object_2)
        at org.libsdl.app.SDLActivity.nativeInit(Native Method)
        at org.libsdl.app.SDLMain.run(SDLActivity.java:1043)
        at java.lang.Thread.run(Thread.java:818)

@seyhajin
Copy link
Contributor Author

seyhajin commented Jun 7, 2019

It seems to me that it is related to the 'android product' following the update of the SDL.
I do not know enough how it's related and it works with monkey2, maybe @blitz-research can help us?

@abakobo
Copy link
Contributor

abakobo commented Jun 9, 2019

copied sdlactivity.java from sdl2.0.9 to products (as it seems we have to use the sdlactivity.java corresponding to the sdl version. but now of cours I have build errors on android studio side (horrors?)

org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details.
	at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:50)
	at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:35)
	at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:98)
	at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:51)
	at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:37)
	at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:35)
	at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25)
	at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilationFinalizer.execute(IncrementalCompilationFinalizer.java:39)
	at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilationFinalizer.execute(IncrementalCompilationFinalizer.java:24)
	at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:207)
	at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:133)
	at com.android.build.gradle.tasks.factory.AndroidJavaCompile.compile(AndroidJavaCompile.java:125)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
	at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:46)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
	at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
	at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
	at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
	at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
	at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
	at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
	at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
	at java.lang.Thread.run(Thread.java:745)



java compiler, sdlactivity.java errors:

error: cannot find symbol class SDLGenericMotionListener_API12	
error: cannot find symbol class HIDDeviceManager	
error: cannot find symbol class SDLGenericMotionListener_API12	
error: cannot find symbol class SDLGenericMotionListener_API26	
error: cannot find symbol class SDLGenericMotionListener_API24	
error: cannot find symbol class SDLGenericMotionListener_API12	
error: cannot find symbol variable SDL	
error: cannot find symbol variable SDL	
error: cannot find symbol variable HIDDeviceManager	
error: cannot find symbol variable SDL	
error: cannot find symbol variable SDL	
error: cannot find symbol variable SDL	
[deprecation] showDialog(int,Bundle) in Activity has been deprecated	
[unchecked] unchecked call to getMethod(String,Class<?>...) as a member of the raw type Class	
error: cannot find symbol variable SDL	
[deprecation] setType(int) in SurfaceHolder has been deprecated	
[deprecation] LA_88 in PixelFormat has been deprecated	
[deprecation] RGBA_4444 in PixelFormat has been deprecated	
[deprecation] RGB_332 in PixelFormat has been deprecated	
error: cannot find symbol variable SDLControllerManager	
error: cannot find symbol class SDLGenericMotionListener_API12	
error: cannot find symbol variable SDL	
[deprecation] getText() in ClipboardManager has been deprecated	
[deprecation] ClipboardManager in android.text has been deprecated	
error: cannot find symbol variable SDL	

@seyhajin
Copy link
Contributor Author

seyhajin commented Jun 11, 2019

'Android product' has been updated with latest 'SDLActivity.java'.
@abakobo : You can try again for Android platform.

@abakobo
Copy link
Contributor

abakobo commented Jun 12, 2019

trying to build seyhajin/monkey2-sdl-2.0.9 brach on osx high sierra I have the following error: ('EGL/egl.h' file not found)
I'll try to find&copy the file as soon as I have some free time.

***** Making module 'sdl2' (macos release x64 gcc mx) *****

[#    ] Parsing...
[##   ] Semanting...
[###  ] Translating...
[#### ] Compiling...

[!] Building Error: System command failed:

gcc -c -std=gnu99 -mmacosx-version-min=10.9 -Wno-deprecated-declarations -Wno-tautological-pointer-compare -Wno-undefined-bool-conversion -Wno-int-to-void-pointer-cast -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-parentheses-equality -O3 -DNDEBUG -I"/Users/koko/Desktop/monkey2-sdl-29ter/modules/" -I"/Users/koko/Desktop/monkey2-sdl-29ter/modules/monkey/native" -I"/Users/koko/Desktop/monkey2-sdl-29ter/modules/sdl2/SDL/include/" -DNDEBUG=1 -DBB_THREADS=1 -MMD -MF"/Users/koko/Desktop/monkey2-sdl-29ter/modules/sdl2/sdl2.buildv1.1.15/macos_release_mx/build/cocoaclipboard9a773d78.m.deps" -o "/Users/koko/Desktop/monkey2-sdl-29ter/modules/sdl2/sdl2.buildv1.1.15/macos_release_mx/build/cocoaclipboard9a773d78.m.o" "/Users/koko/Desktop/monkey2-sdl-29ter/modules/sdl2/SDL/src/video/cocoa/SDL_cocoaclipboard.m"

In file included from /Users/koko/Desktop/monkey2-sdl-29ter/modules/sdl2/SDL/src/video/cocoa/SDL_cocoaclipboard.m:25:
In file included from /Users/koko/Desktop/monkey2-sdl-29ter/modules/sdl2/SDL/src/video/cocoa/SDL_cocoavideo.h:41:
In file included from /Users/koko/Desktop/monkey2-sdl-29ter/modules/sdl2/SDL/src/video/cocoa/SDL_cocoawindow.h:29:
In file included from /Users/koko/Desktop/monkey2-sdl-29ter/modules/sdl2/SDL/src/video/cocoa/../SDL_egl_c.h:28:
/Users/koko/Desktop/monkey2-sdl-29ter/modules/sdl2/SDL/include/SDL_egl.h:31:10: fatal error: 'EGL/egl.h' file not found
#include <EGL/egl.h>
         ^~~~~~~~~~~
1 error generated.

@seyhajin
Copy link
Contributor Author

seyhajin commented Jun 13, 2019

I have tested on Mojave, it's work well.
Can you see this commit 2246ff3 ?
What your value of this define 'SDL_VIDEO_OPENGL_EGL' ?

@blitz-research : i have tested iOS target with iOS Simulator, it's works on my Mojave VM :) also Android target (#483 (comment)).

I will push a latest tweaks soon.

@abakobo
Copy link
Contributor

abakobo commented Jun 14, 2019

hi
unfortunately I can now build monkey2 but get the following error in xcode on both mojave and high sierra (trying to build to my IPhone6s)

Ld /Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-frpuolyamothmgcdxqictvjabkgt/Build/Products/Debug-iphoneos/Mojotest.app/Mojotest normal arm64 (in target: Mojotest)
    cd /Volumes/MacHD/m2moj/monkey2-upgrade-sdl2/bananas/mojotest/mojotest.products/iOS
    export IPHONEOS_DEPLOYMENT_TARGET=8.0
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk -L/Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-frpuolyamothmgcdxqictvjabkgt/Build/Products/Debug-iphoneos -L/Volumes/MacHD/m2moj/monkey2-upgrade-sdl2/bananas/mojotest/mojotest.products/iOS -F/Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-frpuolyamothmgcdxqictvjabkgt/Build/Products/Debug-iphoneos -filelist /Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-frpuolyamothmgcdxqictvjabkgt/Build/Intermediates.noindex/Mojotest.build/Debug-iphoneos/Mojotest.build/Objects-normal/arm64/Mojotest.LinkFileList -miphoneos-version-min=8.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-frpuolyamothmgcdxqictvjabkgt/Build/Intermediates.noindex/Mojotest.build/Debug-iphoneos/Mojotest.build/Objects-normal/arm64/Mojotest_lto.o -Xlinker -no_deduplicate -lmx2_main -framework OpenAL -framework GameController -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework CoreAudio -framework AudioToolbox -framework CoreGraphics -framework CoreMotion -framework AVFoundation -Xlinker -dependency_info -Xlinker /Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-frpuolyamothmgcdxqictvjabkgt/Build/Intermediates.noindex/Mojotest.build/Debug-iphoneos/Mojotest.build/Objects-normal/arm64/Mojotest_dependency_info.dat -o /Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-frpuolyamothmgcdxqictvjabkgt/Build/Products/Debug-iphoneos/Mojotest.app/Mojotest

Undefined symbols for architecture arm64:
  "_UIKit_Vulkan_GetDrawableSize", referenced from:
      _UIKit_CreateDevice in libmx2_main.a(uikitvideo8460bb2b.m.o)
  "_UIKit_Vulkan_CreateSurface", referenced from:
      _UIKit_CreateDevice in libmx2_main.a(uikitvideo8460bb2b.m.o)
  "_METAL_RenderDriver", referenced from:
      _render_drivers in libmx2_main.a(renderb13b84ba.c.o)
  "_UIKit_Vulkan_UnloadLibrary", referenced from:
      _UIKit_CreateDevice in libmx2_main.a(uikitvideo8460bb2b.m.o)
  "_UIKit_Vulkan_GetInstanceExtensions", referenced from:
      _UIKit_CreateDevice in libmx2_main.a(uikitvideo8460bb2b.m.o)
  "_UIKit_Vulkan_LoadLibrary", referenced from:
      _UIKit_CreateDevice in libmx2_main.a(uikitvideo8460bb2b.m.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Edit building for iphoneXs simulator I actually get an error too:

Ld /Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-frpuolyamothmgcdxqictvjabkgt/Build/Products/Debug-iphonesimulator/Mojotest.app/Mojotest normal x86_64 (in target: Mojotest)
    cd /Volumes/MacHD/m2moj/monkey2-upgrade-sdl2/bananas/mojotest/mojotest.products/iOS
    export IPHONEOS_DEPLOYMENT_TARGET=8.0
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk -L/Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-frpuolyamothmgcdxqictvjabkgt/Build/Products/Debug-iphonesimulator -L/Volumes/MacHD/m2moj/monkey2-upgrade-sdl2/bananas/mojotest/mojotest.products/iOS -F/Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-frpuolyamothmgcdxqictvjabkgt/Build/Products/Debug-iphonesimulator -filelist /Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-frpuolyamothmgcdxqictvjabkgt/Build/Intermediates.noindex/Mojotest.build/Debug-iphonesimulator/Mojotest.build/Objects-normal/x86_64/Mojotest.LinkFileList -mios-simulator-version-min=8.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-frpuolyamothmgcdxqictvjabkgt/Build/Intermediates.noindex/Mojotest.build/Debug-iphonesimulator/Mojotest.build/Objects-normal/x86_64/Mojotest_lto.o -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-frpuolyamothmgcdxqictvjabkgt/Build/Intermediates.noindex/Mojotest.build/Debug-iphonesimulator/Mojotest.build/Mojotest.app-Simulated.xcent -lmx2_main -framework OpenAL -framework GameController -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework CoreAudio -framework AudioToolbox -framework CoreGraphics -framework CoreMotion -framework AVFoundation -Xlinker -dependency_info -Xlinker /Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-frpuolyamothmgcdxqictvjabkgt/Build/Intermediates.noindex/Mojotest.build/Debug-iphonesimulator/Mojotest.build/Objects-normal/x86_64/Mojotest_dependency_info.dat -o /Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-frpuolyamothmgcdxqictvjabkgt/Build/Products/Debug-iphonesimulator/Mojotest.app/Mojotest

ld: warning: ignoring file /Volumes/MacHD/m2moj/monkey2-upgrade-sdl2/bananas/mojotest/mojotest.products/iOS/libmx2_main.a, missing required architecture x86_64 in file /Volumes/MacHD/m2moj/monkey2-upgrade-sdl2/bananas/mojotest/mojotest.products/iOS/libmx2_main.a (2 slices)
ld: entry point (_main) undefined. for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

May be I'm doing something wrong here but never had such errors before...

@seyhajin
Copy link
Contributor Author

@abakobo : I just pushed the changes, I hope I have not forgotten anything, you can test again.

@seyhajin
Copy link
Contributor Author

seyhajin commented Jun 14, 2019

@abakobo : for "entry point (_main) undefined. for architecture x86_64", have you rebuild modules without threads ?

http://monkeycoder.co.nz/forums/topic/ios-missing-files-for-simulator/

@abakobo
Copy link
Contributor

abakobo commented Jun 15, 2019

about the threads, yes I forgot I had to rebuild without threads.
For the build to device some new undefined symbols have appeard. Thanks

Ld /Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-crggpgfiuyduuhdbygtgqeyvnftv/Build/Products/Debug-iphoneos/Mojotest.app/Mojotest normal arm64
    cd /Users/koko/Desktop/monkey2-upgrade-sdl2/bananas/mojotest/mojotest.products/iOS
    export IPHONEOS_DEPLOYMENT_TARGET=8.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk -L/Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-crggpgfiuyduuhdbygtgqeyvnftv/Build/Products/Debug-iphoneos -L/Users/koko/Desktop/monkey2-upgrade-sdl2/bananas/mojotest/mojotest.products/iOS -F/Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-crggpgfiuyduuhdbygtgqeyvnftv/Build/Products/Debug-iphoneos -filelist /Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-crggpgfiuyduuhdbygtgqeyvnftv/Build/Intermediates.noindex/Mojotest.build/Debug-iphoneos/Mojotest.build/Objects-normal/arm64/Mojotest.LinkFileList -miphoneos-version-min=8.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-crggpgfiuyduuhdbygtgqeyvnftv/Build/Intermediates.noindex/Mojotest.build/Debug-iphoneos/Mojotest.build/Objects-normal/arm64/Mojotest_lto.o -Xlinker -no_deduplicate -lmx2_main -framework OpenAL -framework GameController -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework CoreAudio -framework AudioToolbox -framework CoreGraphics -framework CoreMotion -framework AVFoundation -Xlinker -dependency_info -Xlinker /Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-crggpgfiuyduuhdbygtgqeyvnftv/Build/Intermediates.noindex/Mojotest.build/Debug-iphoneos/Mojotest.build/Objects-normal/arm64/Mojotest_dependency_info.dat -o /Users/koko/Library/Developer/Xcode/DerivedData/Mojotest-crggpgfiuyduuhdbygtgqeyvnftv/Build/Products/Debug-iphoneos/Mojotest.app/Mojotest

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_MTLTextureDescriptor", referenced from:
      objc-class-ref in libmx2_main.a(metalff9908d4.m.o)
  "_OBJC_CLASS_$_MTLSamplerDescriptor", referenced from:
      objc-class-ref in libmx2_main.a(metalff9908d4.m.o)
  "_OBJC_CLASS_$_MTLRenderPassDescriptor", referenced from:
      objc-class-ref in libmx2_main.a(metalff9908d4.m.o)
  "_OBJC_CLASS_$_MTLRenderPipelineDescriptor", referenced from:
      objc-class-ref in libmx2_main.a(metalff9908d4.m.o)
  "_MTLCreateSystemDefaultDevice", referenced from:
      _METAL_CreateRenderer in libmx2_main.a(metalff9908d4.m.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@abakobo
Copy link
Contributor

abakobo commented Jun 16, 2019

yay psychedelic app working on my Iphone6s, great. I suppose we can add the metal framework to the default. I tried to add

E45E86F022B631DE006BC287 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef =

E45E86EF22B631DE006BC287 /* Metal.framework */; };

to project.pbxproj (in xcodeproj package) but it was not sufficient. will have a try later.

Thanks!

@abakobo
Copy link
Contributor

abakobo commented Jun 17, 2019

made a pull request on seyhajin:upgrade-sdl2 with modified xcodeproj that adds the metal framework to the default product. Tested and working on my iphone6s.

add Metal Framework to xcodeproj (iOS product)
@seyhajin
Copy link
Contributor Author

seyhajin commented Jun 17, 2019

Merged. Thanks @abakobo !

@seyhajin
Copy link
Contributor Author

@blitz-research : This pull request is ready to merge :)

@blitz-research
Copy link
Owner

Hi,

Looking good! But I am getting the below build error on windows.

I get this when building Ted2 with rebuildall, and a simple mojo3d template test app.

About to try Android on Windows...

Mx2cc version 1.1.15

MSVC installation auto-detected:
Tools='C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023'
Include='C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0'
Lib='C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0'

***** Making app 'C:/Users/The Razorback/Desktop/test.monkey2' (windows release x86 msvc mx) *****

Parsing...
Semanting...
Translating...
Compiling...
Linking C:/Users/The Razorback/Desktop/test.products/Windows/Test.exe...
Build error: System command failed:

link user32.lib  -subsystem:windows -entry:mainCRTStartup -out:"C:/Users/The Razorback/Desktop/test.products/Windows/Test.exe" @tmp/lnkFiles1.txt >tmp/stdout1.txt

Microsoft (R) Incremental Linker Version 14.16.27025.1
Copyright (C) Microsoft Corporation.  All rights reserved.

"C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/r5b58089e.cpp_r.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/rad502ce5.cpp_r.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/rfcd2a385.cpp_r.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/r88b795a5.cpp_r.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/rd5dd6405.cpp_r.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/rf82d072d.cpp_r.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/r50b9e285.cpp_r.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/ra94e3f05.cpp_r.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/r161e0169.cpp_r.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/r1866e45.cpp_r.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/rb53cfbed.cpp_r.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/r4d437a05.cpp_r.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/r81a7f731.cpp_r.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/r489c9905.cpp_r.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/r4d35de45.cpp_r.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/r6db8ea65.cpp_r.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/r11a656e5.cpp_r.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/r4aa8fae5.cpp_r.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/r2294c885.cpp_r.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/test71720754.cpp.obj" "C:/Users/The Razorback/Desktop/test.buildv1.1.15/windows_release_msvc_mx/build/entity17af995d.cpp.obj" "D:/dev/github-repos/github-monkey2-sdl2.0.9/modules/mojo3d/mojo3d.buildv1.1.15/windows_release_msvc_mx/mojo3d.lib" "D:/dev/github-repos/github-monkey2-sdl2.0.9/modules/reflection/reflection.buildv1.1.15/windows_release_msvc_mx/reflection.lib" "D:/dev/github-repos/github-monkey2-sdl2.0.9/modules/bullet/bullet.buildv1.1.15/windows_release_msvc_mx/bullet.lib" "D:/dev/github-repos/github-monkey2-sdl2.0.9/modules/mojo/mojo.buildv1.1.15/windows_release_msvc_mx/mojo.lib" "D:/dev/github-repos/github-monkey2-sdl2.0.9/modules/std/std.buildv1.1.15/windows_release_msvc_mx/std.lib" "D:/dev/github-repos/github-monkey2-sdl2.0.9/modules/zlib/zlib.buildv1.1.15/windows_release_msvc_mx/zlib.lib" "D:/dev/github-repos/github-monkey2-sdl2.0.9/modules/stb-vorbis/stb-vorbis.buildv1.1.15/windows_release_msvc_mx/stb-vorbis.lib" "D:/dev/github-repos/github-monkey2-sdl2.0.9/modules/stb-image-write/stb-image-write.buildv1.1.15/windows_release_msvc_mx/stb-image-write.lib" "D:/dev/github-repos/github-monkey2-sdl2.0.9/modules/stb-image/stb-image.buildv1.1.15/windows_release_msvc_mx/stb-image.lib" "D:/dev/github-repos/github-monkey2-sdl2.0.9/modules/miniz/miniz.buildv1.1.15/windows_release_msvc_mx/miniz.lib" "D:/dev/github-repos/github-monkey2-sdl2.0.9/modules/sdl2/sdl2.buildv1.1.15/windows_release_msvc_mx/sdl2.lib" "D:/dev/github-repos/github-monkey2-sdl2.0.9/modules/jni/jni.buildv1.1.15/windows_release_msvc_mx/jni.lib" "D:/dev/github-repos/github-monkey2-sdl2.0.9/modules/opengl/opengl.buildv1.1.15/windows_release_msvc_mx/opengl.lib" "D:/dev/github-repos/github-monkey2-sdl2.0.9/modules/openal/openal.buildv1.1.15/windows_release_msvc_mx/openal.lib" "D:/dev/github-repos/github-monkey2-sdl2.0.9/modules/libc/libc.buildv1.1.15/windows_release_msvc_mx/libc.lib" "D:/dev/github-repos/github-monkey2-sdl2.0.9/modules/freetype/freetype.buildv1.1.15/windows_release_msvc_mx/freetype.lib" "D:/dev/github-repos/github-monkey2-sdl2.0.9/modules/emscripten/emscripten.buildv1.1.15/windows_release_msvc_mx/emscripten.lib" "D:/dev/github-repos/github-monkey2-sdl2.0.9/modules/monkey/monkey.buildv1.1.15/windows_release_msvc_mx/monkey.lib" "D:/dev/github-repos/github-monkey2-sdl2.0.9/modules/openal/openal-soft/lib/OpenAL32.lib" dsound.lib xinput.lib dinput8.lib setupapi.lib hid.lib advapi32.lib ole32.lib shell32.lib oleaut32.lib imm32.lib winmm.lib gdi32.lib user32.lib kernel32.lib version.lib Comdlg32.lib Ws2_32.lib 
LIBCMT.lib(ftol2.obj) : error LNK2005: __ftol2_sse already defined in sdl2.lib(stdliba3aff93a.c.obj)
C:/Users/The Razorback/Desktop/test.products/Windows/Test.exe : fatal error LNK1169: one or more multiply defined symbols found



***** Fatal mx2cc error *****

Internal mx2cc build error

@blitz-research
Copy link
Owner

Macos/linux desktop is looking good so far though.

@blitz-research
Copy link
Owner

blitz-research commented Jun 22, 2019

I've built the debug modules for ios and am getting the following build error with a simple mojo3d template app.

Trying again with MX2_THREADS=0 (I would quite like to remove thread support from mx2, as it's not well tested (and thread stuff really needs to be thrashed) and is probably slowing down gc a bit).

Mx2cc version 1.1.15

***** Making app '/Users/marksibly/Desktop/Test3d.monkey2' (ios release armv7 arm64 gcc mx) *****

Parsing...
Semanting...
Translating...
Compiling...
Build error: System command failed:

g++ -c -std=c++11 -arch arm64 -miphoneos-version-min=8.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk -fobjc-arc -Wno-deprecated-declarations -Wno-tautological-pointer-compare -Wno-undefined-bool-conversion -Wno-int-to-void-pointer-cast -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-parentheses-equality -fvisibility=hidden -O3 -DNDEBUG -I"/Users/marksibly/dev/github-monkey2-sdl2.0.9/modules/" -I"/Users/marksibly/dev/github-monkey2-sdl2.0.9/modules/monkey/native" -I"/Users/marksibly/Desktop/" -I"/Users/marksibly/dev/github-monkey2-sdl2.0.9/modules/bullet/bullet3-2.85.1/src/" -I"/Users/marksibly/dev/github-monkey2-sdl2.0.9/modules/freetype/freetype-2.6.3/include/" -I"/Users/marksibly/dev/github-monkey2-sdl2.0.9/modules/sdl2/SDL/include/" -I"/Users/marksibly/dev/github-monkey2-sdl2.0.9/modules/zlib/zlib-1.2.11/" -DNDEBUG=1 -DBB_THREADS=1 -I"/Users/marksibly/Desktop/Test3d.buildv1.1.15/ios_release_mx/build/" -MMD -MF"/Users/marksibly/Desktop/Test3d.buildv1.1.15/ios_release_mx/build/r5b58089e.cpp_r.deps" -o "/Users/marksibly/Desktop/Test3d.buildv1.1.15/ios_release_mx/build/r5b58089e.cpp_r.o" "/Users/marksibly/Desktop/Test3d.buildv1.1.15/ios_release_mx/include/_r.cpp"

In file included from /Users/marksibly/Desktop/Test3d.buildv1.1.15/ios_release_mx/include/_r.cpp:8:
/Users/marksibly/Desktop/Test3d.buildv1.1.15/ios_release_mx/include/Test3d_Test3d.h:7:10: fatal error: 'mojo/mojo.buildv1.1.15/ios_release_mx/include/mojo_app_2window.h' file not found
#include "mojo/mojo.buildv1.1.15/ios_release_mx/include/mojo_app_2window.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.


***** Fatal mx2cc error *****

Internal mx2cc build error

@blitz-research
Copy link
Owner

Ok, it seems like mx2cc is always trying to build the release version?

...but if I change 'build target' to 'release' then immediately back to 'debug' it works!?!

Have you changed mxcc at all, or is this a new bug?

@blitz-research
Copy link
Owner

blitz-research commented Jun 22, 2019

Ok, Android manifest appears to be borked...

https://github.com/seyhajin/monkey2/blob/upgrade-sdl2/products/android/Monkey2Game/app/src/main/AndroidManifest.xml#L29

...but after removing this line I can run mojo3d template app on Android!

ios will have to wait until tomorrow....

@seyhajin
Copy link
Contributor Author

seyhajin commented Jun 22, 2019

Hi Mark,

In "env_windows.txt" file, it's mentioned that "'Build architecture: x86 or x64, x64 only working with msvc.", is it still true ? Otherwise it will be necessary to update this information.
So, i have pushed a fix for "MSVC x86" target (af1135e), rebuilded 'sdl2' module, rebuilded 'mojotest' bananas and it seems worked! :)

For iOS target (device or simulator), i've rebuild all modules without threads (MX2_THREADS=0), it seems worked too. @abakobo can you confirm ?

In 'AndroidManifest.xml' file, there are two '>' signs (end of lines 27 and 29) in the tag "activity", can you delete the first and see if it works better?

For a 'build target' of 'mx2cc', maybe this commit (60784da) have changed that.

@blitz-research
Copy link
Owner

In "env_windows.txt" file, it's mentioned that "'Build architecture: x86 or x64, x64 only working with msvc.", is it still true ?

AFAIK, mingw can't do 64bit builds unless someone has got this working?

So, i have pushed a fix for "MSVC x86" target

Rebuilding now...

For iOS target (device or simulator), i've rebuild all modules without threads (MX2_THREADS=0)

So iOS can't do threads at all?

In 'AndroidManifest.xml' file, there are two '>' signs (end of lines 27 and 29)

Well, after deleting the second nothing appeared to be 'wrong' so I'm not sure if deleting the first instead can make anything better.

For a 'build target' of 'mx2cc', maybe this commit (60784da) have changed that.

This change doesn't appear to be in the pull request though?

I think the debug/release thing might be a UI/Ted2 issue...

@seyhajin
Copy link
Contributor Author

seyhajin commented Jun 22, 2019

AFAIK, mingw can't do 64bit builds unless someone has got this working?

My bad, I thought that MSVC was exclusively for 64 bits. I will test with latest version of mingw x64.

So iOS can't do threads at all?

On my side, threads do not seem to work with the iphoneos simulator (see #483 (comment)). I'm going to look at the problem if it should work.

Well, after deleting the second nothing appeared to be 'wrong' so I'm not sure if deleting the first instead can make anything better.

Edit: i see, android:configChanges has already been used.

This change doesn't appear to be in the pull request though?

This change comes from another fork that i got into mine and the code seems to me correct. Usually for mx2cc i run the script rebuildmx2cc or updatemx2cc.

@abakobo
Copy link
Contributor

abakobo commented Jun 23, 2019

Threads work on ios physical device so threads should be ON by default IMHO.

About the debug for mobile, I never managed to get it so there might be a bug there..

@seyhajin
Copy link
Contributor Author

seyhajin commented Jun 23, 2019

@blitz-research @abakobo

Build and run app for iOs device

On MacOS, with :
MX2_THREADS=1
MX2_IOS_ARCHS=-arch armv7 -arch arm64
MX2_IOS_USE_SIMULATOR=0

On Debug, that's work very well
mx2cc_macos makemods -clean -config=debug -target=ios ==>

Mx2cc version 1.1.15d

***** Making module 'monkey' (ios debug armv7 arm64 gcc mx) *****

[#    ] Parsing...
[##   ] Semanting...
[###  ] Translating...
[#### ] Compiling...
[#####] Archiving /Users/seyha/Documents/git/monkey2-sey/modules/monkey/monkey.buildv1.1.15/ios_debug_mx/monkey.a...

On Release, i have an error with same environment variable values :
mx2cc_macos makemods -clean -config=release -target=ios ==>

Mx2cc version 1.1.15d

***** Making module 'monkey' (ios release armv7 arm64 gcc mx) *****

[#    ] Parsing...
[##   ] Semanting...
[###  ] Translating...
[#### ] Compiling...

[!] Building Error: System command failed:

g++ -c -std=c++11 -arch armv7 -arch arm64 -miphoneos-version-min=8.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk -fobjc-arc -Wno-deprecated-declarations -Wno-tautological-pointer-compare -Wno-undefined-bool-conversion -Wno-int-to-void-pointer-cast -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-parentheses-equality -fvisibility=hidden -O3 -DNDEBUG -I"/Users/seyha/Documents/git/monkey2-sey/modules/" -I"/Users/seyha/Documents/git/monkey2-sey/modules/monkey/native" -DNDEBUG=1 -DBB_THREADS=1 -MMD -MF"/Users/seyha/Documents/git/monkey2-sey/modules/monkey/monkey.buildv1.1.15/ios_release_mx/build/monkeye71b0cf4.cpp.deps" -o "/Users/seyha/Documents/git/monkey2-sey/modules/monkey/monkey.buildv1.1.15/ios_release_mx/build/monkeye71b0cf4.cpp.o" "/Users/seyha/Documents/git/monkey2-sey/modules/monkey/monkey.buildv1.1.15/ios_release_mx/src/monkey_monkey.cpp"

In file included from /Users/seyha/Documents/git/monkey2-sey/modules/monkey/monkey.buildv1.1.15/ios_release_mx/src/monkey_monkey.cpp:2:
In file included from /Users/seyha/Documents/git/monkey2-sey/modules/monkey/monkey.buildv1.1.15/ios_release_mx/include/monkey_monkey.h:5:
In file included from /Users/seyha/Documents/git/monkey2-sey/modules/monkey/native/bbmonkey.h:9:
/Users/seyha/Documents/git/monkey2-sey/modules/monkey/native/bbdebug.h:97:9: error: thread-local storage is not supported for the current target
        extern thread_local bbDBContext *currentContext;
               ^
In file included from /Users/seyha/Documents/git/monkey2-sey/modules/monkey/monkey.buildv1.1.15/ios_release_mx/src/monkey_monkey.cpp:2:
In file included from /Users/seyha/Documents/git/monkey2-sey/modules/monkey/monkey.buildv1.1.15/ios_release_mx/include/monkey_monkey.h:5:
In file included from /Users/seyha/Documents/git/monkey2-sey/modules/monkey/native/bbmonkey.h:10:
In file included from /Users/seyha/Documents/git/monkey2-sey/modules/monkey/native/bbarray.h:6:
/Users/seyha/Documents/git/monkey2-sey/modules/monkey/native/bbgc_mx.h:22:9: error: thread-local storage is not supported for the current target
        extern thread_local bbGCThread *currentThread;
               ^
/Users/seyha/Documents/git/monkey2-sey/modules/monkey/native/bbgc_mx.h:23:9: error: thread-local storage is not supported for the current target
        extern thread_local bbGCFiber *currentFiber;
               ^
3 errors generated.


***** Fatal mx2cc error *****

Internal mx2cc build error

By modifying MX2_IOS_ARCHS to -arch arm64, that's work but 'mx2cc' always show 'armv7' despite having defined 'arm64' arch only (bug?)

mx2cc_macos makemods -clean -config=release -target=ios ==>

Mx2cc version 1.1.15d

***** Making module 'monkey' (ios release armv7 arm64 gcc mx) *****
[#    ] Parsing...
[##   ] Semanting...
[###  ] Translating...
[#### ] Compiling...
[#####] Archiving /Users/seyha/Documents/git/monkey2-sey/modules/monkey/monkey.buildv1.1.15/ios_release_mx/monkey.a...

Sadly, Apple's clang build for iOS armv7 (as of xcode 6.3) doesn't include support for threadlocal storage.

I find this as the best source for knowing basic of all iOS devices: http://iossupportmatrix.com/

And iOS Device Compatibility.

In brief, arm64 is supported from >iPhone5s, >iPad Air, >iPad Mini 2, >iPod Touch 6th gen.

And to finish in beauty, 'Mojotest' on my iPhone X device :)

@seyhajin
Copy link
Contributor Author

AFAIK, mingw can't do 64bit builds unless someone has got this working?

I've added latest MinGWx64 support (GCC 8.1.0) see a new pull request #484.

@blitz-research blitz-research merged commit a9a9a6d into blitz-research:develop Aug 10, 2019
@blitz-research
Copy link
Owner

I finally merged this and it's 99% OK except that I can't 'open' mojo3d files from inside the IDE anymore - I get a framebuffer format error when I double click on one of the demo .mojo3d files in the monkey 2 root dir. And note this only happens on windows so it's probably related to ANGLE.

It's not a huge deal and I'll look into it, but if anyone has any ideas...?

@seyhajin
Copy link
Contributor Author

Good news!

With latest 'master' version of Ted2Go (2.14a) build with MSVC x64, i don't have any problems to open .mojo3d files from inside the IDE.

FYI next version will be coming soon (2.0.10) : https://discourse.libsdl.org/t/sdl-2-0-10-prerelease/26300

Monkey2 apps could be exported to tvOS and watchOS targets :) with GamePad controller support (on tvOS)... Already possible with version 2.0.9.

@blitz-research
Copy link
Owner

I can reproduce on ducks demo by adding:

SetConfig("MOJO_OPENGL_PROFILE","es")

At the top of Main().

This effectively forces mojo to use 'Angle' lib on windows, and monkey2 depends on SDL2 to init the correct GL libs etc so I suspect something has changed subtly here.

Can anyone else reproduce this?

Will investigate further...

@seyhajin
Copy link
Contributor Author

seyhajin commented Aug 20, 2019

Mark,

I tried with my latest version and I do not meet this problem (MSVC x64 target). See the screenshot

But i'll investigate with your latest develop. Rebuild in progress...

Edit: OK, i've tried your develop version, and it's work well too (MSVC x64 target)

@abakobo
Copy link
Contributor

abakobo commented Aug 20, 2019

JPEG_20190820_104804
As said on discord, ducks are working for me too with "es" profile.
Dropping a mojo3d file does fail in both ted2go though. Looks like a opengles 1.0 error. Thought it was 2.0!?

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.

4 participants