codeblocks

Dont kown how to fetch database?

守給你的承諾、 提交于 2019-12-20 05:46:06
问题 I'm complete beginner with sqlite and gtk. I'm making my 1st project in code::blocks. I have a problem in fetching the database my code is: #include <stdio.h> #include <stdlib.h> #include <gtk/gtk.h> #include "sqlite3.c" #include <sqlite3.h> static int callback(void *data, int argc, char **argv, char **azColName){ int i; fprintf(stderr, "%s: ", (const char*)data); for(i=0; i<argc; i++){ printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL"); } printf("\n"); return 0; } int main(int

Conio.h not working in codeblocks (Undefined reference to ..)

本小妞迷上赌 提交于 2019-12-20 03:54:08
问题 I'm working with Code::Blocks and the thing is I tried many times to fix the problem with the Conio library and probably some other libraries as well. Every time I use something like clrscr(); textcolor(); or anything it says ; Undefined reference to textcolor. For example, this simple program is supposed to show the sum in a specific color but it's not working out though I have seen it work before. #include <stdio.h> #include <conio.h> int fx(int x,int y,int z) { return x+y+z; } int main() {

Conio.h not working in codeblocks (Undefined reference to ..)

我的未来我决定 提交于 2019-12-20 03:54:07
问题 I'm working with Code::Blocks and the thing is I tried many times to fix the problem with the Conio library and probably some other libraries as well. Every time I use something like clrscr(); textcolor(); or anything it says ; Undefined reference to textcolor. For example, this simple program is supposed to show the sum in a specific color but it's not working out though I have seen it work before. #include <stdio.h> #include <conio.h> int fx(int x,int y,int z) { return x+y+z; } int main() {

Issue linking libxml++ and glib libraries with CodeBlocks IDE for C++ Windows

浪尽此生 提交于 2019-12-20 03:09:09
问题 I am writing a C++ app for Windows using Code Blocks IDE. I am interested in using the following XML++ library: http://libxmlplusplus.sourceforge.net/ It requires libxml2 and glibmm-2.4 libraries. I downloaded the source for each of these libraries and included all of the headers into my project by right clicking on "Build Options" ==> "Search Directories" tab ==> "Compiler" tab. I specified the header include files there. I modified the main.cpp file using the source code from "examples/dom

ubuntu codeblocks :warning: GDB: Failed to set controlling terminal: Operation not permitted

a 夏天 提交于 2019-12-20 01:13:23
问题 ubuntu version: 12.04 code:blocks 10.04 When I debug my program, the IDE output "warning: GDB: Failed to set controlling terminal: Operation not permitted" 来源: https://stackoverflow.com/questions/11841727/ubuntu-codeblocks-warning-gdb-failed-to-set-controlling-terminal-operation-n

CodeBlock opens 2 console windows when executing a prog

你。 提交于 2019-12-19 10:06:23
问题 I have recently installed Code Blocks and I'm using it for C++ programming. I have written a basic Hello World program and when i run the program, 2 console windows are opening instead of 1. If there's only output then the 1st console closes after showing the output and then the 2nd window stays open. My main problem is when I'm trying to take in some input and execute some more stuff. The 1st window works as it should, going to the end of the prog, closes and then the 2nd window again starts

Fixing #includes <> for GCC (Code::Blocks)

拜拜、爱过 提交于 2019-12-19 09:57:43
问题 I am working with some code that was written for a different compiler/linker, and it is including files like this: #include <Engine/Graphics/Sprite.h> from anywhere in the project. The project contains such a file at that path (from the root of the project), but when I build I get the file not found error. How can I fix all of these includes, without going through and doing it all manually? 回答1: I'm not quite sure if I understand your explanation, what do you mean with "from the root of the

Mysql with C++ error: undefined reference to mysql_init

我与影子孤独终老i 提交于 2019-12-19 03:32:25
问题 #include <stdlib.h> #include <mysql.h> #include <my_global.h> int main (int argc, char *argv[]) { MYSQL *conn; MYSQL_RES *res; MYSQL_ROW row; char *server = "127.0.0.1"; char *user = "root"; char *password = "1386"; char *database = "OurDB"; conn = mysql_init(NULL); /* Connect to database */ if (!mysql_real_connect(conn, server,user, password, database, 0, NULL, 0)) { fprintf(stderr, "%s\n", mysql_error(conn)); exit(0); } return 0; } and i get linker error in codeblocks: undefined reference

Code::Blocks with cmake

时光毁灭记忆、已成空白 提交于 2019-12-18 21:19:48
问题 I would like to use the Code::Blocks IDE to build a C++ project based on a CMakeLists.txt file. Previously, I was using Qt Creator, where I could open a CMakeLists.txt file directly, which would create a project. I could then define the build commands, eg. cmake ../src followed by make -j8 . This would run cmake on the CMakeLists.txt file, and then run make on the makefile . How can I do something similar in Code::Blocks? If I try to create a new project, it gives me the option of creating an

Is there any shortcut for CodeBlocks to format the code?

雨燕双飞 提交于 2019-12-18 14:05:18
问题 Is there any shortcut for CodeBlocks to format the code? I haven't find any tip in google. I found only "format use AStyle", but it come up with right mouse button only... 回答1: probably not by default but you should be able to assign it there: Settings -> Editor -> Keyboard shortcuts -> Plugins -> Source code formatter (AStyle) 回答2: My favourite = Ctrl + A then Ctrl + Shift + F . You (these are the default settings I believe) can select a block of code and press the Tab key. This will indent