flat assembler
Message board for the users of flat assembler.
Index
> Linux > Linux & OpenGL |
Author |
|
§-Death_Reaver-§ 07 Mar 2008, 14:46
Yesterday i tried to write a simple program in linux using some gl and glut function, but when i execute it, it shows the "Segmentation Error"
i used theese for assembling and linking: fasm ./OGL.asm ld -s -o GL ./OGL.o /lib/ld-linux.so.2 Can someone help me understand what's wrong? (sorry for my english )
_________________ §-Death_Reaver-§ [my site: deathreaver.altervista.org] [UIC site: quequero.org] |
|||||||||||
07 Mar 2008, 14:46 |
|
§-Death_Reaver-§ 07 Mar 2008, 16:11
@revolution: thanks, but the problem still remain
I used IDA and i discovered that the segmentation error happen inside the first function call (glutInit). mmmmm ps. Are the ld's parameters right? |
|||
07 Mar 2008, 16:11 |
|
revolution 07 Mar 2008, 16:59
You need to pass a proper command line string to glutInit.
The first few lines of glutInit show that it does not allow null parameters: Code: void glutInit(int *argcp, char **argv) { char *str, *geometry = NULL; int i; if (gState.display) { __glutWarning("glutInit being called a second time."); return; } /* Determine temporary program name. */ str = strrchr(argv[0], '/'); <--- here cannot be null! if (str == NULL) { gState.programName = argv[0]; } else { gState.programName = str + 1; } ... |
|||
07 Mar 2008, 16:59 |
|
§-Death_Reaver-§ 07 Mar 2008, 17:33
thanks!
2° problem: Is there some methods in linux to get the current command line quickly (like GetCommandLine in windows)? |
|||
07 Mar 2008, 17:33 |
|
revolution 07 Mar 2008, 17:39
The entry point to your program will have the command line passed to you from the loader. As for getting it after that I am not sure, so to make your task easier just save the values upon entry.
|
|||
07 Mar 2008, 17:39 |
|
dap 07 Mar 2008, 20:37
§-Death_Reaver-§ wrote: thanks! You may simply get them on the stack, like in C. The first parameter of the entry-point function is the number of words in the the command-line, and the second is a pointer to an array of pointers to the words. |
|||
07 Mar 2008, 20:37 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.