Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Unresolved External Symbols (Read 3695 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Unresolved External Symbols

Hello,

I am new to foobar2000, and I am trying to write a simple plugin for myself. Right now I just have stub code to see if I can build it and run foobar2000 with it. However, when I build it I get linker errors. The errors are:

[!--sizeo:2--][span style=\"font-size:10pt;line-height:100%\"][!--/sizeo--]unresolved external symbol "char const * __cdecl core_api::get_my_file_name(void)" (?get_my_file_name@core_api@@YAPBDXZ)
unresolved external symbol "public: static struct _GUID const componentversion::class_guid" (?class_guid@componentversion@@2U_GUID@@B)
unresolved external symbol "public: static class service_factory_base * service_factory_base::__internal__list" (?__internal__list@service_factory_base@@2PAV1@A)[/size]

By process of elimination I found that these are coming from the DECLARE_COMPONENT_VERSION macro. I examined both foo_sample and foo_tutorial1 plus all of the online documentation that I could find, but I can't find out what I am missing. I am linking against libraries: pfc, foobar2000_SDK, foobar2000_component_client, and shared.

I am using Microsoft Visual Studio 2010 Express. Any ideas? Thanks...

My simple stub code is:

Code: [Select]
[!--sizeo:1--][span style=\"font-size:8pt;line-height:100%\"][!--/sizeo--]#include "stdafx.h"  // just has: #include "..\SDK\foobar2000.h"

DECLARE_COMPONENT_VERSION
(
"Playlist Item Filter",
"1.0",
"Sorts the incoming playlist items by track number."
)



class playlist_incoming_item_filter_custom : public playlist_incoming_item_filter
{
  public:
bool filter_items(metadb_handle_list_cref in, metadb_handle_list_ref out)
    {
        console::print("My filter_items function here...");
       
        t_size count = in.get_count();

        out.remove_all();
        if (count > 0)
        {
            out.add_items(in);
        }
       
        return (count > 0) ? true : false;
    }
};[/size]


Unresolved External Symbols

Reply #1
The first missing symbol belongs to foobar2000_component_client, the other two belong to foobar2000_SDK. So, you're obviously not linking against these librariers. You should check your project settings.

 

Unresolved External Symbols

Reply #2
The first missing symbol belongs to foobar2000_component_client, the other two belong to foobar2000_SDK. So, you're obviously not linking against these librariers. You should check your project settings.


Oops! Apparently I didn't look close enough at foo_tutorial1 to see how I set up the additional link libs and lib paths. Egg on face and sorry...

Thank you very much...