procesljao sam options i nigde nema Compiler-a.
A imas li ideju zasto iostream ne radi? To je ipak jedna od najcesce koriscenih biblioteka.
Kad kreiram projekat izaberem Empty project, da mozda ne treba nesto drugo?
Dopuna: 16 Jan 2007 19:32
Resio sam problem sa cout.
Stavio sam:
using namespace std;
Ali problem sa ostalim bibliotekama jos nisam.
Nasao sam u project properties Linker ali opet nema opcije da povezem sa nekom bibliotekom ili ja ne znam gde je.
Dopuna: 18 Jan 2007 13:46
Delimicno sam resio problem.
Nasao sam drugu verziju biblioteke koja sadrzi i curl.lib i povezao sam ga u linker-u>command line i u Tools>options>projects>VC++ directories postavio sam direktorijume include files i lib files.
ALI...
sada dobijam drugu gresku i to od moje klase:
- ------ Rebuild All started: Project: crawler2, Configuration: Debug Win32 ------
- Deleting intermediate and output files for project 'crawler2', configuration 'Debug|Win32'
- Compiling...
- glavna2.cpp
- moj_string.cpp
- crClass.cpp
- Generating Code...
- Compiling resources...
- Linking...
- glavna2.obj : error LNK2019: unresolved external symbol "public: enum CURLcode __thiscall crClass::grabPage(char *)" (?grabPage@crClass@@QAE?AW4CURLcode@@ PAD@Z) referenced in function _main
- D:\Rezanje\crawler2\crawler2\Debug\crawler2.exe : fatal error LNK1120: 1 unresolved externals
- Build log was saved at " file://d:\Rezanje\crawler2\crawler2\crawler2\Debug\BuildLog.htm"
- crawler2 - 2 error(s), 0 warning(s)
- ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
evo i klase koja poziva ovu grugu klasu:
- //glavna2.cpp
- #include "crClass.h"
- //#include "moj_string.h"
- #include <curl.h>
- //#include <easy.h>
- #include <iostream>
-
- using namespace std;
-
-
- int main()
- {
- CURLcode nesto;
- crClass obj;
- char *url="http://www.mycity.rs";
- nesto=obj.grabPage(url);
- cout<<nesto;
-
- return 0;
- }
Moja klasa (crClass.h):
- #include "moj_string.h"
- #include <process.h>
- #include "curl.h"
-
- class crClass
- {
- public:
- moj_string str1;
- crClass();
- CURLcode grabPage(char *url);
- ~crClass();
- };
-
- crClass.cpp:
-
- #include <iostream>
- #include "crClass.h"
-
- using namespace std;
-
- crClass::crClass()
- {
-
- }
- crClass::~crClass()
- {
- str1.~moj_string();
- }
- CURLcode grabPage(char *url)
- {
- CURL *curl;
- CURLcode page;
- curl = curl_easy_init();
- curl_easy_setopt(curl, CURLOPT_URL, url);
- page=curl_easy_perform(curl); /* ignores error */
- curl_easy_cleanup(curl);
-
- return page;
- }
Ova druga moja klasa moj_string uopste ne pravi probleme a ova koja poziva cURL pravi.
Mislim da ne prepoznaje tip CURLcode ali ukljucio sam curl.h pa me zbunjuje zasto nece.
|