Sign in with
Sign up | Sign in
Your question

How can I Compile this program using the alias Cgfx

Last response: in Linux/Free BSD
Share
March 9, 2010 6:51:06 PM

main()
{
/* Define default values: */

int n = 0;
float x = 0.0;

/* Define contents of dialog window */

create_int_dialog_entry("n", &n);
create_float_dialog_entry("x", &x);

/* Create window with name "Setup" and top-left corner at (0,0) */

set_up_dialog("Setup", 0, 0);

/* Display the window and read the results */

read_dialog_window();

/* Print out the new values */

printf("n = %d, x = %f\n", n, x);
}

Compile this program using the alias Cgfx (see the page on compilation) to link in all necessary libraries.
March 10, 2010 1:05:09 AM

Have you searched the forum? I've already answered this question a year or two ago.
m
0
l
March 10, 2010 7:20:17 PM

Can you adjust your answer for Solaris 10 x86
m
0
l
Related resources
March 10, 2010 7:55:40 PM

http://www.tomshardware.com/forum/236614-50-most-linux-...

Cgfx is a custom alias on drexel.edu's compile server so it won't work on your system.

Also their last example is using a custom graphics library developed at drexel.edu which is not available. You can't use the code in their example without the lib but you can use standard X11 calls instead.




http://linuxgazette.net/issue78/tougher.html

  1. #include <X11/Xlib.h>
  2. #include <unistd.h>
  3.  
  4. main()
  5. {
  6. // Open a display.
  7. Display *d = XOpenDisplay(0);
  8.  
  9. if ( d )
  10. {
  11. // Create the window
  12. Window w = XCreateWindow(d, DefaultRootWindow(d), 0, 0, 200,
  13. 100, 0, CopyFromParent, CopyFromParent,
  14. CopyFromParent, 0, 0);
  15.  
  16. // Show the window
  17. XMapWindow(d, w);
  18. XFlush(d);
  19.  
  20. // Sleep long enough to see the window.
  21. sleep(10);
  22. }
  23. return 0;
  24. }


You can compile the program with the following command:

prompt$ g++ test.cpp -L/usr/X11R6/lib -lX11
prompt$ ./a.out

Good luck :) 
m
0
l
March 13, 2010 5:19:58 AM

can I know the name of that library and search for downloading it ? If so How will I use it in the compilation time ?
m
0
l
!