开发者

Stuck with twitcurl

开发者 https://www.devze.com 2023-04-09 12:17 出处:网络
this question has gone back and forth a bit as I have learnt some things about g++ about unix systems (sorry if I messed anyone about).

this question has gone back and forth a bit as I have learnt some things about g++ about unix systems (sorry if I messed anyone about).

For a project I am currently trying to finish I would like to get twitcurl running with Xcode and OpenFrameworks. If anyone has managed to do this please share with me this arcane feat.

Below is some of the things I am stuck on:

Regurgitating some of the instructions from their wiki it says to

  • download the libraries source
  • build twitcurl library using visual C++ or make (their is also cmake in their).
  • Include twitcurl.h and curl headers in your twitter application and link to twitcurl.lib and libcurl.lib/libcurl.dll.

This seems simple enough but when I make the library, there is no twitcurl.lib. A different file libtwit.a is produced, which I assume must be what OSX needs (as installing puts it in usr/local/ along with the headers). However then if I try to include the twitcurl.h in a header and开发者_JAVA百科 make a twitCurl object I then get more undefined symbols

Undefined symbols for architecture i386:
"twitCurl::~twitCurl()", referenced from:
  testApp::setup()     in testApp.o
"twitCurl::twitCurl()", referenced from:
  testApp::setup()     in testApp.o
ld: symbol(s) not found for architecture i386

I now am assuming twitcurl makes for a 64bit (I have tried adding CFLAGS=-m32, but it fails), and to my knowledge Openframeworks is only 32 bit currently. This means twitcurl may not be an option for me, but again, if anyone knows how please let me know!

Thanks in advance.


You'd probably do well to recompile twitcurl, last I looked (3 months ago), it was compiled with VC6, which has its own way of mangling C++ symbols, so the lib won't link correctly for g++.

you could then just import it directly as well and then not need to worry about linking to the libs, however it would be a good idea to test in a small demo app, before integrating into an already build system, that way you know if the error is on your side or somewhere else.

Also, when it comes to this type of problem, the exact compiler errors are more helpful than just describing the problem.


The error message you've posted is the linker's longwinded way of telling you that its looking for a definition of the curl_easy_setopt function, which is part of libcurl. Adding -lcurl to your g++ line should fix this (by telling the linker to link in libcurl).

However, twitcurl comes with a Makefile, which already does this. In addition, if you are trying to build a shared library there, you're doing it wrong...


Maybe you can try ofxTwitter, an openFrameworks addon for twitter, to get your twitter functionality. get it here: http://forum.openframeworks.cc/index.php/topic,2750.0.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号