• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

C/C++ c/c++ libraries in FreeBSD

fureda

New Member

Thanks: 1
Messages: 3

#1
Hi,
I am new in the FreeBSD world and I have simple questions to setup my developer environment. I am a C++ developer and I come from GNU/Linux -> Debian.

So, mostly I used in my projects the shared libraries from the system. Example: when I want to use curl, I install curl like apt get libcurl-dev.

But how install this in FreeBSD??
For curl (without header files) I used the package manager ( pkg install curl)

david
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,471
Messages: 25,628

#2
The needed libraries and include files are contained within the ftp/curl package:
Code:
% pkg info -l curl
curl-7.57.0:
        /usr/local/bin/curl
        /usr/local/bin/curl-config
        [b]/usr/local/include/curl/curl.h
        /usr/local/include/curl/curlver.h
        /usr/local/include/curl/easy.h
        /usr/local/include/curl/mprintf.h
        /usr/local/include/curl/multi.h
        /usr/local/include/curl/stdcheaders.h
        /usr/local/include/curl/system.h
        /usr/local/include/curl/typecheck-gcc.h
        /usr/local/lib/libcurl.a
        /usr/local/lib/libcurl.so
        /usr/local/lib/libcurl.so.4
        /usr/local/lib/libcurl.so.4.5.0
        /usr/local/libdata/pkgconfig/libcurl.pc[/b]
        /usr/local/man/man1/curl-config.1.gz
        /usr/local/man/man1/curl.1.gz
<snip>
        /usr/local/share/licenses/curl-7.57.0/MIT
        /usr/local/share/licenses/curl-7.57.0/catalog.mk
        /usr/local/share/zsh/site-functions/_curl
 

fureda

New Member

Thanks: 1
Messages: 3

#3
Hi,
i checked the package and all is there but the Linker sad:

"/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 --hash-style=both --enable-new-dtags -o test /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib /tmp/iptick-ae15eb.o -lcurl -lc++ -lm -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o
/usr/bin/ld: cannot find -lcurl
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1


What did wrong?



FYI

root@orangejuice:~/iptick # pkg info -l curl | head -n 50
curl-7.57.0:
/usr/local/bin/curl
/usr/local/bin/curl-config
/usr/local/include/curl/curl.h
/usr/local/include/curl/curlver.h
/usr/local/include/curl/easy.h
/usr/local/include/curl/mprintf.h
/usr/local/include/curl/multi.h
/usr/local/include/curl/stdcheaders.h
/usr/local/include/curl/system.h
/usr/local/include/curl/typecheck-gcc.h
/usr/local/lib/libcurl.a
/usr/local/lib/libcurl.so
/usr/local/lib/libcurl.so.4
/usr/local/lib/libcurl.so.4.5.0
/usr/local/libdata/pkgconfig/libcurl.pc
/usr/local/man/man1/curl-config.1.gz
/usr/local/man/man1/curl.1.gz
/usr/local/man/man3/CURLINFO_ACTIVESOCKET.3.gz

 

fureda

New Member

Thanks: 1
Messages: 3

#4
Thanks,
there was a missing/useless variable in the Makefile. I dont know why is works under debian........
Vielen Dank/ Thanks for all
and a nice weekend
david