Forum

Page 3 of 5 FirstFirst 12345 LastLast
Results 31 to 45 of 66
  1. #31
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    126
    I got that program...
    It basically says, every part it in x64... Only the DLL is x86??
    How does that even make sense?
    Subsystem also says its GUI, when its a DLL?

    It also gives me the Error message when loading:
    Code:
    Errors were detected when processing
    "[path]\myplugin.dll". See log for details.
    It also says

    Code:
    Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
    Error: Modules with different CPU types were found.
    Any idea?

  2. #32
    Join Date
    September 2012
    Posts
    6,061
    Quote Originally Posted by Jhhhj_original View Post
    It basically says, every part it in x64... Only the DLL is x86??
    How does that even make sense?
    Your DLL was built as 32bit, whereas your system is 64bit and as such has 64bit versions of the DLLs. If you run the 64bit client, you will need to compile the plugin for 64bit.

    Quote Originally Posted by Jhhhj_original View Post
    Subsystem also says its GUI, when its a DLL?
    That is normal.


    Quote Originally Posted by Jhhhj_original View Post
    It also says

    Code:
    Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
    Error: Modules with different CPU types were found.
    Any idea?
    the first one could very well be normal, depending on which one it complains. If it's something below Shell32.dll then it's probably alright.
    The second is because your dll is 32 bit on a 64 bit OS.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  3. #33
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    126
    That is kinda weird, since I compiled it with x64...

    I might look some more into it and see how I can change the config from x64 compiling...

  4. #34
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    126
    Aaaaaaalriiiight!
    Finally!!!
    I got the x64 version finally working...

    Now only:
    It says
    Code:
    Unable to load plugin: Required plugin function name(), version(), apiVersion(), author() or description() not found.: 20 (minimal: 21, currently: 22)
    The thing is, I have all those functions in my plugin...
    I tryed it with ts3plugin_ prefix and also without.
    Both didnt work.
    They are all pointers aswell...

    Code:
    const char* ts3plugin_name() {
        return "TS3 test plugin";
    }
    
    const char* ts3plugin_version() {
        return "0.0.1";
    }
    
    int ts3plugin_apiVersion() {
    	return 21;
    }
    
    const char* ts3plugin_author() {
        return "WhOoKie";
    }
    
    const char* ts3plugin_description() {
        return "Test plugin";
    }
    Clientlog says the same.

  5. #35
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,369
    Quote Originally Posted by Jhhhj_original View Post
    I tryed it with ts3plugin_ prefix and also without.
    No need to try without, it's needed.

    Do you export the symbols? And if so, do you use C name mangling (instead of C++).

    So something like this in your header:
    Code:
    #ifdef WIN32
    #define EXPORT_SYMBOL __declspec(dllexport)
    #else
    #define EXPORT_SYMBOL __attribute__ ((visibility("default")))
    #endif
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    EXPORT_SYMBOL const char* ts3plugin_name();
    EXPORT_SYMBOL const char* ts3plugin_version();
    EXPORT_SYMBOL int ts3plugin_apiVersion();
    EXPORT_SYMBOL const char* ts3plugin_author();
    EXPORT_SYMBOL const char* ts3plugin_description();
    
    //...
    
    #ifdef __cplusplus
    }
    #endif

  6. #36
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    126
    So basically, what do I have to export in that header?
    Only the needed functions, or, if I also use functions like requestClientMove, do I have to export them aswell?

    EDIT:
    Nevermind, just saw that I have to.

  7. #37
    Join Date
    September 2012
    Posts
    6,061
    Every function and callback the client needs to call in your plugin must be exported for the client to be able to find the function.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  8. #38
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    126
    Meaning, functions like onClientTextMessage must be referenced, but things like requestClientMove don't have to, because the function is being called by the DLL not the client?

  9. #39
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,369
    Yes, kind of.

    ts3plugin_onClientTextMessage is (and others are) called by the client and the client will load this function from your library. So in order to make the client able to "see" this function, the function-symbol has to be exported.

    requestClientMove is called by your plugin, you don't need to implement it (and in fact, you are not able to), it's implemented in the client/clientlib and is available in plugins within the TS3Functions-struct given in ts3plugin_setFunctionPointers.

  10. #40
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    126
    Alright.
    Where can I find the function definition for Events?

  11. #41
    Join Date
    September 2012
    Posts
    6,061
    The plugin SDK contains an example plugin.h which has all the functions that need to be exported.
    When sending PMs please make sure to include a reference link to the thread in question in the body of your message.

  12. #42
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,369
    Quote Originally Posted by Chris View Post
    The plugin SDK contains an example plugin.h which has all the functions that need to be exported.
    I'd like to rephrase that to can be exported (the exceptions, though explicitly needed exports were already discussed earlier in this thread).

    I came across some open source plugins on github lately by searching for functionnames to research some argument definitions (to find out, what some int values actually meant). It was very frustrating to find out that nearly everyone simply copies the testplugin and just deletes the original function body. So if you search for a specific functionname, you'll mostly find empty functions. (feel free to try it out!)

    So dear plugin developers: if you don't need a function, please don't use them! (not talking about the slight performance boost, the TS3 client will gain )
    [/rant]

  13. #43
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    126
    Alright.

    I wrote my header, which looks like this:

    Code:
    #ifndef PLUGIN_H
    #define PLUGIN_H
    
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <assert.h>
    #include "lib/ts3_functions.h"
    #include "lib/plugin_definitions.h"
    #include "lib/teamspeak/clientlib_publicdefinitions.h"
    #include "lib/teamspeak/public_definitions.h"
    #include "lib/teamspeak/public_errors.h"
    #include "lib/teamspeak/public_errors_rare.h"
    #include "lib/teamspeak/public_rare_definitions.h"
    #include "lib/teamlog/logtypes.h"
    
    #ifdef  WIN32
    #define EXPORT_SYMBOL __declspec(dllexport)
    #else
    #define EXPORT_SYMBOL __attribute__ ((visibility("default")))
    #endif //  WIN32
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    	/* Needed */
    	EXPORT_SYMBOL const char* ts3plugin_name();
    	EXPORT_SYMBOL const char* ts3plugin_version();
    	EXPORT_SYMBOL int ts3plugin_apiVersion();
    	EXPORT_SYMBOL const char* ts3plugin_author();
    	EXPORT_SYMBOL const char* ts3plugin_description();
    	EXPORT_SYMBOL void ts3plugin_setFunctionPointers(const struct TS3Functions functions);
    
    	/* Optional */
    	EXPORT_SYMBOL int ts3plugin_onTextMessageEvent(uint64 schid, anyID targetMode, anyID toID, anyID fromID, const char* fromName, const char* fromUniqueIdentifier, const char* message, int ffIgnored);
    
    #ifdef __cplusplus
    }
    #endif // __cplusplus
    #endif
    But it still says it could not find the functions...
    I export them, I return them too
    Code:
    const char* ts3plugin_version() {
        return "0.0.1";
    }
    int ts3plugin_apiVersion() {
    	return 21;
    }
    const char* ts3plugin_author() {
        return "WhOoKie";
    }
    const char* ts3plugin_description() {
        return "Test plugin";
    }
    
    static struct TS3Functions tsfuncs;
    
    void ts3plugin_setFunctionPointers(const struct TS3Functions functions) {
        tsfuncs = functions;
    }
    Any idea why?
    Clientlog says it loaded successfully, but it could not find the functions...

    @Thomas
    Do you mean with "not export all functions in the plugin header" like I did?

  14. #44
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,369
    I'd guess, the clientlog tells a little bit more, like which functions are missing. I assume, you are missing init and shutdown callbacks.

    Quote Originally Posted by Jhhhj_original View Post
    Alright.
    @Thomas
    Do you mean with "not export all functions in the plugin header" like I did?
    I meant, to not export (or use at all) callbacks, you don't need in your plugin. Your code looks great.

  15. #45
    Join Date
    October 2015
    Location
    Germany, Bavaria
    Posts
    126
    That might very well be the problem.
    Afaik, I didn't export the init and shutdown callbacks.

    On the shutdown callback, I should clear the buffers and free the memorys I guess?
    And is there anything needed in the body of the init function? (is there even a body needed?)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Creating plugin Java
    By Retzugil in forum Client Plugins / Lua Scripts
    Replies: 1
    Last Post: May 15th, 2014, 07:23 AM
  2. Creating my first TS3 plugin and it won't load
    By DrPastah in forum Client Plugins / Lua Scripts
    Replies: 5
    Last Post: March 12th, 2014, 11:14 AM
  3. Problems while creating a plugin..
    By Loreman in forum General Questions
    Replies: 0
    Last Post: October 6th, 2013, 03:45 PM
  4. Creating complex GUI with Plugin
    By TigerSnail in forum General Questions
    Replies: 3
    Last Post: May 23rd, 2013, 08:43 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •