Most likely /usr/local/include will be on the include path for your g++
by default, so:
It is.

... so how did you know that?

When booting my FreeBSD box, I saw that path and the words "include path" and "g++", so it was a guess. And a faulty one, my appologies.


I'm just a little curious why I have to use the -I option when the
files are in a standard path?

You shouldn't have to. Perhaps you could post your *exact* compile command, without -I options, but with -v, and the *complete* output.

g++ -o test1 test1.cpp -L/usr/local/lib/mysql/ -lmysql -v

Using built-in specs.
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 3.4.6 [FreeBSD] 20060305
/usr/libexec/cc1plus -quiet -v -D_LONGLONG test1.cpp -quiet -dumpbase test1.cpp -auxbase test1 -version -o /var/tmp//ccdyq51U.s
ignoring duplicate directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/3.4
 /usr/include/c++/3.4/backward
 /usr/include
End of search list.
GNU C++ version 3.4.6 [FreeBSD] 20060305 (i386-undermydesk-freebsd)
        compiled by GNU C version 3.4.6 [FreeBSD] 20060305.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
test1.cpp:2:47: mysql/mysql.h: No such file or directory
test1.cpp: In function `int main()':
test1.cpp:5: error: `MYSQL' was not declared in this scope
test1.cpp:5: error: expected `;' before "mysql"
test1.cpp:7: error: `mysql' was not declared in this scope
test1.cpp:7: error: `mysql_init' was not declared in this scope
test1.cpp:9: error: `mysql_real_connect' was not declared in this scope
test1.cpp:11: error: `mysql_error' was not declared in this scope

Which explains a lot. But I'm pretty sure I get a message when I boot the FreeBSD box about the /usr/local/include path. But it is in the white text, so I can't see it using dmesg. (Hope that makes sense, I'm still pretty new on FreeBSD as well).

So I beleive I have the answer for the mystery. Thank you very much for your patience :-)

Best regards
Stefan

_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to