I wrote a C library that utilizes the libcurl library to interact with a REST API. I wrote this on a debian based system, but am now attempting to use it on an Arduino, which runs an OpenWRT distribution. When trying to use it, I noticed there was an issue when the compiler attempts to use the libcurl library, so I wrote a super simple program to test it.
#include <curl/curl.h>
void main() {
CURL *curl;
}
I then compiled it like so...
gcc -lcurl test.c -o test
and got back the following.
test.c: In function 'main':
test.c:4:2: error: unknown type name 'CURL'
libcurl was already installed on the device.
Package libcurl (7.29.0-1) installed in root is up to date.
Here's what displays when I run opkg files libcurl
Package libcurl (7.29.0-1) is installed on root and has the following files:
/usr/lib/libcurl.so.4
/usr/lib/libcurl.so.4.3.0
Having the hardest time trying to figure out what the problem is. This link was the only thing I found remotely close to being similar to my problem, but the solutions didn't work for me. Does anyone have any suggestions?
Thanks.
EDIT: So I think I found some more information about the problem. I think I'm missing a lot of the libcurl development packages as well because I looked at the opkg.conf file and saw that the only package list was the following.
http://downloads.arduino.cc/openwrtyun/1/packages
Maybe I need to find an OpenWRT package list having the extra libcurl packages I need? I can't seem to find them though.
So I was able to solve my problem, but I guess not "properly".
Apparently, the OpenWRT distribution I'm running uses a completely different libcurl library, and when I tried to uninstall it, the opkg package manager warned me that because it too also utilizes the currently installed libcurl library, it might break if I remove it.
Therefore, I manually installed the version of libcurl I needed from Github, and then made the proper references in my code to use this other version instead.
Thanks everyone for helping me get in the right direction.
Related
I have configured and compiled the FFmpeg library using this link:
https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
Now, I am trying to build example C codes provided by FFmpeg from here:
https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples
However, when I run make install-examples or make install (suggested by /example/README), I receive this kind of message:
make: *** No rule to make target '/doc/examples/README', needed by
'install-examples'. Stop.
I thought this may be due to the rules not being in the correct MakeFile format (I am not sure why they refers to README). How should I go about in fixing this and compiling the example codes? I have tried to find solutions about this, but there doesn't seem to be much information online.
Thank you.
Run ./configure && make -j4 examples in the FFmpeg source directory, then look in doc/examples for the compiled examples.
Requires make and pkg-config.
To remove the compiled examples use make examplesclean in the FFmpeg source directory.
nasm/yasm not found or too old. Use --disable-x86asm for a crippled build. If you think to configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to theffmpeg-user#ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.Include the log file "ffbuild/config.log" produced by configure as this will help solve the problem.
If you see this when you execute the above command then do this
macOS:
brew install yasm
Ubuntu:
sudo apt-get install yasm
INTRODUCTION
Hi everyone, I'm making a project in Raspbian (Raspberry Pi3) using the async streaming feature of the libFTDI library.I first tried to build one of their examples that scans all the ftdi devices inside the Build directory following this guide using cmake and I run perfectly ./find_all getting all the FTDI devices, and that's good.
So I wanted to build a custom libFTDI project in another directory by my own and to compile it by the only compiler tool I know: Gnu C Compiler.
PROBLEM
Well, the compiler shows me no errors when I tried to compile out of the Build directory using a code of mine which has an #include libftdi with gcc -lusb -lftdi AND ./find_all gave me back that there's no device found at all.At this point I toke exactly the same piece of code inside 'find_all.c AND ./find_all STILL gave me back that there's no device found at allObviously before I ran gcc I installed all the libFTDI dependencies via apt-get install, to be more specific:
build-essential
git-core
cmake
doxygen
libusb
libconfude-dev
swig
python-dev
libboost-all-dev
QUESTION
Can anyone help me finding out what's wrong in it?I'd really like to use this wonderful library. I state that I'm a newbie in cmake stuff therefore I guess that even if I'm making a custom project (and not an example) using libFTDI most probably I also have to cmake. I should be grateful if someone explained to me how to cmake/build/gcc this library everywhere I want.
Thanks for the attention payed.
I am using Mac OS X 10.8 with Xcode. I have installed the jansson library, with the following commands:
./configure
make
make check
sudo make install
Everything went fine and the library installed correctly. I have created a smple .c file with a text editor and tried to include the <jansson.h> file. I builded everything and it gave no errors, meaning that the library is installed on my system.
Now, Xcode doesn't find the library at all, saying that <jansson.h> is not found. I have tried to restart my Mac, but nothing happens. If anyone knows a possible solution, I will be grateful. Thanks!
I resolved the issue, by going under Build phases, and searching for HEADER_SEARCH_PATH. Then I changed the search path label with /usr/local/include, where the library was installed.
I'm trying to install a geocoder for a website I'm building. I'm using Geocoder because the query limit for the Google Maps API falls short of my needs. I installed all the gems required and have SQLite3. When I'm actually trying to install the geocoder gem (Geocoder::US) I get an error while running the make file.
I'm getting an error I cannot figure out. It mentions the error (in the title) then talks of an non-existent file (sqlite3ext.h). Here is the error:
I know this is vague but I've been working for 10+ hours trying to install this and have found little help online. Any advice on which direction to go would be appreciated.
This is from the project's Readme:
To build Geocoder::US, you will need gcc/g++, make, bash or equivalent,
the standard *NIX ‘unzip’ utility, and the SQLite 3 executable and
development files installed on your system.
It seems that you lack the SQLite3 development headers.
This is relevant:
NOTE: If you do not have /usr/include/sqlite3ext.h installed, then
your sqlite3 binaries are probably not configured to support dynamic
extension loading. If not, you must compile and install SQLite from
source, or rebuild your system packages. This is not believed to be a
problem on Debian/Ubuntu, but is known to be a problem with Red
Hat/CentOS.
Also they do not mention Windows. You should:
Ask them if someone uses it on Windows and if there are instructions for that.
Evaluate the thing on Linux, Debian/Ubuntu especially.
-fPiC is not your problem. As the log states, the compiled code is already position independent. The problem is, that the sqllite3ext.h is not in the compiler include path.
I am trying to get memcached running on Windows. I have downloaded memcached stable latest and compiled it using Mingw under Windows 7. Configure failed with error,
checking for libevent directory... configure: error: libevent is
required. You can get it from http://www.monkey.org/~provos/libevent/
If it's already installed, specify its path using --with-libevent=/dir/
Then I downloaded libevent and compiled it. This produced 3 DLLs, libeventcore, libevent-extra and libevent-2.0.5.
I ran configure on memcached again with the option --with-libevent. But for some reason, it fails again with the same error. I have no clue on why it is failing. Can anyone help me to resolve this issue? Or is there a better way to get memcached running on Windows? I have seen lot of pre-built binaries for Windows. But all of them uses old versions of memcached. And AFAIK, Windows is officially supported by memcached in the newer versions.
I am using Windows7 64bit version with MinGW.
After you run make in libevent dir you get the files ready, but to make full use of it, they must be installed. So make install step is needed. If you configured it with a prefix, it will land in the directory of your choice. Otherwise it is /usr/local.
So maybe it's enough to run make install in libevent dir and run configure from memcache without parameters.
If you still have problems passing the configure stage, look at config.log. It shows the source file and the gcc command on which it failed.
Unfortunately successful configure is not everything. Later it fails on inclusion of sys/socket.h, netinet/in.h and netdb.h and perhaps also -pthread gcc parameter. I'm afraid it won't compile on mingw. At least not without a serious porting effort.
As I know, Never had an official Memcached port for Windows (Yes, there were few individual efforts. Last knowing porting effort can find on version 1.2.6 here) Best known Implementation for Memcached for windows on Couchbase with Memcached Bucket.
Late to the party I realize but the answer is to use:
$ export LIBS=-lws2_32
which will place $LIBS at the end of compile calls so that it is linked to libws2_32.a or winsocks2, but this probably means that your did not configure your build correctly and you will subsequent errors such as #include <sys/socket.h> header not found, etc.
see mingw-linker-error-winsock