-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 I'm using mysql in a program. Here is a snipped of my Makefile.am:
project_LDADD += -lboost_thread project_LDADD += -lboost_regex project_LDADD += -lboost_system AM_LDFLAGS = -L/usr/local/lib AM_LDFLAGS += `mysql_config --libs_r` AM_LDFLAGS += `mysql_config --include` AM_LDFLAGS += -std=c++0x AM_LDFLAGS += `mysql_config --cflags` When I compile the program, automake generated: g++ -g -O2 -L/usr/local/lib `mysql_config --libs_r` `mysql_config --include` -std=c++0x `mysql_config --cflags` -o /[ ... a bunch of .o files ... ]/ -lboost_thread -lboost_regex -lboost_system As expected, since g++ needs linker flags at the end I get a bunch of compile errors saying the `mysql_*` functions don't exist. How do I specify for the linker flags to go at the end? I tried to put them in the project_LDADD macro but automake complained: Makefile.am:13: linker flags such as `--libs_r`' belong in `project_LDFLAGS Which got me back to square one. I must be doing something wrong. Any ideas? This has been bugging me for days. Thanks in advance. -----BEGIN PGP SIGNATURE----- iQEcBAEBCgAGBQJRnVjTAAoJEOT99oqiSuRNm48H/RpaLD1GeYHlUD1hN6W+A4QL +OdF4s2gDECVaw5N+ETnAHrO5Y1hdrmcUMdyMgNUJIFkJTF6qny7OFkMs44V6QS6 oeJbdxKxpcPyJxoR/LniLYmQXFMcFmvcYAwh1HNkJ6IamJs+2H3nTL13St1xdDIq HUnaTI0NGMjgPGoBRJKrnpbwaM4h1ggWSjF0MI+/9SdN3lQOohq7oK9QkHCxq8py umK65ItaQ50kKCcUluJXKDHG7hvJ0gKZzZI6neyCcXILwZLFZX2RNHrZhUbu35Ws qnC16nTWcTGwpoC9FaefmFGQXxHW+cHF1aYy0d2Qtt4xm9qHIyTVHSvVw9ehsXw= =z7r8 -----END PGP SIGNATURE-----