Skip to content

Can not package in macOs #507

Open
Open

Description

@dengzibiao

import unrealEnginePython and generate xcode project in mac,and then compile it.At first, report error at
UnrealEnginePython. #if PLATFORM_MAC #include <Headers/Python.h> #include <Headers/structmember.h>.Then I redownloaded The 2.7.15 version of python.and then report error in UEPyEngine.cpp

PyObject *py_unreal_engine_unload_package(PyObject * self, PyObject * args)
{
	PyObject *obj;
	if (!PyArg_ParseTuple(args, "O:unload_package", &obj))
	{
		return NULL;
	}

	UPackage* packageToUnload = ue_py_check_type<UPackage>(obj);
	if (!packageToUnload)
	{
		return PyErr_Format(PyExc_Exception, "argument is not a UPackage");
	}

	FText outErrorMsg;
	if (!PackageTools::UnloadPackages({ packageToUnload }, outErrorMsg))
	{
		return PyErr_Format(PyExc_Exception, TCHAR_TO_UTF8(*outErrorMsg.ToString()));
	}

	Py_RETURN_NONE;
}

qq 20180815203136

Activity

  1. rdeioris commented on Aug 15, 2018

    @rdeioris
    Contributor

    Which unreal version ?

  2. dengzibiao commented on Aug 15, 2018

    @dengzibiao
    Author

    ue4.19.2

  3. rdeioris commented on Aug 15, 2018

    @rdeioris
    Contributor

    The fix should be pretty easy:

    Return PyErr_Format(Pyxc_Exception, "%s", TCHAR_TO_UTF8(*outErrorMsg.ToString());

    I am away from my mac now, let me know if it works for you

  4. dengzibiao commented on Aug 16, 2018

    @dengzibiao
    Author

    ok!It works.I didn't see it in the latest code, is this just valid for python27

  5. changed the title [-]Can not compile in macOs[/-] [+]Can not package in macOs[/+] on Aug 16, 2018
  6. dengzibiao commented on Aug 16, 2018

    @dengzibiao
    Author

    If I Change UnrealEnginePython.uplugin#L20 set as "Editor" instead of "Runtime",Then I Package in ios

    UATHelper: 打包 (iOS):   [14/184] Compile UEPyStaticMesh.cpp
    UATHelper: 打包 (iOS):   [13/184] Compile UEPySEditorViewport.cpp
    UATHelper: 打包 (iOS):   [10/184] Compile UEPyActor.cpp
    UATHelper: 打包 (iOS):   In file included from /Users/soccer/Documents/Unreal Projects/unrealLuaTest/Plugins/UnrealEnginePython/Source/UnrealEnginePython/Private/Slate/UEPySlate.cpp:2:
    UATHelper: 打包 (iOS):   In file included from /Users/soccer/Documents/Unreal Projects/unrealLuaTest/Plugins/UnrealEnginePython/Source/UnrealEnginePython/Private/Slate/UEPySlate.h:3:
    UATHelper: 打包 (iOS):   In file included from /Users/soccer/Documents/Unreal Projects/unrealLuaTest/Plugins/UnrealEnginePython/Source/UnrealEnginePython/Private/UEPyModule.h:3:
    UATHelper: 打包 (iOS):   /Users/soccer/Documents/Unreal Projects/unrealLuaTest/Plugins/UnrealEnginePython/Source/UnrealEnginePython/Public/UnrealEnginePython.h:38:2: error: unknown type name 'PyObject_HEAD'
    UATHelper: 打包 (iOS):           PyObject_HEAD
    UATHelper: 打包 (iOS):           ^
    UATHelper: 打包 (iOS):   /Users/soccer/Documents/Unreal Projects/unrealLuaTest/Plugins/UnrealEnginePython/Source/UnrealEnginePython/Public/UnrealEnginePython.h:40:9: error: expected ';' at end of declaration list
    UATHelper: 打包 (iOS):           UObject *ue_object;
    UATHelper: 打包 (iOS):                  ^
    UATHelper: 打包 (iOS):                  ;
    UATHelper: 打包 (iOS):   In file included from /Users/soccer/Documents/Unreal Projects/unrealLuaTest/Plugins/UnrealEnginePython/Source/UnrealEnginePython/Private/UObject/UEPyViewport.cpp:1:
    UATHelper: 打包 (iOS):   In file included from /Users/soccer/Documents/Unreal Projects/unrealLuaTest/Plugins/UnrealEnginePython/Source/UnrealEnginePython/Private/UObject/UEPyViewport.h:5:
    UATHelper: 打包 (iOS):   In file included from /Users/soccer/Documents/Unreal Projects/unrealLuaTest/Plugins/UnrealEnginePython/Source/UnrealEnginePython/Private/UEPyModule.h:3:
    UATHelper: 打包 (iOS):   /Users/soccer/Documents/Unreal Projects/unrealLuaTest/Plugins/UnrealEnginePython/Source/UnrealEnginePython/Public/UnrealEnginePython.h:38:2: error: unknown type name 'PyObject_HEAD'
    UATHelper: 打包 (iOS):           PyObject_HEAD
    UATHelper: 打包 (iOS):           ^
    UATHelper: 打包 (iOS):   /Users/soccer/Documents/Unreal Projects/unrealLuaTest/Plugins/UnrealEnginePython/Source/UnrealEnginePython/Public/UnrealEnginePython.h:40:9: error: expected ';' at end of declaration list
    UATHelper: 打包 (iOS):           UObject *ue_object;
    UATHelper: 打包 (iOS):                  ^
    UATHelper: 打包 (iOS):                  ;
    UATHelper: 打包 (iOS):   In file included from /Users/soccer/Documents/Unreal Projects/unrealLuaTest/Plugins/UnrealEnginePython/Source/UnrealEnginePython/Private/UEPyModule.cpp:1:
    UATHelper: 打包 (iOS):   In file included from /Users/soccer/Documents/Unreal Projects/unrealLuaTest/Plugins/UnrealEnginePython/Source/UnrealEnginePython/Private/UEPyModule.h:3:
    UATHelper: 打包 (iOS):   /Users/soccer/Documents/Unreal Projects/unrealLuaTest/Plugins/UnrealEnginePython/Source/UnrealEnginePython/Public/UnrealEnginePython.h:38:2: error: unknown type name 'PyObject_HEAD'
    UATHelper: 打包 (iOS):           PyObject_HEAD
    UATHelper: 打包 (iOS):           ^
    

    50413b9e-be5e-4126-8c57-ae39839a1a32

  7. JoshEngebretson commented on Aug 16, 2018

    @JoshEngebretson

    @dengzibiao "Currently only Windows, MacOSX, Linux and Android are supported."

  8. dengzibiao commented on Aug 17, 2018

    @dengzibiao
    Author

    macOs High Sierra is not Ok

    qq20180817-085913

  9. rdeioris commented on Aug 17, 2018

    @rdeioris
    Contributor

    I cannot reproduce your error on my system. Which clang version are you using ? Even the errors you get about headers are pretty weird, which python version are you using ? Have you tried with unreal 4.20 ?

  10. dengzibiao commented on Aug 17, 2018

    @dengzibiao
    Author

    the .uproject content is

    {
    	"FileVersion": 3,
    	"EngineAssociation": "4.19",
    	"Category": "",
    	"Description": "",
    	"Modules": [
    		{
    			"Name": "xxx",
    			"Type": "Runtime",
    			"LoadingPhase": "Default"
    		}
    	]
    }
    

    in command line

    Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 29 2018, 20:59:26) 
    [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    

    I do not try ue4.20.You want me to try it?

  11. added a commit that references this issue on Aug 17, 2018
  12. rdeioris commented on Aug 17, 2018

    @rdeioris
    Contributor

    Better to try with python3, regarding clang i was meaning the one used by xcode, not by python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions