Results 1 to 8 of 8
Posts: 12
GCC bug?
My GCC does not recognize newt.h.
He does not give me the missing Include (hw.c:2:20: error: studio.h: No such file or directory) error, but the unfound ...
- 06-23-2008 #1Just Joined!
- Join Date
- Jun 2008
- Posts
- 34
Bad GCC not recognizing NEWT
Posts: 12
GCC bug?
My GCC does not recognize newt.h.
He does not give me the missing Include (hw.c:2:20: error: studio.h: No such file or directory) error, but the unfound method error (
/tmp/ccAdUhKq.o: In function `main':
hw.c.text+0x19): undefined reference to `print'
collect2: ld returned 1 exit status).
I using the lastest newt-dev from APT and GCC 4.1.2 20061115 on Debian 4.1.1-21.
- 06-23-2008 #2Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
I hope that "studio.h" and "print" are typos. If not, you should change them by "stdio.h" and "printf" probably (I can't tell you any other thing without having seen your source code...)
In any case, newt probably is a separate package, so, you might need to install it separately, along with any -dev or -devel matching package.
- 06-23-2008 #3Just Joined!
- Join Date
- Jun 2008
- Posts
- 34
studio.h and print are like foo/bar, to show you what type of error i got, not missing(/mistyped) header (like writing studio.h instead of stdio.h) but a missing/mistyped method (like print instead of printf). When i started learning C, i mistaken stdio to studio (didn't now it stands for STanDard Input/Output), but now i don't.
I installed newt-dev via apt (apt-get install libnewt-dev) beforehand, and, as you should know, the .h files are in the dev, and i didn't got a missing header error, but a missing method one.
- 06-23-2008 #4Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
Hi again,
You confirmed that you installed the dev package, but did you install the binary library as well?
Try to post the exact error messages, it's hard to guess whether newt has actually something to do with your problem or if something is being overlooked. Having the source to look at, the command line you used and the exact errors would ease the thing.
Cheers.
- 06-24-2008 #5Just Joined!
- Join Date
- Jun 2008
- Posts
- 34
The binary package is installed.
"Console Dump":
Source:Code:ariel@artwaresoft-linux:~$ gcc newthw.c /tmp/ccCdHkm2.o: In function `main': newthw.c:(.text+0x12): undefined reference to `newtInit' newthw.c:(.text+0x17): undefined reference to `newtCls' newthw.c:(.text+0x33): undefined reference to `newtDrawRootText' newthw.c:(.text+0x4f): undefined reference to `newtDrawRootText' newthw.c:(.text+0x5b): undefined reference to `newtPushHelpLine' newthw.c:(.text+0x60): undefined reference to `newtRefresh' newthw.c:(.text+0x78): undefined reference to `newtPushHelpLine' newthw.c:(.text+0x7d): undefined reference to `newtRefresh' newthw.c:(.text+0x8e): undefined reference to `newtPopHelpLine' newthw.c:(.text+0x93): undefined reference to `newtRefresh' newthw.c:(.text+0xa4): undefined reference to `newtFinished' collect2: ld returned 1 exit status
Hello World programs work.Code:#include <newt.h> #include <stdlib.h> int main(void) { newtInit(); newtCls(); newtDrawRootText(0, 0, "Some root text"); newtDrawRootText(-25, -2, "Root text in the other corner"); newtPushHelpLine(NULL); newtRefresh(); sleep(1); newtPushHelpLine("A help line"); newtRefresh(); sleep(1); newtPopHelpLine(); newtRefresh(); sleep(1); newtFinished(); }
- 06-24-2008 #6Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
You need to add the library on command line:
Try thatCode:gcc -o progname progname.c -lnewt
- 06-24-2008 #7
- 06-24-2008 #8Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513


Reply With Quote
