Сообщения alexsy
Интересует на сколько долг вызов pthread_mutex_(un)lock( &_mutex )
Компеляция языка ADA
with Text_IO;
procedure Main is
begin
Text_IO.Put_Line ("Hello World");
end Main;
Компеляция:
gcc -c adatest.adb
Ответ:
+===========================GNAT BUG DETECTED==============================+
| 3.4.2 20041017 (Red Hat 3.4.2-6.fc3) (i386-redhat-linux-gnu) |
| Storage_Error stack overflow (or erroneous memory access) |
| Error detected at a-textio.ads:53:9 |
| Please submit a bug report; see http://gcc.gnu.org/bugs.html. |
| Include the entire contents of this bug box in the report. |
| Include the exact gcc or gnatmake command that you entered. |
| Also include sources listed below in gnatchop format |
| (concatenated together with no headers between files). |
+==========================================================================+
Please include these source files with error report
Note that list may not be accurate in some cases,
so please double check that the problem can still
be reproduced with the set of files listed.
adatest.adb
adatest.adb:3:11: warning: file name does not match unit name, should be "main.adb"
compilation abandoned
ВОПРОС Что не так ???????
ps: ADA_INCLUDE_PATH и ADA_OBJECTS_PATH установленны. Дистр FC3
К вопросу о сборке GCC
log ./configure
configure:3690: $? = 0 configure:3693: test -s conftest.o configure:3696: $? = 0 configure:3715: result: 8 configure:3809: checking for x86_64-redhat-linux-gnatbind ** configure:3838: result: no configure:3847: checking for gnatbind configure:3863: found /usr/bin/gnatbind configure:3874: result: gnatbind configure:3886: checking whether compiler driver understands Ada ** configure:3910: result: no configure:4050: checking for egrep configure:4060: result: grep -E configure:4065: checking for ANSI C header files configure:4090: gcc -c -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -mtune=nocona conftest.c >&5 configure:4096: $? = 0 configure:4100: test -z
Ошибочные строки пометил ** установленные пакеты:
gcc-gnat-3.4.2-6.fc3 cpp-3.4.2-6.fc3 libgcj-3.4.2-6.fc3 gcc-objc-3.4.2-6.fc3 libgcj-devel-3.4.2-6.fc3 gcc-c++-3.4.2-6.fc3 libgnat-3.4.2-6.fc3 libstdc++-3.4.2-6.fc3 gcc-g77-3.4.2-6.fc3 libf2c-3.4.2-6.fc3 libgcc-3.4.2-6.fc3 libobjc-3.4.2-6.fc3 gcc-3.4.2-6.fc3 gcc-java-3.4.2-6.fc3 libstdc++-devel-3.4.2-6.fc3 Дист FC 3. может чего не хватает ну типа какого нибуть пакета или конфигурационного файла ?? Кто сталкивался
Не могу собрать пакет gcc-3.4.3-22.fc3.src.rpm
Как передаються параметры в фукцию для x86_64
Как передать в функцию парамеры через регистры.
Как в XLib Вывести русские буквы ( в окне )
#include <stdio.h>
#include <stdlib.h>
//#include <locale.h>
#include <string.h>
#include <X11/Xlocale.h>
#include <X11/Xos.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xproto.h>
#include <X11/Xatom.h>
#define OUTER_WINDOW_MIN_WIDTH 200
#define OUTER_WINDOW_MIN_HEIGHT 200
#define OUTER_WINDOW_DEF_WIDTH (OUTER_WINDOW_MIN_WIDTH + 100)
#define OUTER_WINDOW_DEF_HEIGHT (OUTER_WINDOW_MIN_HEIGHT + 100)
#define OUTER_WINDOW_DEF_X 100
#define OUTER_WINDOW_DEF_Y 100
#define BORDER_WIDTH 2
#define DEFAULT_FONT "-misc-*-*-*-*-*-*-200-*-*-*-*-koi8-r"
#define MAX_STRING 256
XIM xim;
XIC xic;
Window root_win;
Window win;
Window sub_win;
Font font;
GC gc;
XFontSet fs;
Display* dpy;
XIMStyles* xim_styles;
XIMStyle xim_style;
XSetWindowAttributes win_attr;
XGCValues gcv;
XSizeHints hints;
XEvent event;
char* mod;
char* value_im;
int scr;
unsigned long mask;
char string[ MAX_STRING+1 ];
void set_sizehints(XSizeHints* hintp, int min_width, int min_height,
int defwidth, int defheight, int defx, int defy, int scr );
void do_keypress( XEvent* event );
void do_expose( XEvent* event );
void draw();
int StrLenght( char* str );
//---------------------------------------------------------------------------
int main( int ac, char* av[] )
{
xim_style = 0;
if( setlocale( LC_ALL, "" ) == NULL )
{
printf( "%s: Error!! could not set default locale\n", av[0] );
return -1;
}
else
if( ( dpy = XOpenDisplay( NULL ) ) == NULL )
{
printf( "%s: Error!! open display \n", av[0] );
return -1;
}
else
if( ( mod = XSetLocaleModifiers ("@im=none") ) == NULL )
{
printf( "%s: Error!! XSetLocaleModifiers ", av[ 0 ] );
return -1;
}
else
if( ( xim = XOpenIM (dpy, NULL, NULL, NULL) ) == NULL )
{
printf( "%s: Error!! XSetLocaleModifiers ", av[ 0 ] );
return -1;
}
else
if( ( value_im = XGetIMValues( xim, XNQueryInputStyle, &xim_styles, NULL) ) != NULL ||
xim_styles == NULL )
{
printf ( "%s: Error!! Input method doesn't support any styles\n", av[0] );
return -1;
}
else
for( int i = 0; i < xim_styles->count_styles; i++ )
{
if( xim_styles->supported_styles[i] == ( XIMPreeditNothing | XIMStatusNothing ) )
{
xim_style = xim_styles->supported_styles[ i ];
break;
}
}
if( xim_style == 0 )
{
printf ( "%s: Error!! Input method doesn't support the style we support\n", av[0] );
return -1;
}
XFree ( xim_styles );
scr = DefaultScreen( dpy );
root_win = RootWindow ( dpy, scr );
( void )set_sizehints (&hints, OUTER_WINDOW_MIN_WIDTH, OUTER_WINDOW_MIN_HEIGHT,
OUTER_WINDOW_DEF_WIDTH, OUTER_WINDOW_DEF_HEIGHT,
OUTER_WINDOW_DEF_X, OUTER_WINDOW_DEF_Y, scr );
win_attr.event_mask = KeyPressMask | StructureNotifyMask |
SubstructureNotifyMask | ExposureMask;
win_attr.background_pixel = BlackPixel( dpy, scr );
win_attr.border_pixel = WhitePixel( dpy, scr );
mask = 0L | ( CWBackPixel | CWBorderPixel | CWEventMask );
win = XCreateWindow ( dpy, root_win, hints.x, hints.y,
hints.width, hints.height, BORDER_WIDTH, 0,
InputOutput, (Visual *)CopyFromParent,
mask, &win_attr);
XSetStandardProperties( dpy, win, "Text locale", NULL,
(Pixmap)0, av, ac, &hints);
font = XLoadFont( dpy, DEFAULT_FONT );
gcv.background = BlackPixel( dpy, scr );
gcv.foreground = WhitePixel( dpy, scr );
//gcv.function = GXcopy;
gcv.line_width = 3;
gcv.line_style = LineSolid;
gcv.join_style = JoinMiter;
gcv.font = font;
gc = XCreateGC(dpy, win, GCLineWidth |GCLineStyle | GCForeground |
GCBackground | /*GCFont |*/ GCJoinStyle, &gcv );
if( (xim && xim_style) && ( xic = XCreateIC( xim, XNInputStyle, xim_style,
XNClientWindow, win, XNFocusWindow, win, NULL) ) == NULL )
{
printf ( "%s: Error!! XCreateIC failed\n", av[0] );
XDestroyWindow( dpy, win );
XCloseDisplay( dpy );
return -1;
}
/*XFontSet XCreateFontSet(display, base_font_name_list, missing_charset_list_return,
missing_charset_count_return, def_string_return)
Display *display;
char *base_font_name_list;
char ***missing_charset_list_return;
int *missing charset_count_return;
char **def_string_return;*/
char** charset_list_return;
int charset_count_return;
char* def_string_return;
fs = XCreateFontSet( dpy, DEFAULT_FONT, &charset_list_return,
&charset_count_return, &def_string_return );
for( int i = 0; i < charset_count_return; i++ )
{
printf("charset list >%s<\n", charset_list_return[i] );
}
XMapWindow( dpy, win );
while( 1 )
{
XNextEvent( dpy, &event );
if( event.type == KeyPress )
do_keypress( &event );
else
if( event.type == Expose )
do_expose( &event );
}
}
//---------------------------------------------------------------------------
void set_sizehints( XSizeHints *hintp, int min_width, int min_height,
int defwidth, int defheight, int defx, int defy, int scr )
{
int geom_result;
hintp->width = hintp->min_width = min_width;
hintp->height = hintp->min_height = min_height;
hintp->flags = PMinSize;
hintp->x = hintp->y = 0;
geom_result = NoValue;
if( !( hintp->flags & USSize) )
{
hintp->width = defwidth;
hintp->height = defheight;
hintp->flags |= PSize;
}
if (geom_result & XNegative)
{
hintp->x = DisplayWidth ( dpy, scr ) + hintp->x - hintp->width;
}
if (geom_result & YNegative)
{
hintp->y = DisplayHeight( dpy, scr ) + hintp->y - hintp->height;
}
}
//---------------------------------------------------------------------------
void do_expose( XEvent* event )
{
if( event->xexpose.count > 0 )
return;
draw();
}
//---------------------------------------------------------------------------
void draw()
{
XDrawString( dpy, win, gc, 20, 20, "test", StrLenght("test") );
}
//---------------------------------------------------------------------------
int StrLenght( char* str )
{
int count = 0; while( str[ count ] != '\0' ) count++;
return count;
}
//---------------------------------------------------------------------------
void do_keypress( XEvent* event )
{
#define BUFSIZE 8
printf("Press key\n");
XKeyEvent* ke = ( XKeyEvent* ) event;
KeySym ks;
Status status;
wchar_t symb[10];
int nbytes;
int nmbbytes;
char* buf;
int bufsize;
bufsize = BUFSIZE;
if( ( buf = ( char* )malloc( BUFSIZE ) ) == NULL )
{
return;
}
nbytes = XLookupString( ke, string, 256, &ks, NULL);
do
{
nmbbytes = XmbLookupString( xic, ke, buf, bufsize-1, &ks, &status );
buf[nmbbytes] = '\0';
if( status == XBufferOverflow )
{
bufsize = nmbbytes + 1;
buf = ( char* )realloc( buf, bufsize );
}
}
while( status == XBufferOverflow );
nmbbytes = XwcLookupString( xic, ke, symb, 9, &ks, &status );
XwcDrawString( dpy, win, fs, gc, 40, 60, symb, 1 );
//XDrawString( dpy, win, gc, 40, 40, " ", StrLenght(" ") );
char* strss = "����";
XDrawString( dpy, win, gc, 40, 80, strss, 4 );
XDrawString( dpy, win, gc, 40, 40, string, StrLenght(string) );
printf(">%s<",string);
}
Есть ли средства позволяющие Ядру писать в память пользователя.
Проблема с консолью
Как в X11 подсчитать размер выводимого текста
Не могу понять как собираеться Xorg для x86_64 arch
nice для thread
Xlib. Структура Display «что нибуть для личного использования»
В Windows для окна есть функция (Set)(Get) WindowLong( Hwnd, GWL_USERDATA ) для сохранения указателя на всякоую херню. и так вопрос. В структуре Display( или где нибуть ) нет чего нибуть подобного.
как строку в UTF-8 вывести в Xorg окно ??
Может кто нашол документацию по XRender
Нужно вывести русские буквы в окно через Xlib
Как правельно подключить модуль ядра.
Монтирование fat раздела
Програмирование м макросами.
| ← назад | следующие → |