How to use UnitySendMessage in tizen.

How can i use UnitySendMessage in tizen.What header file i have to include.How to link to that function.

[quote=“Rohit_Sijwali”, post:1, topic: 598860]
How can i use UnitySendMessage in tizen.What header file i have to include.How to link to that function.
[/quote]
http://docs.unity3d.com/Manual/PluginsForTizen.html

I have declared UnitySendMessage in a header file in tizen native as
void UnitySendMessage(char *gameObject,char *methodName, char *message);
But while calling this method this is giving me linking error.

The prototype for UnitySendMessage should be

void UnitySendMessage(const char *gameObject, const char *methodName, const char *message);

See if that makes a difference.

Its not the compiling error its linking error. It doesnt make any difference.

When are you getting this linking error? Could you post some logs? And with which version of Unity?

Actually the linking error is in building the shared library in Tizen IDE,

[quote=“Rohit_Sijwali”, post:7, topic: 598860]
Actually the linking error is in building the shared library in Tizen IDE,
[/quote]
Oh, that is a very different situation. Here is an example project of a very simple dynamic library that includes UnitySendMessage for the Tizen IDE. https://oc.unity3d.com/index.php/s/Q9JOKmB2NCxDam3

Thanks for the project. But there is no UnitySendMessage. I am able to create dynamic library, but for callback i want to implement UnitySendMessage.

[quote=“Rohit_Sijwali”, post:9, topic: 598860]
Thanks for the project. But there is no UnitySendMessage. I am able to create dynamic library, but for callback i want to implement UnitySendMessage.
[/quote]
Ok, so here is the issue.

At some time in the past the linker flag -Wl,–no-undefined was added by default to shared library projects. You cannot disable it. Because of this you must define all functions in the library. So until we find a workaround it seems that UnitySendMessage will not work in Unity plugins.

Just thought of one option. You compile a library from the command line. From there you can control the compile and link options.

Can you give me a sample.

[quote=“Rohit_Sijwali”, post:12, topic: 598860]
Can you give me a sample.
[/quote]
Of a Makefile? I don’t have one at the moment but you can find thousands of examples and documentation about them online.

I want a example project of a very simple dynamic library which include UnitySendMessage for the Tizen IDE.

[quote=“Rohit_Sijwali”, post:14, topic: 598860]
I want a example project of a very simple dynamic library which include UnitySendMessage for the Tizen IDE.
[/quote]
Unfortunately at this time you cannot create a Tizen IDE dynamic library project that will build when using UnitySendMessage.

As I said before, this is due to the default linker flags in the IDE that cannot be changed. I have spoken to Samsung about this and they are investigating.

For now your only option is to compile and link your library from the command line.

I have removed -Wl,--no-undefined option and compile it through command line. But i cannot get callback in unity by calling
UnitySendMessage.

[quote=“Rohit_Sijwali”, post:16, topic: 598860]
I have removed -Wl,–no-undefined option and compile it through command line. But i cannot get callback in unity by calling
UnitySendMessage.
[/quote]
Do you get any errors in the log?

Ok sorry its working. I think i give wrong gameObjectname.

[quote=“Rohit_Sijwali”, post:18, topic: 598860]
Ok sorry its working. I think i give wrong gameObjectname.
[/quote]
hey Rohit, can you share what commands you used to change the linking flags?

I have created a makefile.txt which includes all the environmental variable.I m sharing it with you. I have included this makefile.txt in makefile and removed "-Wl,--no-undefined" option in this makefile. To create makefile.txt you need to go to project ->properties->C/C++ Build->Environment and copy paste all the environment variable. You can then build the makefile.

2369411--160904--makefile.txt (3.9 KB)