Re: Open Watcom
Posted: Sat Jan 26, 2008 8:28 pm
andrew_programmer
У тебя ошибка в коде. Правильно fputc('a',f);
У тебя ошибка в коде. Правильно fputc('a',f);
Точно. Я перепутал с функцией fprintf()У тебя ошибка в коде. Правильно fputc('a',f);
А где в IDE такая опция? Я что-то не нашёл.OPTION OFFSET=0
Нужно использовать pe2kos_path.exe или pe2kos_nopath.exe ?pe2kos <file.exe> file
Code: Select all
void* (_stdcall *CraeteBookmark)(struct HEADER *Parend,void *Control);
Code: Select all
CraeteBookmark( arguments )
Code: Select all
Warning! W1027: file interface.obj(C:\kolibri\watcom\projects\CMspectra\interface.c): redefinition of _CraeteBookmark ignored
Действительно компилируются! Здорово!Я поправил заголовочные файлы, 1.7а теперь компилирует библиотеки
Опробовал. Работает!pe2kos больше не нужен. Теперь можно линковать в программы в формате Колибри.
Это опции для линка: output raw op offset=0 op OBJALIGN=16 op STACK=4096 name имя_файла.exe
В меню Targets->Target options->Execute after добавить kpack.exe имя_файла.exe имя_файла
Размер стека можно устанавливать по необходимости, но меньше 4Кб не стоит. Проверку стека можно включить в опциях компиляции. Если не указать name имя_файла.exe то линковщик создаст файл с расширением .bin, а wmake сообщит что не удалось создать .exe
Code: Select all
void LoadSpectra(char *file,struct lorents_information *info,struct PLOTINFO *plot,struct SCREEN *scr)
{
int i;
FILE* f;
info->spectr=malloc(SPECTRA_BUFFER_SIZE);
info->spectr_theoretical=malloc(SPECTRA_BUFFER_SIZE);
info->spectr_restored=malloc(SPECTRA_BUFFER_SIZE);
info->P_H=malloc(SPECTRA_BUFFER_SIZE);
LoadSpectr(file,info);
GetParametersLoadedSpectr(info);
//f=fopen("spectra.txt","wb");
//for(i=0;i<1000;i++) {fprintf(f,"\n\r%d = |%6.1f|",i,info->spectr[i]);}
plot->type_plot=PLOT_SPECTRA_N_EXPERIMENTAL;
plot->Nmin=info->Nmin;
plot->Naverege=info->Nbusis;
plot->Nmax=info->Nmax;
plot->Nspectr=info->spectr;
plot->Nspectr_theoretical=info->spectr_theoretical;
plot->ChannelMax=info->length_spectr-1;
plot->ChannelMin=0;
plot->ChannelNull=info->ChannelNull;
plot->VelosityMax=info->vmax;
plot->VelosityMin=info->vmin;
plot->Pmax=1.0;
plot->Pmin=info->Nmin/info->Nmax;
scr->PlotP_H=MODE_SHOW_SPECTR;
/*
fprintf(f,"\n info->Nmin=%6.6f",info->Nmin);
fprintf(f,"\n info->Nbusis=%6.6f",info->Nbusis);
fprintf(f,"\n info->Nmax=%6.6f",info->Nmax);
fprintf(f,"\n plot->ChannelMax=%6.6f",plot->ChannelMax);
fprintf(f,"\n plot->ChannelNull=%6.6f",plot->ChannelNull);
fprintf(f,"\n plot->VelosityMax=info->vmax;=%6.6f",info->vmax);
fprintf(f,"\n plot->VelosityMin=info->vmin=%6.6f",info->vmin);
fprintf(f,"\n plot->Nmin=%6.6f",plot->Nmin);
fprintf(f,"\n plot->Naverege=%6.6f", plot->Naverege);
fprintf(f,"\n plot->Nmax=%6.6f",plot->Nmax);
fprintf(f,"\n plot->ChannelMax=%6.6f",plot->ChannelMax);
fprintf(f,"\n plot->ChannelNull=%6.6f",plot->ChannelNull);
fprintf(f,"\n plot->VelosityMax=info->vmax;=%6.6f",plot->VelosityMax);
fprintf(f,"\n plot->VelosityMin=info->vmin=%6.6f",plot->VelosityMin);
fclose(f);
*/
}
Code: Select all
int main(int argc, char **argv)
{
char exit_status;
struct WINDOW *win;
struct SCREEN *scr;
struct PLOTINFO *plot;
struct lorents_information *lorents;
struct X *x_c;
struct HEADER *Parend;
struct MESSAGE *Message;
struct process_table_entry *ProcessInformation;
struct ControlBookmark2 *Bookmark2;
struct ControlProgressbar *CalculationProgress;
dword *controls;
dword x,y,mouse_buttons;
int i;
int key;
int count_iteration;
float step_iteration;
unsigned char sound_end_calculation[]={150,64,0,0,0};
char *pathspectr;
FILE* f;
pathspectr=argv[1];
printf("\n\rpath=%s",pathspectr);
_ksys_set_wanted_events(0x67);
count_iteration=0;
printf("\n\rbegin init libGUI");
Init_libGUI();
printf("\n\rlibGUI initialized succesfull.");
win=malloc(sizeof(struct WINDOW));
lorents=malloc(sizeof(struct lorents_information));
x_c=malloc(sizeof(struct X));
scr=malloc(sizeof(struct SCREEN));
plot=malloc(sizeof(struct PLOTINFO));
win->posx=WINDOW_POSX;
win->posy=WINDOW_POSY;
win->sizex=WINDOW_SIZEX;
win->sizey=WINDOW_SIZEY;
printf("\n\rbegin load spectra");
LoadSpectra(pathspectr,lorents,plot,scr); //------------------------------------------------
f=fopen("info.txt","wb");
fprintf(f,"\n info->Nmin=%6.6f",lorents->Nmin);
fprintf(f,"\n info->Nbusis=%6.6f",lorents->Nbusis);
fprintf(f,"\n info->Nmax=%6.6f",lorents->Nmax);
fprintf(f,"\n plot->ChannelMax=%6.6f",plot->ChannelMax);
fprintf(f,"\n plot->ChannelNull=%6.6f",plot->ChannelNull);
fprintf(f,"\n plot->VelosityMax=info->vmax;=%6.6f",plot->VelosityMax);
fprintf(f,"\n plot->VelosityMin=info->vmin=%6.6f",plot->VelosityMin);
fclose(f);
printf("\n\rspectra loaded");
draw_window(win);
controls=malloc(TOTAL_NUMBERS_OF_CONTROLS*100);
Parend=(struct HEADER *)malloc(sizeof(struct HEADER));
Message=(struct MESSAGE *)malloc(sizeof(struct MESSAGE));
ProcessInformation=malloc(sizeof(struct process_table_entry));
printf("\n\rbegin create interface");
CraeteInterface(controls,Parend,win,scr,plot);
printf("\n\rinterface created");
printf("\n\rbegin display information");
DisplayInformation(controls,lorents);
printf("\n\rinformation displayed");
Message->type=MESSAGE_FULL_REDRAW_ALL;
Message->arg1=0;
Message->arg2=0;
Message->arg3=0;
printf("\n\rbegin send first message");
SendMessage(Parend,Message);
printf("\n\rmessage sended");