Curl doesn't work for some reason.

Hello

I'm trying to get the source from a website using Curl.
But for some reason, the code ain't working.

This is my code:
1
2
3
4
5
6
7
8
9
   curl_global_init( CURL_GLOBAL_ALL );
CURL * myHandle;
CURLcode curl_result; // We’ll store the result of CURL’s webpage retrieval, for simple error checking.
myHandle = curl_easy_init ( ) ;
// Notice the lack of major error checking, for brevity
curl_easy_setopt(myHandle, CURLOPT_URL, "http://google.com");
curl_result = curl_easy_perform( myHandle );
curl_easy_cleanup( myHandle );


This is my error:

wordGenerator: In function `_start':
(.text+0x0): multiple definition of `_start'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/gcrt1.o:(.text+0x0): first defined here
wordGenerator: In function `_fini':
(.fini+0x0): multiple definition of `_fini'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o:(.fini+0x0): first defined here
wordGenerator:(.rodata+0x0): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/gcrt1.o:(.rodata.cst4+0x0): first defined here
wordGenerator: In function `data_start':
(.data+0x0): multiple definition of `__data_start'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/gcrt1.o:(.data+0x0): first defined here
wordGenerator: In function `data_start':
(.data+0x8): multiple definition of `__dso_handle'
/usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o:(.data+0x0): first defined here
wordGenerator: In function `_init':
(.init+0x0): multiple definition of `_init'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o:(.init+0x0): first defined here
/tmp/cc1XBpqE.o: In function `help()':
wordGenerator.cpp:(.text+0x0): multiple definition of `help()'
wordGenerator:(.text+0xed): first defined here
/tmp/cc1XBpqE.o: In function `troubleshooting()':
wordGenerator.cpp:(.text+0x1af): multiple definition of `troubleshooting()'
wordGenerator:(.text+0x297): first defined here
/tmp/cc1XBpqE.o: In function `about()':
wordGenerator.cpp:(.text+0x35e): multiple definition of `about()'
wordGenerator:(.text+0x441): first defined here
/tmp/cc1XBpqE.o: In function `language()':
wordGenerator.cpp:(.text+0x449): multiple definition of `language()'
wordGenerator:(.text+0x527): first defined here
/tmp/cc1XBpqE.o: In function `main':
wordGenerator.cpp:(.text+0x74d): multiple definition of `main'
wordGenerator:(.text+0x800): first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.8/crtend.o:(.tm_clone_table+0x0): multiple definition of `__TMC_END__'
wordGenerator:(.data+0x10): first defined here
/usr/bin/ld: error in wordGenerator(.eh_frame); no .eh_frame_hdr table will be created.
collect2: error: ld returned 1 exit status



This error only appears when I put a string into the easy_setopt function.
Can someone explain why it ain't working?

Thanks for reading,
Niely
Someone able to help me? :)
Topic archived. No new replies allowed.