Web Programming with C++

Is it possible to do ? If it's possible how ?
You can use some type of SOAP tool kit to consume web services ......
closed account (N85iE3v7)
Yes, you can use C/C++ to create CGI scripts. There are also a few libraries that make it easy to program in C/CGI. Check this book:

http://bookboon.com/int/student/it/c-programming-in-linux

It is free , like any Bookboon book, but there are a few advertisements.

The big drawnback with C/CGI is that doing the layout for XHTML pages is really a pain, but you can split your systems by having frontend pages written in .NET and C++ in the background.
I would consider the biggest drawback being that most web hosting packages will not let you run executable CGIs. Scripts, such as Perl and PHP dominate.
Google Native Client allows to run C programs directly on the client browser
I should explain what i want. Consider a c++ project and in this project lets say I want to use php. Let me give an example. I want to show my twitters last post in a program.
So you want to write a program in C++ that accesses a web-service written in PHP? Is that't what you are saying?
You might want to look at CURL for accessing web-resources using C++:

libcurl:
http://curl.haxx.se/

C++ wrapper:
http://curlpp.org/
So you want to write a program in C++ that accesses a web-service written in PHP? Is that't what you are saying?


php asp doesnt matter
Then CURL is probably a good option for you.
1>------ Build started: Project: 123, Configuration: Debug Win32 ------
1>Linking...
1>example02.obj : error LNK2019: unresolved external symbol "public: void __thiscall curlpp::easy::perform(void)" (?perform@easy@curlpp@@QAEXXZ) referenced in function _main
1>example02.obj : error LNK2019: unresolved external symbol "public: void __thiscall curlpp::easy::verbose(bool)" (?verbose@easy@curlpp@@QAEX_N@Z) referenced in function _main
1>example02.obj : error LNK2019: unresolved external symbol "public: void __thiscall curlpp::easy::upload(bool)" (?upload@easy@curlpp@@QAEX_N@Z) referenced in function _main
1>example02.obj : error LNK2019: unresolved external symbol "public: void __thiscall curlpp::easy::infile_size(long)" (?infile_size@easy@curlpp@@QAEXJ@Z) referenced in function _main
1>example02.obj : error LNK2019: unresolved external symbol "public: void __thiscall curlpp::http_easy::http_header(class std::list<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > const &)" (?http_header@http_easy@curlpp@@QAEXABV?$list@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@@Z) referenced in function _main
1>example02.obj : error LNK2019: unresolved external symbol "public: void __thiscall curlpp::easy::url(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?url@easy@curlpp@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main
1>example02.obj : error LNK2019: unresolved external symbol "public: __thiscall curlpp::http_easy::http_easy(void)" (??0http_easy@curlpp@@QAE@XZ) referenced in function _main
1>example02.obj : error LNK2019: unresolved external symbol "void __cdecl curlpp::initialize(long)" (?initialize@curlpp@@YAXJ@Z) referenced in function _main
1>example02.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall curlpp::istream_trait::read(void *,unsigned int)" (?read@istream_trait@curlpp@@UAEIPAXI@Z)
1>example02.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall curlpp::easy::~easy(void)" (??1easy@curlpp@@UAE@XZ) referenced in function "public: virtual __thiscall curlpp::http_easy::~http_easy(void)" (??1http_easy@curlpp@@UAE@XZ)
1>example02.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall curlpp::output_progress_trait::progress_function(double,double,double,double)" (?progress_function@output_progress_trait@curlpp@@UAE_NNNNN@Z)
1>example02.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall curlpp::input_passwd_trait::passwd_function(char *,char *,int)" (?passwd_function@input_passwd_trait@curlpp@@UAE_NPAD0H@Z)
1>example02.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall curlpp::output_debug_trait::debug_function(enum curlpp::debug::type,char *,int)" (?debug_function@output_debug_trait@curlpp@@UAEXW4type@debug@2@PADH@Z)
1>example02.obj : error LNK2019: unresolved external symbol "public: __thiscall curlpp::ifile_trait::ifile_trait(struct _iobuf *)" (??0ifile_trait@curlpp@@QAE@PAU_iobuf@@@Z) referenced in function "void __cdecl curlpp::`dynamic initializer for 'stdin_trait''(void)" (??__Estdin_trait@curlpp@@YAXXZ)
1>example02.obj : error LNK2019: unresolved external symbol "public: __thiscall curlpp::ofile_trait::ofile_trait(struct _iobuf *)" (??0ofile_trait@curlpp@@QAE@PAU_iobuf@@@Z) referenced in function "void __cdecl curlpp::`dynamic initializer for 'stdout_trait''(void)" (??__Estdout_trait@curlpp@@YAXXZ)
1>example02.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall curlpp::file_trait::~file_trait(void)" (??1file_trait@curlpp@@UAE@XZ) referenced in function "public: virtual __thiscall curlpp::ifile_trait::~ifile_trait(void)" (??1ifile_trait@curlpp@@UAE@XZ)
1>F:\Documents and Settings\Morph\My Documents\Visual Studio 2008\Projects\123\Debug\123.exe : fatal error LNK1120: 16 unresolved externals
1>Build log was saved at "file://f:\Documents and Settings\Morph\My Documents\Visual Studio 2008\Projects\123\123\Debug\BuildLog.htm"
1>123 - 17 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


why is it failed. I did directories like this

http://img265.imageshack.us/img265/3918/99460849.png

I only did this are there any necessary things to do
You need to linker to the library
Is that eclipse? You need to add the libraries to the build:

Project->Properties->C++ Buils->Settings->Tool Settings->GCC C++ Linker

Then add your library names to the Libraries window. These are probably curl and curlpp
Last edited on
It's visual studio 2008 I did the same thing in the image to linker but it didint work. Are there any documents for visual studio
Last edited on
any answers
The documents are called the help/documentation and Google. Search for "visual studio 2008 link libraries".
Topic archived. No new replies allowed.