Raised This Month: $ Target: $400
 0% 

Compiling with libcurl


Post New Thread Reply   
 
Thread Tools Display Modes
Antartika
Junior Member
Join Date: Jun 2006
Old 07-01-2006 , 02:24   Re: Compiling with libcurl
Reply With Quote #11

It's strange, when I put my libcurl.lib, it linked but it required the .dll but it doesn't build with your curllib.lib, whereas there is the same code of my test...

I am still studing it ;)
Antartika is offline
Antartika
Junior Member
Join Date: Jun 2006
Old 07-01-2006 , 05:38   Re: Compiling with libcurl
Reply With Quote #12

Ok I have build it using an extern code C.
Code:
#ifdef __cplusplus
extern "C" {
#endif

int dl_fic(char *fichier,char *url);

#ifdef __cplusplus
}
#endif
And curl is used in dl_fic.


But when I launch my server with the plugin I have a runtime error as it show in the screen.

>_<

Note: Here the msdn related error: http://msdn2.microsoft.com/en-us/library/9ecfyw6c.aspx
Attached Thumbnails
Click image for larger version

Name:	runtimeerror.JPG
Views:	382
Size:	44.7 KB
ID:	8619  

Last edited by Antartika; 07-01-2006 at 06:09.
Antartika is offline
Antartika
Junior Member
Join Date: Jun 2006
Old 07-02-2006 , 11:18   Re: Compiling with libcurl
Reply With Quote #13

I have found that the error occur at the fopen call, but I don't know how repair it...
Antartika is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 07-02-2006 , 14:11   Re: Compiling with libcurl
Reply With Quote #14

Can you give me the full source? If you don't want to post it, PM me and I'll give you my email address.
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Antartika
Junior Member
Join Date: Jun 2006
Old 07-04-2006 , 07:10   Re: Compiling with libcurl
Reply With Quote #15

Sorry for the late. I was subscribed to the thread but I haven't received mail...


Here my source: http://s143458060.onlinehome.fr/nico...ugin_smaple.7z
Note that if I juste use fopen in serverplugin_sample without any other modification, I have the same problem...
Antartika is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 07-04-2006 , 14:21   Re: Compiling with libcurl
Reply With Quote #16

Why did you use extern C in the first place? It should not be needed, and I'm fairly certain it's causing the problems.

The compiler is seeing everything in that function as C code, rather the C++.. since MS's C library needs extra initalization, which it is not getting.

Get rid of the extern C, and try again. It's been so long since I've compiled a non-sourcemm plugin, I've forgotten how (You should really consider using sourcemm instead.. it's pretty simple to get started with)
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Antartika
Junior Member
Join Date: Jun 2006
Old 07-04-2006 , 14:32   Re: Compiling with libcurl
Reply With Quote #17

No, I have try using C++ to. (I have just retry ;) )
This isn't the problem.

I will study sourcemm but it forced to install sourcemm in servers...
Antartika is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 07-05-2006 , 09:22   Re: Compiling with libcurl
Reply With Quote #18

From the looks of it, you were writing a plugin to pull a banlist from a web server.. if you do decide to use sourcemm, you can probably use the global banlist plugin, if you are willing to rewrite whatever script is generating that config file for you. If you want to do it this way, and need help with what the plugin expects when it gets updates, let me know.
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Antartika
Junior Member
Join Date: Jun 2006
Old 07-05-2006 , 09:28   Re: Compiling with libcurl
Reply With Quote #19

It's not only download banlist that I want.
I want download wars configs too and maybe make the restart etc...

But the problem is only that I can't use fopen

Thanks for your help
Antartika is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 07-05-2006 , 10:25   Re: Compiling with libcurl
Reply With Quote #20

You will also find that you need to do all the downloads in a seperate thread.. or don't use libcurl's EASY interface. Your server will lag while all the config files are downloaded.. no problem if noone is connected.
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:08.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode