LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Problems with Compiling on Ubuntu (http://www.linuxquestions.org/questions/programming-9/problems-with-compiling-on-ubuntu-709100/)

Akinjide 03-04-2009 07:23 AM

Problems with Compiling on Ubuntu
 
Hi,

I am trying to compile some programs on Ubuntu, and l got the following warning/error messages.
Where can l find X11/Intrinsic.h ...? Any assistance?

Thanking you in advance.

Jide


In file included from calc.c:14:
graphics.h:8:27: error: X11/Intrinsic.h: No such file or directory
In file included from calc.c:14:
graphics.h:19: error: expected specifier-qualifier-list before ‘WidgetClass’
graphics.h:77: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Arrow’
graphics.h:88: warning: parameter names (without types) in function declaration
graphics.h:89: warning: parameter names (without types) in function declaration
graphics.h:90: warning: parameter names (without types) in function declaration
graphics.h:91: warning: parameter names (without types) in function declaration
graphics.h:92: warning: parameter names (without types) in function declaration
graphics.h:93: warning: parameter names (without types) in function declaration
graphics.h:94: warning: parameter names (without types) in function declaration
graphics.h:95: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘CreateMenu’
graphics.h:96: warning: parameter names (without types) in function declaration
In file included from calc.c:15:
callback.h:21: warning: parameter names (without types) in function declaration
callback.h:164: error: expected specifier-qualifier-list before ‘Widget’
In file included from calc.c:17:
simu.h:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘MdCycle’
simu.h:29: error: expected ‘)’ before ‘int’
calc.c: In function ‘ReadNewRun’:
calc.c:96: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result
calc.c:106: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result
calc.c:120: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
calc.c:121: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
calc.c:122: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
calc.c:123: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result
calc.c: In function ‘SimArea’:
calc.c:883: warning: too few arguments for format
calc.c:893: warning: too few arguments for format
calc.c: In function ‘AssignType’:
calc.c:960: error: ‘False’ undeclared (first use in this function)
calc.c:960: error: (Each undeclared identifier is reported only once
calc.c:960: error: for each function it appears in.)
calc.c: In function ‘Disl’:
calc.c:1216: warning: ' ' flag used with ‘%p’ printf format
calc.c:1216: warning: format ‘% p’ expects type ‘void *’, but argument 2 has type ‘int’
calc.c: In function ‘AllocateN’:
calc.c:1288: error: ‘True’ undeclared (first use in this function)
make: *** [calc.o] Error 1

weibullguy 03-04-2009 08:08 AM

Assuming Ubuntu comes with a modular X-Windows, that would be provided by the libXt development package.

Hko 03-04-2009 08:54 AM

This command should do it:
Code:

sudo apt-get install libxt-dev

Akinjide 03-04-2009 06:06 PM

Thanks. I have solved that problem.

I got another set of error messages:

callback.c:14:23: error: Xm/ArrowB.h: No such file or directory
callback.c:15:22: error: Xm/PushB.h: No such file or directory
callback.c:16:22: error: Xm/Scale.h: No such file or directory
callback.c:17:21: error: Xm/Text.h: No such file or directory
callback.c:18:25: error: Xm/ToggleBP.h: No such file or directory
callback.c:19:24: error: Xm/MwmUtil.h: No such file or directory ...

Do l need to install another package?

Cheers.

Jide

Hko 03-05-2009 02:44 AM

Quote:

Originally Posted by Akinjide (Post 3465168)
I got another set of error messages:

callback.c:14:23: error: Xm/ArrowB.h: No such file or directory
callback.c:15:22: error: Xm/PushB.h: No such file or directory
callback.c:16:22: error: Xm/Scale.h: No such file or directory
callback.c:17:21: error: Xm/Text.h: No such file or directory
callback.c:18:25: error: Xm/ToggleBP.h: No such file or directory
callback.c:19:24: error: Xm/MwmUtil.h: No such file or directory ...

Do l need to install another package?

Yes.

To run programs often packages with shared libraries are needed. To compile programs, you also need the header (*.h) files for those libraries which are most often in separate packages.

E.g. If a program needs the package "libncurses5" to run, you need "libncurses5-dev" to compile it.

So, in your case, the compiler misses the header files "ArrowB.h", "PushB.h", and so on.

To find out about which package this is in, I googled for "ToggleBP.h" and "package". The top link found indicates this is the "lesstif2" library package.

On Ubuntu/Debian you can then do:
Code:

apt-cache search lesstif2 | fgrep dev
lesstif2-dev - development library and header files for LessTif 2.1

Then to get the header files installed, do:
Code:

sudo apt-get install lesstif2-dev
Hope you do the trick yourself now.

Akinjide 03-05-2009 06:07 AM

Thanks. It worked.

I have successfully compiled the programs.

But, l encountered some little problems ;

Problem 1:

*** buffer overflow detected ***: ./program1 terminated
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x48)[0xb7c696d8]
/lib/tls/i686/cmov/libc.so.6[0xb7c67800]
/lib/tls/i686/cmov/libc.so.6[0xb7c66ef8]
/lib/tls/i686/cmov/libc.so.6(_IO_default_xsputn+0xc8)[0xb7bdca78]
/lib/tls/i686/cmov/libc.so.6(_IO_vfprintf+0xf4a)[0xb7baf90a]
/lib/tls/i686/cmov/libc.so.6(__vsprintf_chk+0xa4)[0xb7c66fa4]
/lib/tls/i686/cmov/libc.so.6(__sprintf_chk+0x2d)[0xb7c66eed]
./aline[0x80654ea]
./aline[0x80656a1]
./aline[0x8067741]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5)[0xb7b85685]
./aline[0x8049c51]
======= Memory map: ========
08048000-0806d000 r-xp 00000000 08:01 2203989 /home/bart/Progs/aline
0806d000-0806e000 r--p 00024000 08:01 2203989 /home/bart/Progs/aline
0806e000-0806f000 rw-p 00025000 08:01 2203989 /home/bart/Progs/aline
0806f000-0807a000 rw-p 0806f000 00:00 0
09380000-093c1000 rw-p 09380000 00:00 0 [heap]
b7ae0000-b7aed000 r-xp 00000000 08:01 1392661 /lib/libgcc_s.so.1
b7aed000-b7aee000 r--p 0000c000 08:01 1392661 /lib/libgcc_s.so.1
b7aee000-b7aef000 rw-p 0000d000 08:01 1392661 /lib/libgcc_s.so.1
b7aef000-b7af3000 r-xp 00000000 08:01 1500744 /usr/lib/libXfixes.so.3.1.0
b7af3000-b7af4000 rw-p 00003000 08:01 1500744 /usr/lib/libXfixes.so.3.1.0
b7af4000-b7afc000 r-xp 00000000 08:01 1500764 /usr/lib/libXrender.so.1.3.0
b7afc000-b7afd000 r--p 00007000 08:01 1500764 /usr/lib/libXrender.so.1.3.0
b7afd000-b7afe000 rw-p 00008000 08:01 1500764 /usr/lib/libXrender.so.1.3.0
b7b0b000-b7b0d000 rw-p b7b0b000 00:00 0
b7b0d000-b7b11000 r-xp 00000000 08:01 1500738 /usr/lib/libXdmcp.so.6.0.0
b7b11000-b7b12000 rw-p 00003000 08:01 1500738 /usr/lib/libXdmcp.so.6.0.0
b7b12000-b7b14000 r-xp 00000000 08:01 1500727 /usr/lib/libXau.so.6.0.0
b7b14000-b7b15000 rw-p 00001000 08:01 1500727 /usr/lib/libXau.so.6.0.0
b7b15000-b7b17000 r-xp 00000000 08:01 1409705 /lib/tls/i686/cmov/libdl-2.8.90.so
b7b17000-b7b18000 r--p 00001000 08:01 1409705 /lib/tls/i686/cmov/libdl-2.8.90.so
b7b18000-b7b19000 rw-p 00002000 08:01 1409705 /lib/tls/i686/cmov/libdl-2.8.90.so
b7b19000-b7b30000 r-xp 00000000 08:01 1501671 /usr/lib/libxcb.so.1.0.0
b7b30000-b7b31000 r--p 00016000 08:01 1501671 /usr/lib/libxcb.so.1.0.0
b7b31000-b7b32000 rw-p 00017000 08:01 1501671 /usr/lib/libxcb.so.1.0.0
b7b32000-b7b33000 r-xp 00000000 08:01 1501669 /usr/lib/libxcb-xlib.so.0.0.0
b7b33000-b7b34000 r--p 00000000 08:01 1501669 /usr/lib/libxcb-xlib.so.0.0.0
b7b34000-b7b35000 rw-p 00001000 08:01 1501669 /usr/lib/libxcb-xlib.so.0.0.0
b7b35000-b7b36000 rw-p b7b35000 00:00 0
b7b36000-b7b43000 r-xp 00000000 08:01 1500742 /usr/lib/libXext.so.6.4.0
b7b43000-b7b45000 rw-p 0000c000 08:01 1500742 /usr/lib/libXext.so.6.4.0
b7b45000-b7b4c000 r-xp 00000000 08:01 1500758 /usr/lib/libXp.so.6.2.0
b7b4c000-b7b4d000 r--p 00006000 08:01 1500758 /usr/lib/libXp.so.6.2.0
b7b4d000-b7b4e000 rw-p 00007000 08:01 1500758 /usr/lib/libXp.so.6.2.0
b7b4e000-b7b63000 r-xp 00000000 08:01 1500686 /usr/lib/libICE.so.6.3.0
b7b63000-b7b64000 rw-p 00014000 08:01 1500686 /usr/lib/libICE.so.6.3.0
b7b64000-b7b66000 rw-p b7b64000 00:00 0
b7b66000-b7b6d000 r-xp 00000000 08:01 1500715 /usr/lib/libSM.so.6.0.0
b7b6d000-b7b6e000 r--p 00006000 08:01 1500715 /usr/lib/libSM.so.6.0.0
b7b6e000-b7b6f000 rw-p 00007000 08:01 1500715 /usr/lib/libSM.so.6.0.0
b7b6f000-b7cc7000 r-xp 00000000 08:01 1409702 /lib/tls/i686/cmov/libc-2.8.90.so
b7cc7000-b7cc9000 r--p 00158000 08:01 1409702 /lib/tls/i686/cmov/libc-2.8.90.so
b7cc9000-b7cca000 rw-p 0015a000 08:01 1409702 /lib/tls/i686/cmov/libc-2.8.90.so
b7cca000-b7ccd000 rw-p b7cca000 00:00 0
b7ccd000-b7db8000 r-xp 00000000 08:01 1499909 /usr/lib/libX11.so.6.2.0
b7db8000-b7db9000 r--p 000ea000 08:01 1499909 /usr/lib/libX11.so.6.2.0
b7db9000-b7dbb000 rw-p 000eb000 08:01 1499909 /usr/lib/libX11.so.6.2.0
b7dbb000-b7dbc000 rw-p b7dbb000 00:00 0
b7dbc000-b7e09000 r-xp 00000000 08:01 1500768 /usr/lib/libXt.so.6.0.0
b7e09000-b7e0d000 rw-p 0004c000 08:01 1500768 /usr/lib/libXt.so.6.0.0
b7e0d000-b7e0e000 rw-p b7e0d000 00:00 0
b7e0e000-b7f3c000 r-xp 00000000 08:01 1501614 /usr/lib/libXm.so.2.0.1
b7f3c000-b7f3d000 r--p 0012e000 08:01 1501614 /usr/lib/libXm.so.2.0.1
b7f3d000-b7f4d000 rw-p 0012f000 08:01 1501614 /usr/lib/libXm.so.2.0.1
b7f4d000-b7f4f000 rw-p b7f4d000 00:00 0
b7f4f000-b7f73000 r-xp 00000000 08:01 1409706 /lib/tls/i686/cmov/libm-2.8.90.so
b7f73000-b7f74000 r--p 00023000 08:01 1409706 /lib/tls/i686/cmov/libm-2.8.90.so
b7f74000-b7f75000 rw-p 00024000 08:01 1409706 /lib/tls/i686/cmov/libm-2.8.90.so
b7f78000-b7f80000 r-xp 00000000 08:01 1500734 /usr/lib/libXcursor.so.1.0.2
b7f80000-b7f81000 rw-p 00007000 08:01 1500734 /usr/lib/libXcursor.so.1.0.2
b7f81000-b7f84000 rw-p b7f81000 00:00 0
b7f84000-b7f9e000 r-xp 00000000 08:01 1392652 /lib/ld-2.8.90.so
b7f9e000-b7f9f000 r-xp b7f9e000 00:00 0 [vdso]
b7f9f000-b7fa0000 r--p 0001a000 08:01 1392652 /lib/ld-2.8.90.so
b7fa0000-b7fa1000 rw-p 0001b000 08:01 1392652 /lib/ld-2.8.90.so
bf98b000-bf9a0000 rw-p bffeb000 00:00 0 [stack]
Aborted


Problem 2 :

<make: *** No rule to make target `program1.man', needed by `program1_man'. Stop.>


Please, l would appreciate your assistance.

Jide

Akinjide 03-05-2009 06:08 AM

Thanks. It worked.

I have successfully compiled the programs.

But, l encountered some little problems ;

Problem 1:

*** buffer overflow detected ***: ./program1 terminated
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x48)[0xb7c696d8]
/lib/tls/i686/cmov/libc.so.6[0xb7c67800]
/lib/tls/i686/cmov/libc.so.6[0xb7c66ef8]
/lib/tls/i686/cmov/libc.so.6(_IO_default_xsputn+0xc8)[0xb7bdca78]
/lib/tls/i686/cmov/libc.so.6(_IO_vfprintf+0xf4a)[0xb7baf90a]
/lib/tls/i686/cmov/libc.so.6(__vsprintf_chk+0xa4)[0xb7c66fa4]
/lib/tls/i686/cmov/libc.so.6(__sprintf_chk+0x2d)[0xb7c66eed]
./aline[0x80654ea]
./aline[0x80656a1]
./aline[0x8067741]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5)[0xb7b85685]
./aline[0x8049c51]
======= Memory map: ========
08048000-0806d000 r-xp 00000000 08:01 2203989 /home/bart/Progs/aline
0806d000-0806e000 r--p 00024000 08:01 2203989 /home/bart/Progs/aline
0806e000-0806f000 rw-p 00025000 08:01 2203989 /home/bart/Progs/aline
0806f000-0807a000 rw-p 0806f000 00:00 0
09380000-093c1000 rw-p 09380000 00:00 0 [heap]
b7ae0000-b7aed000 r-xp 00000000 08:01 1392661 /lib/libgcc_s.so.1
b7aed000-b7aee000 r--p 0000c000 08:01 1392661 /lib/libgcc_s.so.1
b7aee000-b7aef000 rw-p 0000d000 08:01 1392661 /lib/libgcc_s.so.1
b7aef000-b7af3000 r-xp 00000000 08:01 1500744 /usr/lib/libXfixes.so.3.1.0
b7af3000-b7af4000 rw-p 00003000 08:01 1500744 /usr/lib/libXfixes.so.3.1.0
b7af4000-b7afc000 r-xp 00000000 08:01 1500764 /usr/lib/libXrender.so.1.3.0
b7afc000-b7afd000 r--p 00007000 08:01 1500764 /usr/lib/libXrender.so.1.3.0
b7afd000-b7afe000 rw-p 00008000 08:01 1500764 /usr/lib/libXrender.so.1.3.0
b7b0b000-b7b0d000 rw-p b7b0b000 00:00 0
b7b0d000-b7b11000 r-xp 00000000 08:01 1500738 /usr/lib/libXdmcp.so.6.0.0
b7b11000-b7b12000 rw-p 00003000 08:01 1500738 /usr/lib/libXdmcp.so.6.0.0
b7b12000-b7b14000 r-xp 00000000 08:01 1500727 /usr/lib/libXau.so.6.0.0
b7b14000-b7b15000 rw-p 00001000 08:01 1500727 /usr/lib/libXau.so.6.0.0
b7b15000-b7b17000 r-xp 00000000 08:01 1409705 /lib/tls/i686/cmov/libdl-2.8.90.so
b7b17000-b7b18000 r--p 00001000 08:01 1409705 /lib/tls/i686/cmov/libdl-2.8.90.so
b7b18000-b7b19000 rw-p 00002000 08:01 1409705 /lib/tls/i686/cmov/libdl-2.8.90.so
b7b19000-b7b30000 r-xp 00000000 08:01 1501671 /usr/lib/libxcb.so.1.0.0
b7b30000-b7b31000 r--p 00016000 08:01 1501671 /usr/lib/libxcb.so.1.0.0
b7b31000-b7b32000 rw-p 00017000 08:01 1501671 /usr/lib/libxcb.so.1.0.0
b7b32000-b7b33000 r-xp 00000000 08:01 1501669 /usr/lib/libxcb-xlib.so.0.0.0
b7b33000-b7b34000 r--p 00000000 08:01 1501669 /usr/lib/libxcb-xlib.so.0.0.0
b7b34000-b7b35000 rw-p 00001000 08:01 1501669 /usr/lib/libxcb-xlib.so.0.0.0
b7b35000-b7b36000 rw-p b7b35000 00:00 0
b7b36000-b7b43000 r-xp 00000000 08:01 1500742 /usr/lib/libXext.so.6.4.0
b7b43000-b7b45000 rw-p 0000c000 08:01 1500742 /usr/lib/libXext.so.6.4.0
b7b45000-b7b4c000 r-xp 00000000 08:01 1500758 /usr/lib/libXp.so.6.2.0
b7b4c000-b7b4d000 r--p 00006000 08:01 1500758 /usr/lib/libXp.so.6.2.0
b7b4d000-b7b4e000 rw-p 00007000 08:01 1500758 /usr/lib/libXp.so.6.2.0
b7b4e000-b7b63000 r-xp 00000000 08:01 1500686 /usr/lib/libICE.so.6.3.0
b7b63000-b7b64000 rw-p 00014000 08:01 1500686 /usr/lib/libICE.so.6.3.0
b7b64000-b7b66000 rw-p b7b64000 00:00 0
b7b66000-b7b6d000 r-xp 00000000 08:01 1500715 /usr/lib/libSM.so.6.0.0
b7b6d000-b7b6e000 r--p 00006000 08:01 1500715 /usr/lib/libSM.so.6.0.0
b7b6e000-b7b6f000 rw-p 00007000 08:01 1500715 /usr/lib/libSM.so.6.0.0
b7b6f000-b7cc7000 r-xp 00000000 08:01 1409702 /lib/tls/i686/cmov/libc-2.8.90.so
b7cc7000-b7cc9000 r--p 00158000 08:01 1409702 /lib/tls/i686/cmov/libc-2.8.90.so
b7cc9000-b7cca000 rw-p 0015a000 08:01 1409702 /lib/tls/i686/cmov/libc-2.8.90.so
b7cca000-b7ccd000 rw-p b7cca000 00:00 0
b7ccd000-b7db8000 r-xp 00000000 08:01 1499909 /usr/lib/libX11.so.6.2.0
b7db8000-b7db9000 r--p 000ea000 08:01 1499909 /usr/lib/libX11.so.6.2.0
b7db9000-b7dbb000 rw-p 000eb000 08:01 1499909 /usr/lib/libX11.so.6.2.0
b7dbb000-b7dbc000 rw-p b7dbb000 00:00 0
b7dbc000-b7e09000 r-xp 00000000 08:01 1500768 /usr/lib/libXt.so.6.0.0
b7e09000-b7e0d000 rw-p 0004c000 08:01 1500768 /usr/lib/libXt.so.6.0.0
b7e0d000-b7e0e000 rw-p b7e0d000 00:00 0
b7e0e000-b7f3c000 r-xp 00000000 08:01 1501614 /usr/lib/libXm.so.2.0.1
b7f3c000-b7f3d000 r--p 0012e000 08:01 1501614 /usr/lib/libXm.so.2.0.1
b7f3d000-b7f4d000 rw-p 0012f000 08:01 1501614 /usr/lib/libXm.so.2.0.1
b7f4d000-b7f4f000 rw-p b7f4d000 00:00 0
b7f4f000-b7f73000 r-xp 00000000 08:01 1409706 /lib/tls/i686/cmov/libm-2.8.90.so
b7f73000-b7f74000 r--p 00023000 08:01 1409706 /lib/tls/i686/cmov/libm-2.8.90.so
b7f74000-b7f75000 rw-p 00024000 08:01 1409706 /lib/tls/i686/cmov/libm-2.8.90.so
b7f78000-b7f80000 r-xp 00000000 08:01 1500734 /usr/lib/libXcursor.so.1.0.2
b7f80000-b7f81000 rw-p 00007000 08:01 1500734 /usr/lib/libXcursor.so.1.0.2
b7f81000-b7f84000 rw-p b7f81000 00:00 0
b7f84000-b7f9e000 r-xp 00000000 08:01 1392652 /lib/ld-2.8.90.so
b7f9e000-b7f9f000 r-xp b7f9e000 00:00 0 [vdso]
b7f9f000-b7fa0000 r--p 0001a000 08:01 1392652 /lib/ld-2.8.90.so
b7fa0000-b7fa1000 rw-p 0001b000 08:01 1392652 /lib/ld-2.8.90.so
bf98b000-bf9a0000 rw-p bffeb000 00:00 0 [stack]
Aborted


Problem 2 :

<make: *** No rule to make target `program1.man', needed by `program1_man'. Stop.>


Please, l would appreciate your assistance.

Jide


All times are GMT -5. The time now is 10:10 PM.