missing headers even they are present

Salamo Alikom
when i try a simple program that require headers from /usr/local/include i get error MSGS from compiler :
Code:
curl.c:13:23: error: curl/curl.h: No such file or directory
curl.c:14:24: error: curl/types.h: No such file or directory
curl.c:15:23: error: curl/easy.h: No such file or directory
curl.c: In function 'main':
curl.c:44: error: 'CURL' undeclared (first use in this function)
curl.c:44: error: (Each undeclared identifier is reported only once
curl.c:44: error: for each function it appears in.)
curl.c:44: error: 'curl' undeclared (first use in this function)
curl.c:45: error: 'CURLcode' undeclared (first use in this function)
curl.c:45: error: expected ';' before 'res'
curl.c:51: error: 'CURL_GLOBAL_DEFAULT' undeclared (first use in this function)
curl.c:60: error: 'CURLOPT_URL' undeclared (first use in this function)
curl.c:63: error: 'CURLOPT_WRITEFUNCTION' undeclared (first use in this function)
curl.c:65: error: 'CURLOPT_WRITEDATA' undeclared (first use in this function)
curl.c:68: error: 'CURLOPT_VERBOSE' undeclared (first use in this function)
curl.c:70: error: 'res' undeclared (first use in this function)
curl.c:75: error: 'CURLE_OK' undeclared (first use in this function)
the source is here .
output of :
Code:
ls /usr/local/include/curl | grep curl
is :
Code:
curl.h
curlbuild.h
curlrules.h
curlver.h
 
I don't believe /usr/local/include is in the default search path for the compiler. Try adding -I/usr/local/include to your CFLAGS.
 
i add this to make.conf :
Code:
CFLAGS="-I/usr/local/include"
both with or without double quote but some problem .
 
Add the -l on the cc commandline. The options in /etc/make.conf are only used when you use the (fbsd) make command.
 
mr SirDice
i am trying to build VirtualBox from source not the ports ,how can i do that ?
 
build it from fail and install from packages give me this when i start VirtualBox :
Code:
VirtualBox: supR3HardenedMainGetTrustedMain: dlopen("/usr/local/lib/virtualbox/VirtualBox.so",) 
failed: /usr/local/lib/virtualbox/VBoxXPCOM.so: Undefined symbol "shmctl"
 
I think the OP is trying to build from source because the port/package version isn't working for him.

SIFE, that shmctl error message looks like it's related to shared memory. Are you running a custom kernel? Do you have SYSVSHM, SYSVMSG, and SYSVSEM options compiled in?
 
SIFE said:
Salamo Alikom
when i try a simple program that require headers from /usr/local/include i get error MSGS from compiler : ...

When you are compiling/linking C/C++ source and you are using 3rd party libs you should use pkg-config to generate needed flags for GCC.

For example in your case:
Code:
gcc `pkg-config --libs --cflags libcurl` ftpget.c -o ftpget
 
@Mr aragon
no i did not ,but when i buildworld for FreeBSD 8.0-RC3 VirtualBox work well exept the module vboxdrv does not load , buildworld fail in 8.0-RC 3.
@Mr expl
i did what you say and it is work fine but can i make gcc search automaticly for 3rd party lib like Mr gordon@ said .
 
you can:
1) if you use gcc by hand you can simply make alias for gcc
2) write small wrapper script that will call gcc with custom args... and then use that script
3) probably many other methods I didn't think of
 
SIFE said:
@Mr expl
i did what you say and it is work fine but can i make gcc search automaticly for 3rd party lib like Mr gordon@ said .

No you can not, you need to use tools like autoconf+automake or something more modern like scons to be able to build your larger pieces of source dynamically.
 
Back
Top