Main.cpp:
#include <iostream>
#include "Graphics.h"
int main(){
int gd = DETECT, gm;
initgraph(&gd, &gm, NULL);
line(140, 140, 350, 100);
line(140, 140, 200, 200);
line(350, 140, 200, 200);
getch();
closegraph();
}
g++ -o app %1 -L user32.lib -L kernel32.lib -L gdi32.lib -A libbgi.a -L -lbgi -L -lgdi32 -L -lcomdlg32 -L -luuid -L -loleaut32 -L -lole32
gcc ver 4.6.2
graphics.h
winbgim.h
libbgi.a
Вывод компилятора:
C:\Users\Egor\AppData\Local\Temp\cceEolOn.o:main.cpp:(.text+0x4c68): undefined reference to `operator new[](unsigned int)'
C:\Users\Egor\AppData\Local\Temp\cceEolOn.o:main.cpp:(.text+0x4d78): undefined reference to `operator delete[](void*)'
C:\Users\Egor\AppData\Local\Temp\cceEolOn.o:main.cpp:(.text+0x4e46): undefined reference to `__cxa_guard_acquire'
C:\Users\Egor\AppData\Local\Temp\cceEolOn.o:main.cpp:(.text+0x4e81): undefined reference to `__cxa_guard_release'
C:\Users\Egor\AppData\Local\Temp\cceEolOn.o:main.cpp:(.text+0x500a): undefined reference to `__cxa_guard_abort'
C:\Users\Egor\AppData\Local\Temp\cceEolOn.o:main.cpp:(.text+0x5972): undefined reference to `operator new[](unsigned int)'
C:\Users\Egor\AppData\Local\Temp\cceEolOn.o:main.cpp:(.text+0x59e1): undefined reference to `operator delete[](void*)'
C:\Users\Egor\AppData\Local\Temp\cceEolOn.o:main.cpp:(.text+0x6277): undefined reference to `operator new[](unsigned int)'
C:\Users\Egor\AppData\Local\Temp\cceEolOn.o:main.cpp:(.text+0x6351): undefined reference to `operator delete[](void*)'
C:\Users\Egor\AppData\Local\Temp\cceEolOn.o:main.cpp:(.text+0x6362): undefined reference to `operator delete[](void*)'
C:\Users\Egor\AppData\Local\Temp\cceEolOn.o:main.cpp:(.eh_frame+0xcef): undefined reference to `__gxx_personality_v0'
P.s. Это я убрал, теперь другое:
<command-line>:0:1: error: missing '(' after predicate
In file included from L:\Dev\ray casting\cpp\main.cpp:1:0:
l:\soft\mingw\bin\../lib/gcc/mingw32/4.6.2/../../../../include/graphics.h:302:40: error: redefinition of 'int right'
l:\soft\mingw\bin\../lib/gcc/mingw32/4.6.2/../../../../include/graphics.h:302:27: error: 'int right' previously declared here
<command-line>:0:1: error: missing '(' after predicate
In file included from L:\Dev\ray casting\cpp\main.cpp:1:0:
l:\soft\mingw/include/graphics.h:302:40: error: redefinition of 'int right'
l:\soft\mingw\include/graphics.h:302:27: error: 'int right' previously declared here