IPB

Welcome Guest ( Log In | Register )

> foobar2000 Development Forum Rules

This forum is for developer discussions only. If you have a problem / bug report / idea / feature request that isn't related to foobar2000 SDK, post it in an appropiate forum instead - tech support questions go to support forum, everything else goes to general forum.
All non-developer posts on this forum will be removed. Continued abuse of this forum will result in admin actions (warnings, account suspension).

2 Pages V   1 2 >  
Reply to this topicStart new topic
Foobar as a UPnP renderer (player
Wadsbrau
post Dec 15 2008, 18:55
Post #1





Group: Members
Posts: 60
Joined: 10-December 08
Member No.: 64276



I am in the initial stages of creating a plugin (my first) that will make Foobar2000 a player for UPnP. I am not unfamiliar to the general logic of prgramming. I experience is mainly in C.

My code for the UPnP will compile and run as a stand alone app. Although it doesn't have any player capability at this time.
I have been able to add the UPnP stack code (as dll) to the SDK and can build it and add it to foobar with no errors and no functionality.

My first step is that I merely need to have foobar launch the UPnP code when it starts up. Howvever, I have no knowledge of Foobar's objects and functions.

Can anyone help me get started with the code that is used to initialize my plugin when foobar starts up?

I have tried this but it doesnt work:

CODE
include "../SDK/foobar2000.h"
DECLARE_COMPONENT_VERSION("Test", "0.1", NULL);

class initquit_handler : public initquit
{
    virtual void on_init()
    {
         UPnPStart();
    }
    virtual void on_quit()
     {
    
     }
};
static initquit_factory_t<initquit_handler> foo_initquit;


After I get it to launch, I merely need to tell foobar to play, pause stop etc. Then have foobar send the play progress information back to the UPnP control point.

Please help,

Thank you
Darren
Go to the top of the page
+Quote Post
Canar
post Dec 15 2008, 19:29
Post #2





Group: Super Moderator
Posts: 3327
Joined: 26-July 02
From: princegeorge.ca
Member No.: 2796



I would recommend specifically not relying on another application in that manner. Do what you can to pull the appropriate code right in to the foobar2000 component. You're only adding complexity and opportunity for bugs. The more tightly you couple your code to foobar2000, the more of its advanced features you will be able to harness.

What's more, not integrating your component tightly into foobar2000 tends to make users avoid it. I'm currently involved in rewriting foo_edcast because a previous developer did roughly what you're talking about doing.

This post has been edited by Canar: Dec 15 2008, 19:36


--------------------
∑:<
Go to the top of the page
+Quote Post
Wadsbrau
post Dec 15 2008, 19:51
Post #3





Group: Members
Posts: 60
Joined: 10-December 08
Member No.: 64276



QUOTE (Canar @ Dec 15 2008, 12:29) *
I would recommend specifically not relying on another application in that manner. Do what you can to pull the appropriate code right in to the foobar2000 component. You're only adding complexity and opportunity for bugs. The more tightly you couple your code to foobar2000, the more of its advanced features you will be able to harness.

What's more, not integrating your component tightly into foobar2000 tends to make users avoid it. I'm currently involved in rewriting foo_edcast because a previous developer did roughly what you're talking about doing.


That sound like a great idea. Are you talking about adding the plugin code directly into Foobars functions rather than call it from there? I would need to have a better understanding of how Foobar is working code wise, before I could do that. Unless there exists a more detailed reference to Foobar2000's code. Or samples/examples of well commented code (besides the tutorial which i looked at). There is very little help or documentation regarding the UPnP code either.

Until then, If I could get this to at lease run this way and get the rest of it working, it will make it much easier for me to "embed" the UPnP code into Foobars functions as a plugin.

So, how do I start my code (if its possible) when Foobar2000 starts up? For now.

Thank you

Darren
Go to the top of the page
+Quote Post
Canar
post Dec 15 2008, 20:01
Post #4





Group: Super Moderator
Posts: 3327
Joined: 26-July 02
From: princegeorge.ca
Member No.: 2796



CODE
#include "../SDK/foobar2000.h"
DECLARE_COMPONENT_VERSION("Test", "0.1", NULL);

class initquit_handler : public initquit{
    virtual void on_init(){
         UPnPStart();
    }
    virtual void on_quit(){}
};
static service_factory_single_t<initquit_handler> foo_initquit;
Try this instead.


--------------------
∑:<
Go to the top of the page
+Quote Post
Wadsbrau
post Dec 15 2008, 20:47
Post #5





Group: Members
Posts: 60
Joined: 10-December 08
Member No.: 64276



QUOTE (Canar @ Dec 15 2008, 13:01) *
CODE
#include "../SDK/foobar2000.h"
DECLARE_COMPONENT_VERSION("Test", "0.1", NULL);

class initquit_handler : public initquit{
    virtual void on_init(){
         UPnPStart();
    }
    virtual void on_quit(){}
};
static service_factory_single_t<initquit_handler> foo_initquit;
Try this instead.


I just didnt know if that was the proper place to initialize a plugin.

When I try that code (which I have before) I get this when I build it:

"error LNK2001: unresolved external symbol "void __cdecl UPnPStart(void)" (?UPnPStart@@YAXXZ)"

If I comment out the reference to the "myheader.h" i get:

"initfoo.cpp(9) : error C3861: 'UPnPStart': identifier not found"

I realize that the error is supposed to indicate that it cant link with the UPnPStart();
I created a header file with reference to "void UPnPStart(void); with #include "myheader.h" at the top of this code. The reason for this is probably simple and I am rusty regarding VS Express 2008.

What simple stupid thing am i forgetting?

Thank you
Darren
Go to the top of the page
+Quote Post
Frank Bicking
post Dec 15 2008, 21:06
Post #6





Group: Super Moderator
Posts: 1823
Joined: 24-July 02
Member No.: 2776



CODE
static initquit_factory_t<initquit_handler> foo_initquit;

Was correct, no need to change it.

QUOTE
"error LNK2001: unresolved external symbol "void __cdecl UPnPStart(void)" (?UPnPStart@@YAXXZ)"

You probably forgot to add some library (.lib) to the additional linker dependencies.


--------------------
foobar2000.audiohq.de
Go to the top of the page
+Quote Post
Wadsbrau
post Dec 18 2008, 19:04
Post #7





Group: Members
Posts: 60
Joined: 10-December 08
Member No.: 64276



QUOTE (Frank Bicking @ Dec 15 2008, 14:06) *
CODE
static initquit_factory_t<initquit_handler> foo_initquit;

Was correct, no need to change it.

QUOTE
"error LNK2001: unresolved external symbol "void __cdecl UPnPStart(void)" (?UPnPStart@@YAXXZ)"

You probably forgot to add some library (.lib) to the additional linker dependencies.


If I build the UPnP code the way it is now outside of the Foobar2000 SDK. It builds (as .exe). If I change main() to UPnPStart(). Create a new main(), have it run only the UPnPStart(); make a header file to declare the UPnPStart() function, add the #include "myheader.h" to the .cpp with main(); I get the same error. All this outside of the SDK. Im just not sure where to look for the problem. I have tried to manualy debug this on my own, but so far it makes no sense. The code should build....

I figure that I have probaly forgotten what to do in this case. It has been 7 years since I wrote any code.

Darren
Go to the top of the page
+Quote Post
foosion
post Dec 18 2008, 20:28
Post #8





Group: FB2K Moderator (Donating)
Posts: 4336
Joined: 24-February 03
Member No.: 5153



You can't just call a function that resides in another DLL EXE. It would also be an extremely bad idea to call a function in on_init() that essentially implements the main event loop of a separate application.

This post has been edited by foosion: Dec 19 2008, 01:43


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post
Wadsbrau
post Dec 18 2008, 22:21
Post #9





Group: Members
Posts: 60
Joined: 10-December 08
Member No.: 64276



QUOTE (foosion @ Dec 18 2008, 13:28) *
You can't just call a function that resides in another DLL. It would also be an extremely bad idea to call a function in on_init() that essentially implements the main event loop of a separate application.


What do you mean another dll?

Imagine that I have 8 c files of code that were generated by the Intel UPnP device builder. I meremly need to have that stack running in the background for foobar (and its real small). So that, when a command is received by the UPnP stack (such as "play"), UPnP gives the URL of the music file to Foobar and plays it etc. I've received some advice on how not to do this. Does anyone have an idea regarding how I CAN get this working. There have been many threads on many forums (old and new) from pppl wanted a way to have UPnP fuctionality with a PC. No one seems to want to tackle this issue. So I thought I would dust off my memory for writing code and give it a try. There just isnt very much documentation regarding either SDK. Although I have been able to get the UPnP code to run as an exe and figured out most of the functions involved. I just need to know a few things about getting this to work with Foobar2000. Although, I really only need to implement code that will start some sort of player that uses ASIO or KS.

I just need some help to get started.

Thank you

Darren

This post has been edited by Wadsbrau: Dec 18 2008, 22:29
Go to the top of the page
+Quote Post
Yirkha
post Dec 18 2008, 22:42
Post #10





Group: FB2K Moderator
Posts: 2359
Joined: 30-November 07
Member No.: 49158



You should start a separate thread in on_init(), which will then run the UPnP stack asynchronously. That thread would be waiting on the receiving socket (to handle the commands, if I understood that correctly) as well as some kind of "kill event", which would be signaled in on_quit() to stop it gracefully.


--------------------
Full-quoting makes you scroll past the same junk over and over.
Go to the top of the page
+Quote Post
foosion
post Dec 19 2008, 01:42
Post #11





Group: FB2K Moderator (Donating)
Posts: 4336
Joined: 24-February 03
Member No.: 5153



QUOTE (Wadsbrau @ Dec 18 2008, 22:21) *
QUOTE (foosion @ Dec 18 2008, 13:28) *

You can't just call a function that resides in another DLL. It would also be an extremely bad idea to call a function in on_init() that essentially implements the main event loop of a separate application.


What do you mean another dll?
Sorry, I meant to write EXE, not DLL.


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post
Wadsbrau
post Dec 19 2008, 20:38
Post #12





Group: Members
Posts: 60
Joined: 10-December 08
Member No.: 64276



Apparently I hadnt realized that because some of my project is C and some is C++ there was a conflict in naming. I found a reference "google" that refers to the following code to correct it:

extern "C"
{
#include "myheader.h"
}

Adding this allows me to compile the code. If anyone knows of a better approach, please let me know

QUOTE
You should start a separate thread in on_init(), which will then run the UPnP stack asynchronously. That thread would be waiting on the receiving socket (to handle the commands, if I understood that correctly) as well as some kind of "kill event", which would be signaled in on_quit() to stop it gracefully.


It's been a while since I have written code. Could you please refresh my memory with an example or be able to help me make a thread? I would greatly appreciate a sample or something.

Although I can compile the code, it doesn't run the stack when I launch foobar2000

Thank you

Darren
Go to the top of the page
+Quote Post
Wadsbrau
post Dec 19 2008, 21:07
Post #13





Group: Members
Posts: 60
Joined: 10-December 08
Member No.: 64276



Oh, and BTW, can someone tell me how i can can step through the plugin so i can debug it?

Thank you
Darren
Go to the top of the page
+Quote Post
Wadsbrau
post Dec 20 2008, 00:31
Post #14





Group: Members
Posts: 60
Joined: 10-December 08
Member No.: 64276



I was also wondering if it were possible to run Foobar2000's controls from within the UPnP executable instead of as a plugin to Foobar2000?

Darren
Go to the top of the page
+Quote Post
Yirkha
post Dec 20 2008, 00:57
Post #15





Group: FB2K Moderator
Posts: 2359
Joined: 30-November 07
Member No.: 49158



I'm sorry, I don't have time for more exhaustive reply at the moment, so just briefly.

QUOTE (Wadsbrau @ Dec 19 2008, 20:38) *
It's been a while since I have written code. Could you please refresh my memory with an example or be able to help me make a thread?
_beginthread (C/C++)
CreateThread (Win32)
pfc::thread (fb2k)

QUOTE (Wadsbrau @ Dec 19 2008, 21:07) *
Oh, and BTW, can someone tell me how i can can step through the plugin so i can debug it?
Set foobar2000.exe executable as debugged process in MSVC++ project's properties. You can then run it from the IDE and debug it in any way you like. Note it would require changing the output path directly to fb2k's component's directory or adding a post-build step to copy the DLL there.

QUOTE (Wadsbrau @ Dec 20 2008, 00:31) *
I was also wondering if it were possible to run Foobar2000's controls from within the UPnP executable instead of as a plugin to Foobar2000?
Perhaps using any inter-process communication you want, or even simply by running various /play, /stop, /next, … commands from the commandline.


--------------------
Full-quoting makes you scroll past the same junk over and over.
Go to the top of the page
+Quote Post
Wadsbrau
post Dec 23 2008, 18:41
Post #16





Group: Members
Posts: 60
Joined: 10-December 08
Member No.: 64276



I can get the UPnP code to compile as dll now. However, it doesnt get launched when foobar loads. It shows as a component, but when I use the UPnP tools, it isnt being broadcast as a device.
If I need to run my code as a seperate thread (or...?), I have no experience doing this.
I can play pause etc, foobar2000 as an external program from the UPnP code and that works good. But, I need to be able to get the track length and the play position to send to the UPnP controller. Any way to do that?

This would work better as a plugin as I can get to all of Foobars controls within the code. If I can get past the problem of Foobar2000 not running the UPnP code, I could finish this for testing.

I would appreciate any assistance.

Thank you

Darren

This post has been edited by Wadsbrau: Dec 23 2008, 19:02
Go to the top of the page
+Quote Post
Wadsbrau
post Dec 30 2008, 21:51
Post #17





Group: Members
Posts: 60
Joined: 10-December 08
Member No.: 64276



When the UPnP programs runs on its own, it runs in a console window. Could this be a problem? Can I fix that?

I used _beginthread as a test program for just the .exe of the UPnP code. I see a window flash and dissapear, but the UPnP functionality is not detected by the UPnP device tester from Intel.

It appears that the UPnP thread just runs and then exits.

Looks like the UPnP code creates its own thread:


CODE
void main(void)
{
    
    char *protocolInfo;
    DWORD ptid=0;
    DWORD ptid2=0;
    _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
    //////////////////////////////////////////////////////////////////    

    
    MicroStackChain = ILibCreateChain();
    

    /* TODO: Each device must have a unique device identifier (UDN) */
    
    DMR_microStack = DMR_CreateMicroStack(MicroStackChain,"WadsCo Renderer","87e67194-bd02-4f0b-a619-935ac8fa8522","0000001",1800,0);

    
    DMR_FP_AVTransport_GetCurrentTransportActions=(DMR__ActionHandler_AVTransport_GetCurrentTransportActions)&DMR_AVTransport_GetCurrentTransportActions;
    DMR_FP_AVTransport_GetDeviceCapabilities=(DMR__ActionHandler_AVTransport_GetDeviceCapabilities)&DMR_AVTransport_GetDeviceCapabilities;
    DMR_FP_AVTransport_GetMediaInfo=(DMR__ActionHandler_AVTransport_GetMediaInfo)&DMR_AVTransport_GetMediaInfo;
    DMR_FP_AVTransport_GetPositionInfo=(DMR__ActionHandler_AVTransport_GetPositionInfo)&DMR_AVTransport_GetPositionInfo;
    DMR_FP_AVTransport_GetTransportInfo=(DMR__ActionHandler_AVTransport_GetTransportInfo)&DMR_AVTransport_GetTransportInfo;
    DMR_FP_AVTransport_GetTransportSettings=(DMR__ActionHandler_AVTransport_GetTransportSettings)&DMR_AVTransport_GetTransportSettings;
    DMR_FP_AVTransport_Next=(DMR__ActionHandler_AVTransport_Next)&DMR_AVTransport_Next;
    DMR_FP_AVTransport_Pause=(DMR__ActionHandler_AVTransport_Pause)&DMR_AVTransport_Pause;
    DMR_FP_AVTransport_Play=(DMR__ActionHandler_AVTransport_Play)&DMR_AVTransport_Play;
    DMR_FP_AVTransport_Previous=(DMR__ActionHandler_AVTransport_Previous)&DMR_AVTransport_Previous;
    DMR_FP_AVTransport_Seek=(DMR__ActionHandler_AVTransport_Seek)&DMR_AVTransport_Seek;
    DMR_FP_AVTransport_SetAVTransportURI=(DMR__ActionHandler_AVTransport_SetAVTransportURI)&DMR_AVTransport_SetAVTransportURI;
    DMR_FP_AVTransport_SetPlayMode=(DMR__ActionHandler_AVTransport_SetPlayMode)&DMR_AVTransport_SetPlayMode;
    DMR_FP_AVTransport_Stop=(DMR__ActionHandler_AVTransport_Stop)&DMR_AVTransport_Stop;
    DMR_FP_ConnectionManager_GetCurrentConnectionIDs=(DMR__ActionHandler_ConnectionManager_GetCurrentConnectionIDs)&DMR_ConnectionManager_GetCurrentConnectionIDs;
    DMR_FP_ConnectionManager_GetCurrentConnectionInfo=(DMR__ActionHandler_ConnectionManager_GetCurrentConnectionInfo)&DMR_ConnectionManager_GetCurrentConnectionInfo;
    DMR_FP_ConnectionManager_GetProtocolInfo=(DMR__ActionHandler_ConnectionManager_GetProtocolInfo)&DMR_ConnectionManager_GetProtocolInfo;
    DMR_FP_RenderingControl_GetLoudness=(DMR__ActionHandler_RenderingControl_GetLoudness)&DMR_RenderingControl_GetLoudness;
    DMR_FP_RenderingControl_GetMute=(DMR__ActionHandler_RenderingControl_GetMute)&DMR_RenderingControl_GetMute;
    DMR_FP_RenderingControl_GetVolume=(DMR__ActionHandler_RenderingControl_GetVolume)&DMR_RenderingControl_GetVolume;
    DMR_FP_RenderingControl_SetLoudness=(DMR__ActionHandler_RenderingControl_SetLoudness)&DMR_RenderingControl_SetLoudness;
    DMR_FP_RenderingControl_SetMute=(DMR__ActionHandler_RenderingControl_SetMute)&DMR_RenderingControl_SetMute;
    DMR_FP_RenderingControl_SetVolume=(DMR__ActionHandler_RenderingControl_SetVolume)&DMR_RenderingControl_SetVolume;

    
    /* All evented state variables MUST be initialized before DMR_Start is called. */
    protocolInfo = BuildProtocolInfo(ProtocolInfoList);
/*    DMR_SetState_AVTransport_LastChange(DMR_microStack,"Sample String");
    //DMR_SetState_ConnectionManager_SourceProtocolInfo(DMR_microStack,"Sample String");
    DMR_SetState_ConnectionManager_SourceProtocolInfo(DMR_microStack,protocolInfo);
    //DMR_SetState_ConnectionManager_SinkProtocolInfo(DMR_microStack,"Sample String");
    DMR_SetState_ConnectionManager_SinkProtocolInfo(DMR_microStack,protocolInfo);
    DMR_SetState_ConnectionManager_CurrentConnectionIDs(DMR_microStack,"Sample String");
    DMR_SetState_RenderingControl_LastChange(DMR_microStack,"Sample String");
*/
    DMR_SetState_AVTransport_LastChange(DMR_microStack, "&lt;Event xmlns=\"urn:schemas-upnp-org:metadata-1-0/AVT/\"/ &gt;");
    DMR_SetState_ConnectionManager_SourceProtocolInfo(DMR_microStack,protocolInfo);
    DMR_SetState_ConnectionManager_SinkProtocolInfo(DMR_microStack, protocolInfo);
    DMR_SetState_ConnectionManager_CurrentConnectionIDs(DMR_microStack, "0");
    DMR_SetState_RenderingControl_LastChange(DMR_microStack, "&lt;Event xmlns=\"urn:schemas-upnp-org:metadata-1-0/RCS/\"/ &gt;");

    
    printf("Intel MicroStack 1.0 - WadsCo Renderer,\r\n\r\n");

    
    CreateThread(NULL,0,&Run,NULL,0,&ptid);
        
    
    ILib_IPAddressMonitorTerminator = CreateEvent(NULL,TRUE,FALSE,NULL);
    ILib_IPAddressMonitorThread = CreateThread(NULL,0,&ILib_IPAddressMonitorLoop,NULL,0,&ptid2);
        
    ILibStartChain(MicroStackChain);

//    return 0;

}


Please help.

Darren

This post has been edited by Wadsbrau: Dec 30 2008, 22:16
Go to the top of the page
+Quote Post
Canar
post Dec 30 2008, 22:27
Post #18





Group: Super Moderator
Posts: 3327
Joined: 26-July 02
From: princegeorge.ca
Member No.: 2796



Maybe if you posted an archive with all the relevant source code help would be easier.


--------------------
∑:<
Go to the top of the page
+Quote Post
Wadsbrau
post Dec 31 2008, 00:04
Post #19





Group: Members
Posts: 60
Joined: 10-December 08
Member No.: 64276



I could do that. Are you saying just put up a .zip or something on a webspace?
I wasnt sure how much help anyone was willing to give.

But,
I'm not sure what this thread does:

CreateThread(NULL,0,&Run,NULL,0,&ptid);

But, if I comment it out and use _beginthread in on_init() the UPnP stack runs properly.

Now, I need tell foobar2000 how to play, pause, stop, seek, etc from within the UPnP code ( which is C)
The upnp code has a seperate function for each of these that is standard naming so that the controller can send the right command. Essentially, In a function like:

void avtransport_play(token, instance_id)
{
Code here to tell foobar2000 to play the file (http://... that is sent here by the control point
Code to tell the controller that the play command was successful.
}

Almost all of the functions for control work like the above.

Can I do that from the UPnP code that is now running in another thread?

If I include the foobar.h header on the upnp.c i get the 100+ errors report.

Darren
Go to the top of the page
+Quote Post
Yirkha
post Dec 31 2008, 09:37
Post #20





Group: FB2K Moderator
Posts: 2359
Joined: 30-November 07
Member No.: 49158



QUOTE (Wadsbrau @ Dec 31 2008, 00:04) *
Can I do that from the UPnP code that is now running in another thread?
Yes.
QUOTE (Wadsbrau @ Dec 31 2008, 00:04) *
If I include the foobar.h header on the upnp.c i get the 100+ errors report.
Because including C++ code from C file won't work. You will need to convert upnp.c to C++.


--------------------
Full-quoting makes you scroll past the same junk over and over.
Go to the top of the page
+Quote Post
Wadsbrau
post Dec 31 2008, 18:11
Post #21





Group: Members
Posts: 60
Joined: 10-December 08
Member No.: 64276



QUOTE (Yirkha @ Dec 31 2008, 02:37) *
QUOTE (Wadsbrau @ Dec 31 2008, 00:04) *
Can I do that from the UPnP code that is now running in another thread?
Yes.
QUOTE (Wadsbrau @ Dec 31 2008, 00:04) *
If I include the foobar.h header on the upnp.c i get the 100+ errors report.
Because including C++ code from C file won't work. You will need to convert upnp.c to C++.


Is there any way to do this automatically. there are many lines of code spanning 10 C files and about the same number of header files in the project. I am using this code because the Intel code generator which creates the core of UPNP created them that way. I would hate to have to convert this whole thing manually.
Isnt there a way to wrap the c code so that VS2008 thinks its c++ and vice versa?

Thank you

Darren
Go to the top of the page
+Quote Post
Yirkha
post Jan 1 2009, 10:58
Post #22





Group: FB2K Moderator
Posts: 2359
Joined: 30-November 07
Member No.: 49158



Why? C code usually compiles fine as C++, unless they use some C++ keywords as normal identifier (e.g. class). Just rename them to .cpp, or force "compile as C++" in Project preferences, or change just one file and link it with the rest of the C code with #includes in extern "C" {} clauses, there are many ways how to do that.


--------------------
Full-quoting makes you scroll past the same junk over and over.
Go to the top of the page
+Quote Post
foosion
post Jan 1 2009, 20:47
Post #23





Group: FB2K Moderator (Donating)
Posts: 4336
Joined: 24-February 03
Member No.: 5153



QUOTE (Wadsbrau @ Dec 30 2008, 21:51) *
I used _beginthread as a test program for just the .exe of the UPnP code. I see a window flash and dissapear, but the UPnP functionality is not detected by the UPnP device tester from Intel.

It appears that the UPnP thread just runs and then exits.
When you do it like that, the main thread finishes executing the main() function, which causes the whole process to terminate, including the UPnP thread.


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post
Wadsbrau
post Jan 2 2009, 19:55
Post #24





Group: Members
Posts: 60
Joined: 10-December 08
Member No.: 64276



I found the trouble, but having issues resolving it. If I use an extern "C" wrapper for the appropriate #includes and include the foobar.h it compiles with 104 errors.

The trouble seems to come from 2 includes that are being used by the upnp stack:
#include <winsock2.h>
#include <ws2tcpip.h>

These are neccessary. But, If i comment those out, the only errors i get are from the now undeclared variables etc that rely on those headers.

Any ideas how i can get past this?

Thank you
Darren
Go to the top of the page
+Quote Post
Wadsbrau
post Jan 2 2009, 20:35
Post #25





Group: Members
Posts: 60
Joined: 10-December 08
Member No.: 64276



I figured out that if I put the includes in a different order (winsock on top) i can compile the code
Go to the top of the page
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 17th April 2014 - 14:50