Sign in to follow this  

HELP... HTTP-GET NOT WORKING!

This topic is 4260 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was told to use HTTP-GET (http://www.mindcontrol.org/~hplus/http-get.html) to access online information, but when I try to compile it crashes! how can I fix this or is there a better library? I'm using Visual C++ toolkit 2003 with Code:Blocks.

Share this post


Link to post
Share on other sites
Its not a crash... I ment error, soz. It just says that some of the libs don't xist and some of the types don't either. i was wondering if there were any dependancies.
What I am trying to do is get a stream back from a PHP master server and feed it back into an XML parser.

Share this post


Link to post
Share on other sites
I knew it was a bit vague, but I was wondering if anyone had the same problem. If not, using a different library would be better, thats what this is mostly about... finding a compatible lib. I've seen libCurl and been told it was good but havn't tried it yet. If it links ok then I'll use it, but if anyone has had problems with the HTTP-GET then I would make the changes and go back to that.

Share this post


Link to post
Share on other sites
Ok ... I've removed the Unix/Linux stuff... the preprocessors aren't filtering them out for some reason.
However I get 3 errors and I think the last two are because of the first:

mynetwork.cpp(215) : error C2146: syntax error : missing ';' before identifier 'addr_'
mynetwork.cpp(215) : error C2501: '`anonymous-namespace'::HTTPQuery::sockaddr_in' : missing storage-class or type specifiers
mynetwork.cpp(215) : error C2501: '`anonymous-namespace'::HTTPQuery::addr_' : missing storage-class or type specifiers

Any suggestions?

Share this post


Link to post
Share on other sites
You should #define WIN32 instead of modifying the headers. I have never used Code::Blocks, but there must be some way to globally define it in the IDE. I got HTTP-GET to work fine (with a change in character set, but I don't think that applies to you).

Otherwise, you could always 'upgrade' to Visual C++ 2005. The Express Edition is still free (if you decide to upgrade, you need to read this as well).


jfl.

Share this post


Link to post
Share on other sites
I defined WIN32 but now I get these unresolved externals

sock_port.obj : error LNK2019: unresolved external symbol __imp__CoCreateInstance@20 referenced in function "long __cdecl `anonymous namespace'::WindowsFirewallInitialize(struct INetFwProfile * *)" (?WindowsFirewallInitialize@?A0xc0f7dc6c@@YAJPAPAUINetFwProfile@@@Z)
sock_port.obj : error LNK2019: unresolved external symbol __imp__SysFreeString@4 referenced in function "long __cdecl `anonymous namespace'::WindowsFirewallAppIsEnabled(struct INetFwProfile *,unsigned short const *,int *)" (?WindowsFirewallAppIsEnabled@?A0xc0f7dc6c@@YAJPAUINetFwProfile@@PBGPAH@Z)
sock_port.obj : error LNK2019: unresolved external symbol __imp__SysStringLen@4 referenced in function "long __cdecl `anonymous namespace'::WindowsFirewallAppIsEnabled(struct INetFwProfile *,unsigned short const *,int *)" (?WindowsFirewallAppIsEnabled@?A0xc0f7dc6c@@YAJPAUINetFwProfile@@PBGPAH@Z)
sock_port.obj : error LNK2019: unresolved external symbol __imp__SysAllocString@4 referenced in function "long __cdecl `anonymous namespace'::WindowsFirewallAppIsEnabled(struct INetFwProfile *,unsigned short const *,int *)" (?WindowsFirewallAppIsEnabled@?A0xc0f7dc6c@@YAJPAUINetFwProfile@@PBGPAH@Z)
sock_port.obj : error LNK2019: unresolved external symbol __imp__CoUninitialize@0 referenced in function "bool __cdecl ENABLE_FIREWALL(void)" (?ENABLE_FIREWALL@@YA_NXZ)
sock_port.obj : error LNK2019: unresolved external symbol __imp__CoInitialize@4 referenced in function "bool __cdecl ENABLE_FIREWALL(void)" (?ENABLE_FIREWALL@@YA_NXZ)

Are there any libs I need? I linked WSock32.lib, what else do I need?

Share this post


Link to post
Share on other sites
I found this:
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ics/ics/using_windows_firewall.asp)
But this looks like source code. Is there a prebuilt version or do I have to use this?

Share this post


Link to post
Share on other sites
It still dosn't work if I compile a .cpp and .h in with the project.
I get hte error:

sock_port.cpp(395) : error C2668: '`anonymous-namespace'::WindowsFirewallAppIsEnabled' : ambiguous call to overloaded function
sock_port.cpp(276): could be 'HRESULT `anonymous-namespace'::WindowsFirewallAppIsEnabled(INetFwProfile *,const wchar_t *,BOOL *)'
c:\SilverNova\WindowsFirewall.h(27): or 'HRESULT WindowsFirewallAppIsEnabled(INetFwProfile *,const wchar_t *,BOOL *)' [found using argument-dependent lookup]
while trying to match the argument list '(INetFwProfile *, const wchar_t *, BOOL *)'
sock_port.cpp(527) : error C2668: '`anonymous-namespace'::WindowsFirewallInitialize' : ambiguous call to overloaded function
sock_port.cpp(210): could be 'HRESULT `anonymous-namespace'::WindowsFirewallInitialize(INetFwProfile ** )'
c:\SilverNova\WindowsFirewall.h(17): or 'HRESULT WindowsFirewallInitialize(INetFwProfile ** )'
while trying to match the argument list '(INetFwProfile ** )'
sock_port.cpp(545) : error C2668: '`anonymous-namespace'::WindowsFirewallAddApp' : ambiguous call to overloaded function
sock_port.cpp(373): could be 'HRESULT `anonymous-namespace'::WindowsFirewallAddApp(INetFwProfile *,const wchar_t *,const wchar_t *)'
c:\SilverNova\WindowsFirewall.h(29): or 'HRESULT WindowsFirewallAddApp(INetFwProfile *,const wchar_t *,const wchar_t *)'
while trying to match the argument list '(INetFwProfile *, wchar_t [512], const unsigned short [26])'
sock_port.cpp(553) : error C2668: '`anonymous-namespace'::WindowsFirewallCleanup' : ambiguous call to overloaded function
sock_port.cpp(267): could be 'void `anonymous-namespace'::WindowsFirewallCleanup(INetFwProfile *)'
c:\SilverNova\WindowsFirewall.h(19): or 'void WindowsFirewallCleanup(INetFwProfile *)'
while trying to match the argument list '(INetFwProfile *)'

It says the arguments are wrong but they look right.

Share this post


Link to post
Share on other sites
Now I get these errors:

sock_port.cpp(396) : error C2668: '`anonymous-namespace'::WindowsFirewallAppIsEnabled' : ambiguous call to overloaded function
sock_port.cpp(277): could be 'HRESULT `anonymous-namespace'::WindowsFirewallAppIsEnabled(INetFwProfile *,const wchar_t *,BOOL *)'
c:\SilverNova\sock_port.h(23): or 'HRESULT WindowsFirewallAppIsEnabled(INetFwProfile *,const wchar_t *,BOOL *)' [found using argument-dependent lookup]
while trying to match the argument list '(INetFwProfile *, const wchar_t *, BOOL *)'
sock_port.cpp(528) : error C2668: '`anonymous-namespace'::WindowsFirewallInitialize' : ambiguous call to overloaded function
sock_port.cpp(211): could be 'HRESULT `anonymous-namespace'::WindowsFirewallInitialize(INetFwProfile ** )'
c:\SilverNova\sock_port.h(21): or 'HRESULT WindowsFirewallInitialize(INetFwProfile ** )'
while trying to match the argument list '(INetFwProfile ** )'
sock_port.cpp(546) : error C2668: '`anonymous-namespace'::WindowsFirewallAddApp' : ambiguous call to overloaded function
sock_port.cpp(374): could be 'HRESULT `anonymous-namespace'::WindowsFirewallAddApp(INetFwProfile *,const wchar_t *,const wchar_t *)'
c:\SilverNova\sock_port.h(24): or 'HRESULT WindowsFirewallAddApp(INetFwProfile *,const wchar_t *,const wchar_t *)'
while trying to match the argument list '(INetFwProfile *, wchar_t [512], const unsigned short [26])'
sock_port.cpp(554) : error C2668: '`anonymous-namespace'::WindowsFirewallCleanup' : ambiguous call to overloaded function
sock_port.cpp(268): could be 'void `anonymous-namespace'::WindowsFirewallCleanup(INetFwProfile *)'
c:\SilverNova\sock_port.h(22): or 'void WindowsFirewallCleanup(INetFwProfile *)'
while trying to match the argument list '(INetFwProfile *)'

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by JPulham
I defined WIN32 but now I get these unresolved externals

sock_port.obj : error LNK2019: unresolved external symbol __imp__CoCreateInstance@20 referenced in function "long __cdecl `anonymous namespace'::WindowsFirewallInitialize(struct INetFwProfile * *)" (?WindowsFirewallInitialize@?A0xc0f7dc6c@@YAJPAPAUINetFwProfile@@@Z)
sock_port.obj : error LNK2019: unresolved external symbol __imp__SysFreeString@4 referenced in function "long __cdecl `anonymous namespace'::WindowsFirewallAppIsEnabled(struct INetFwProfile *,unsigned short const *,int *)" (?WindowsFirewallAppIsEnabled@?A0xc0f7dc6c@@YAJPAUINetFwProfile@@PBGPAH@Z)
sock_port.obj : error LNK2019: unresolved external symbol __imp__SysStringLen@4 referenced in function "long __cdecl `anonymous namespace'::WindowsFirewallAppIsEnabled(struct INetFwProfile *,unsigned short const *,int *)" (?WindowsFirewallAppIsEnabled@?A0xc0f7dc6c@@YAJPAUINetFwProfile@@PBGPAH@Z)
sock_port.obj : error LNK2019: unresolved external symbol __imp__SysAllocString@4 referenced in function "long __cdecl `anonymous namespace'::WindowsFirewallAppIsEnabled(struct INetFwProfile *,unsigned short const *,int *)" (?WindowsFirewallAppIsEnabled@?A0xc0f7dc6c@@YAJPAUINetFwProfile@@PBGPAH@Z)
sock_port.obj : error LNK2019: unresolved external symbol __imp__CoUninitialize@0 referenced in function "bool __cdecl ENABLE_FIREWALL(void)" (?ENABLE_FIREWALL@@YA_NXZ)
sock_port.obj : error LNK2019: unresolved external symbol __imp__CoInitialize@4 referenced in function "bool __cdecl ENABLE_FIREWALL(void)" (?ENABLE_FIREWALL@@YA_NXZ)

Are there any libs I need? I linked WSock32.lib, what else do I need?



"unresolved external symbol"
This kind of error I get when there are .lib files missing from the project lib list....

Share this post


Link to post
Share on other sites

This topic is 4260 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this