Find the answer to your Linux question:
Results 1 to 4 of 4
I'm trying to compile & run this test code : http: //curl.haxx dot se/mail/lib-2010-07/0249.html It should work but when I do PHP Code:  gcc test . c  - o test . o  ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! SingleFemaleLawyer's Avatar
    Join Date
    Jul 2010
    Posts
    28

    Out of scope .. random ? [solved]


    I'm trying to compile & run this test code :

    http: //curl.haxx dot se/mail/lib-2010-07/0249.html

    It should work but when I do

    PHP Code:
     gcc test.-o test.
    I get

    PHP Code:
    test.cIn function 'int main(int, char**)':
    test.c:39error'CURLOPT_RTSP_STREAM_URI' was not declared in this scope
    test
    .c:42error'CURLOPT_INTERLEAVEFUNCTION' was not declared in this scope
    test
    .c:43error'CURLOPT_INTERLEAVEDATA' was not declared in this scope
    test
    .c:47error'CURLOPT_RTSP_REQUEST' was not declared in this scope
    test
    .c:47error'CURL_RTSPREQ_OPTIONS' was not declared in this scope
    test
    .c:59error'CURLOPT_RTSPHEADER' was not declared in this scope
    test
    .c:60error'CURL_RTSPREQ_DESCRIBE' was not declared in this scope
    test
    .c:73error'CURLOPT_RTSP_TRANSPORT' was not declared in this scope
    test
    .c:74error'CURL_RTSPREQ_SETUP' was not declared in this scope
    test
    .c:86error'CURL_RTSPREQ_PLAY' was not declared in this scope
    test
    .c:109error'CURL_RTSPREQ_TEARDOWN' was not declared in this scope 
    I can't see why it doesn't work I'm quite new to c/c++ programming. It only happens when calling some functions and not with others ... I guess it is something very simple and basic but I have no clue

    Any help is truly appreciated. Thansk in advance

    Jessica
    Last edited by SingleFemaleLawyer; 08-04-2010 at 06:40 AM. Reason: solved :)

  2. #2
    Just Joined!
    Join Date
    Jul 2010
    Location
    Zagreb, Croatia
    Posts
    9
    hello,

    you forget to link it with curl lib

    Code:
     gcc test.c -o test.o  -lcurl

  3. #3
    Just Joined! SingleFemaleLawyer's Avatar
    Join Date
    Jul 2010
    Posts
    28
    Hi, thank you for your reply. I already did that linking and it happens the same thing when I run

    PHP Code:
    gcc test.-o test.o  -lcurl 
    that's why I think it is so odd, because even when linking the lib happens that

  4. #4
    Just Joined! SingleFemaleLawyer's Avatar
    Join Date
    Jul 2010
    Posts
    28
    I just found out by chance. The curl version installed was a previous one so the changes introduced in the new version made some of the functions there unavailable because they didn't exist

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •