Thread: [Dev-C++] Re: 10 quick questions
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <ech...@ne...> - 2002-04-05 19:26:18
|
It looks like you need gtk+ and pw32 (a posix emulation layer) You can find them at: Pw32:http://pw32.sourceforge.net/ Gtk+:http://gtk.org (dev-c++ packages at http://www.bloodshed.net/dev/packages/gtk.html) I think that these 2 packages would remove most (all?) the errors. But, I haven't used either - just read some of their docs. Evan Hempel PS: I think that there also is a dev-c++ package for pw32 Original message follows: --------------------------------------------------- Hello again people Now I'm having problems with a small program, originally written for GNU/Linux. It uses some headers that are not present on Dev-C++, and I never used Linux here on my machine (lack of disk space); maybe the biggest problem is that I don't even know what's written on those headers, so I have no idea of what I need to substitute. (The questions are numbered) 1)) Then here goes my first question: there is a online database/port of linux's headers (with also some documentation or explanation, not just the source code)? And now some doubts: 2)) Look to this error: "144 callbacks.c warning: passing arg 2 of `create_dir_browser' discards qualifiers from pointer target type" Here is the code: /// /* Function prototype */ GtkWidget *create_dir_browser(gchar * title, gchar * current_path, GtkSelectionMode mode, void (*handler) (gchar *)); 124: void on_dir_select29(gchar * dir); ... 141: GtkWidget *win; 142: 143: win = create_dir_browser(_("Select Directory"), g_get_home_dir(), 144: GTK_SELECTION_SINGLE, on_dir_select29); /// I get this error in many other points too. I have no idea of what to do (what does the "void (*handler) (gchar *)" mean?). 3)) The following error: 3771 global.c `SIGPIPE' undeclared (first use in this function) /// 3771: signal(SIGPIPE, sigpipe_handler); /// I couldn't find this constant (should be in "signal.h"?). What do I use instead? 4)) Other error: 1252 commands.c storage size of `uts' isn't known /// 1252: struct utsname uts; /// I think that utsname is defined in sys/utsname.h, but where is utsname.h? There is an equivalent? (What is utsname.h for anyways?) Questions 5 and 6 are about these lines: /// 382: fcntl(sock, F_SETFL, O_NONBLOCK); 383: res = connect(sock, (struct sockaddr *) &server, sizeof(server)); 384: 385: if ((res == 0) || (errno == EINPROGRESS)) return 1; 386: else return 0; /// 5)) Two errors in the same line: 382 connection.c `F_SETFL' undeclared (first use in this function) and 382 connection.c `O_NONBLOCK' undeclared (first use in this function) I think O_NONBLOCK should be in fcntl.h. The F_SETFL I have no idea though. 6)) Two similar errors (from socket.h/winsock.h, I think): 385 connection.c `EINPROGRESS' undeclared (first use in this function) and 465 connection.c `EWOULDBLOCK' undeclared (first use in this function) /// 465: if (errno != EWOULDBLOCK) { /// Are EINPROGRESS and EWOULDBLOCK equivalent to WSAEINPROGRESS and WSAEWOULDBLOCK? Can I substitute them without problems? 7)) 96 exec.c `WNOHANG' undeclared (first use in this function) /// 96: waitpid(exec->pid, &status, WNOHANG); /// 8)) 220 exec.c `SIGKILL' undeclared (first use in this function) /// 217: client_message(NULL, _("Killing process..")); 218: kill(exec->pid, SIGTERM); 219: sleep(2); 220: kill(exec->pid, SIGKILL); /// Should SIGKILL be in signal.h like SIGTERM? Can I use something like SIGABRT instead? 9)) Those errors: 291 md5.c `PROT_READ' undeclared (first use in this function) 291 md5.c `MAP_PRIVATE' undeclared (first use in this function) 291 md5.c `MAP_FAILED' undeclared (first use in this function) /// 291: if ((m = mmap((void *) 0, size, PROT_READ, MAP_PRIVATE, fd, 0)) != MAP_FAILED) /// Probably the problem is this header, that doesn't exist in Dev-C++, right? #include <sys/mman.h> /* for mmap() */ What can I do? There's an equivalent header? 10)) This program uses also these headers: #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> What should I use in windows (besides winsock.h?)? Well, thanks for any help. If anyone interested, I can send the full source code (about 2MB). Daniel K. O. _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com __________________________________________________________________ Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/ Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/ |
|
From: christiaan s. <ck...@ia...> - 2002-04-05 21:24:48
|
what does gtk do? is it like the winapi? |
|
From: Daniel K. O. <dan...@ya...> - 2002-04-07 15:37:19
|
Thanks Evan
It solved the problems with missing headers.
But I'm still having some problems:
2)) Look to this error:
"144 callbacks.c
warning: passing arg 2 of `create_dir_browser' discards qualifiers
from
pointer target type"
Here is the code:
///
/* Function prototype */
7: GtkWidget *create_dir_browser(gchar * title, gchar * current_path,
GtkSelectionMode mode, void (*handler) (gchar *));
124: void on_dir_select29(gchar * dir);
...
141: GtkWidget *win;
142:
143: win = create_dir_browser(_("Select Directory"), g_get_home_dir(),
144: GTK_SELECTION_SINGLE, on_dir_select29);
///
I get this error in many other points too. I have no idea of what to do
(what does the "void (*handler) (gchar *)" mean?).
Well, commenting those lines, it compiles, but then I get linker errors:
c:/projects/lopster/global.o: In function `user2_compare':
//c/projects/lopster/src/global.c:5452: undefined reference to
`inet_network'
c:/projects/lopster/search.o: In function `search_fields_detach':
//c/projects/lopster/src/search.c:2117: undefined reference to
`gtk_window_reposition'
My objects included:
-lgtk.dll -lgdk-win32-2.0.dll -lgmodule-2.0.dll -lgobject-2.0.dll -lglib-2.0
.dll -lwininet -lwsock32 -lgtk-win32-1.3.dll C:\Dev-C++\Lib\gtk.lib
C:\Dev-C++\Lib\gtk-win32-1.3.lib -lc -lmswsock -lgtk-win32-2.0.dll
C:\Dev-C++\Lib\gtk-win32-2.0.lib
Again, thanks for any help.
Daniel K. O.
-----Mensagem original-----
De: dev...@li...
[mailto:dev...@li...]Em nome de Evan Hempel
<ech...@ne...>
Enviada em: sexta-feira, 5 de abril de 2002 16:23
Para: "Dev-Cpp-Users"
Cc: "Daniel K. O."
Assunto: [Dev-C++] Re: 10 quick questions
It looks like you need gtk+ and pw32 (a posix emulation layer)
You can find them at:
Pw32:http://pw32.sourceforge.net/
Gtk+:http://gtk.org (dev-c++ packages at
http://www.bloodshed.net/dev/packages/gtk.html)
I think that these 2 packages would remove most (all?) the errors. But, I
haven't used either - just read some of their docs.
Evan Hempel
PS: I think that there also is a dev-c++ package for pw32
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
|