LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-23-2004, 01:29 PM   #1
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
syntax error with XSetWindowAttributes help


hello, I'm trying to get a small program i made in c to compile (right now even the code looks like a house built with cardboard and thumbtacks by a blind man)

anyways when i try to compile i keep getting this error
Code:
prog.c:14: error: syntax error before '->' token
anyways, heres lines 12 to 19 :
Code:
XSetWindowAttributes *pwmatt;

pwmatt->background_pixmap = ParentRelative;
pwmatt->background_pixel = ParentRelative;
pwmatt->border_pixel = BlackPixel(display, screennum);
pwmatt->win_gravity = NorthWestGravity;
pwmatt->override_redirect = true;
pwmatt->event_mask = ButtonPress|ButtonRelease;
line 14 is the first "pwmatt->" part, i can move that line with any of the lines below it and it still says its on line 14.. so I'm guessing theres something wrong with all of them

i replace the "->" with "." and it says the error is with the "." token instead

any help? i feel like i tried everything but no luck
 
Old 07-23-2004, 07:06 PM   #2
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Original Poster
Rep: Reputation: 51
never mind, apparently it was just being fussy because it was feeling left out of the main function were most of the action was taking place (tho i don't know what kinda of action was going on..)

anyways, .. now its a problem with "ld" it keeps exiting with error status 1

all i know is it says it cant find "-lX11" ... i use gentoo with trusted path execution (does this make a difference?) is there some special trick to get it to compile?

i use
Code:
gcc prog.c -o prog -lX11
as the compile command
 
Old 07-24-2004, 03:58 AM   #3
gizmo_thunder
Member
 
Registered: Apr 2004
Posts: 101

Rep: Reputation: 15
check this out
http://xander.ncl.ac.uk/game/index1.php
 
Old 07-24-2004, 02:03 PM   #4
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Original Poster
Rep: Reputation: 51
thanks, i got the program to compile now by following a makefile i found in that link... now to get past the "segmentation fault" .. owell... time to get a debug program, some more tea, and maybe a fan

thanks again gizmo_thunder
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
c++ syntax error...HELP!! lmvent Programming 3 09-30-2005 02:40 PM
Syntax error phernand Programming 1 05-10-2005 12:04 PM
Many errors when 'make'ing (example: error: syntax error before `::' token) darkblade Linux - Software 5 03-02-2005 03:00 PM
C++ syntax error before :: token HELP, i cant find the syntax error :( qwijibow Programming 2 12-14-2004 06:09 PM
ERROR running make when installing Nvidia drivers (syntax error) randyriver10 Linux - Software 5 02-21-2004 04:51 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration