Visual Studio 6.0 c++ libpurple compile

Discussion in 'C++' started by nattsurf123, Jan 27, 2010.

  1. nattsurf123

    nattsurf123 New Member

    Joined:
    Jan 27, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    Hi,
    This is my first post.
    I'm trying to compile libpurple. There is a tutorial on how to install it with mingw and using cygwin.

    libpurple is included in pidgin chatt application.
    I don't want to use mingw but visual studio. I want to try to build this manually just to learn.
    I would like your help and advice on how to configure and get all nessesary component in order to make it compile.
    I get this error:
    c:\project\libpurple\libc_internal.h(38) : error C2143: syntax error : missing ')' before '*'
    c:\project\libpurple\libc_internal.h(38) : error C2081: 'socklen_t' : name in formal parameter list illegal
    Search on google gives:
    Install Microsoft SDK
    Suggested link not found on Microsoft but redirects to some 1.5 gig installation with server 2008, vista and dot.net.
    I use a windows xp and visual studio 6.0 on a virtual pc.
    Tried to remove as much components as possible from the installation just using source code files.
    Installation resulted in 250 mb of data.
    Don't know really what to do now after the installation.
    The same error occure.
    Any suggestions?

    Sincerely
    Anders
    PS.
    The hardest part with programming is to setup the project so it compiles.
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    Your best bet will be to talk to the people who already know libpurple. There may be a good reason why instructions to build it with Visual Studio aren't included (i.e. a reason other than cost or it being from MS). Maybe the code will need non-trivial modifications to work in VS. But this may already have been done; doesn't Pidgin use libpurple, and I know that works on Windows.

    But if you just want to do it yourself and find out what needs doing, best way to start is by looking at the error and the code it comes from and trying to determine what is causing the error. Is there a missing bracket before a *? What exactly is the code that fails? The next error complains about socklen_t: again, what is the code; the error suggests it could be trying to use something that hasn't been defined yet. Googling socklen_t finds it's part of the Unix header sys/socket.h - the way sockets work on Unix and Windows have significant differences (e.g. lack of OOB support on Windows) and you may have to modify libpurple substantially so that it can work with both implementations.
     
  3. nattsurf123

    nattsurf123 New Member

    Joined:
    Jan 27, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    Damn I wrote a long text, submitted and the forum said I was not logged in. Lost all the post I was going to submit. I'm going for a shorter reply now.

    I'm following this link:

    http:\\pidgin.im\pipermail\devel\2007-May\001041.html

    It should work on visual studio.
    pidgin.im is for bug report and my problem is not a bug.
    Am I missing libs? Maybe it gives different error?
    Maybe I need to add some paths.
    This path I think was made after the install.
    C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Include
    Going to try but I'm sure it will not help.
    Please give me some advice.

    /Anders
     
  4. nattsurf123

    nattsurf123 New Member

    Joined:
    Jan 27, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    Just to note I have tried to find a decent forum for pidgin or libpurple without any luck. So general c++ forums will have to suffice.
     
  5. nattsurf123

    nattsurf123 New Member

    Joined:
    Jan 27, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    I have moved this project to VS 2008.
    I couldn't find this:
    C/C++::Advanced::Force Includes:
    ------------------------------------------------
    winsock2.h; config.h

    I'm not going to use a def file because I would like to mark functions as export instead.

    When I try to compile under the current setup I get these errors:
    Error 84 error C2054: expected '(' to follow 'STATIC_PROTO_INIT' c:\users\admin\documents\visual studio 2008\projects\libpurple\libpurple\core.c 79 LibPurple
    Error 85 error C2082: redefinition of formal parameter 'purple_core_init' c:\users\admin\documents\visual studio 2008\projects\libpurple\libpurple\core.c 80 LibPurple
    Error 86 error C2143: syntax error : missing ';' before '{' c:\users\admin\documents\visual studio 2008\projects\libpurple\libpurple\core.c 80 LibPurple
    Error 87 error C2065: 'VERSION' : undeclared identifier c:\users\admin\documents\visual studio 2008\projects\libpurple\libpurple\core.c 288 LibPurple

    Please give me some advice.
     
  6. nattsurf123

    nattsurf123 New Member

    Joined:
    Jan 27, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    I read some more about STATIC_PROTO_INIT here:
    pidgin.im\pipermail\devel\2007-August\002624.html

    When I checked my own project files for STATIC_PROTO_INIT I could find only one line:
    Code:
    /* Loads static protocol plugin module initialization functions. */
    #undef STATIC_PROTO_INIT
    
    So did I include the right config.h....
    When I checked the original package after STATIC_PROTO_INIT
    I found the real definition in:
    config.h.mingw
    I was using the config.h.in before. Don't know why they change the name to .in. Crazy :)
    So when I compiled the project I got exactly the same error. Weird. I then moved the definition:
    Code:
    #ifndef STATIC_PROTO_INIT
    #define STATIC_PROTO_INIT static void static_proto_init(void) {  }
    #endif
    
    directly to core.c and I could actually compile a bit longer until I hit this error:
    error C2065: 'VERSION' : undeclared identifier
    I could find a define of VERSION in guess!! config.h.... It is like visual studio still thinks that the old config.h is there. I have deleted config.h. I even removed config.h from the project and reincluded it again just in case there where some caching system.
    What can I do? Please help.
     
  7. nattsurf123

    nattsurf123 New Member

    Joined:
    Jan 27, 2010
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    Please help! Anyone?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice