Answer the question
In order to leave comments, you need to log in
Compiling a Project in NetBeans
Hello!
I want to build a MySQL-enabled C project using NetBeans:
gcc -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -ldl -c -g -I. -o build/Debug/GNU-Linux-x86/main.o main.c
gcc -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -ldl -o dist/Debug/GNU-Linux-x86/actualizer build/Debug/GNU-Linux-x86/main.o
build/Debug/GNU-Linux-x86/main.o: In function `main':
/home/rmk/C/actualizer/main.c:17: undefined reference to `mysql_get_client_info'
collect2: выполнение ld завершилось с кодом возврата 1
make[2]: *** [dist/Debug/GNU-Linux-x86/actualizer] Ошибка 1
make[2]: Выход из каталога `/home/rmk/C/actualizer'
make[1]: *** [.build-conf] Ошибка 2
make[1]: Выход из каталога `/home/rmk/C/actualizer'
make: *** [.build-impl] Ошибка 2
gcc -o build/Debug/GNU-Linux-x86/main.o main.c -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -ldl -c -g -I.
gcc -o dist/Debug/GNU-Linux-x86/actualizer build/Debug/GNU-Linux-x86/main.o -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -ldl
Answer the question
In order to leave comments, you need to log in
Solved a problem.
The point is that NetBeans has a specific way of adding compilation options. It is described in more detail here:
http://forums.netbeans.org/topic44500.html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question