C++ multiple undefined reference error MinGW -
i have add graphics.h
, winbgim.h
libraries, , libbgi.a
mingw. can found here. archive has folders indicate directory should placed under /mingw
. have added -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32
link options, specified in following link: http://www.infobits.ro/medii-mingw-developer-studio3.php. (sorry, it's in romanian, images quite easy understand).
when try run following code:
#include <graphics.h> #include <iostream> using namespace std; int main() { int gdriver = detect, gmode; initgraph(&gdriver, &gmode, ""); if (graphresult()) { cout<<"tentativa nereusita ..."; } else { cout<<"everything working!"; setcolor(red); moveto(0,0); lineto(getmaxx(),getmaxy()); } cout<<endl<<"press close"; getch(); return 0; }
i error log "undefined reference error". error log is:
c:\oji\mingwstudio\mingw\bin\..\lib\gcc-lib\mingw32\3.3.1\..\..\..\libbgi.a(winbgi.o)(.text+0xbd2):winbgi.cxx: undefined reference `std::string::_rep::_s_empty_rep_storage' c:\oji\mingwstudio\mingw\bin\..\lib\gcc-lib\mingw32\3.3.1\..\..\..\libbgi.a(winbgi.o)(.text+0x1b5e):winbgi.cxx: undefined reference `std::string::_rep::_s_empty_rep_storage' c:\oji\mingwstudio\mingw\bin\..\lib\gcc-lib\mingw32\3.3.1\..\..\..\libbgi.a(winbgi.o)(.text+0x1dcc):winbgi.cxx: undefined reference `__gnu_cxx::__exchange_and_add(int volatile*, int)' c:\oji\mingwstudio\mingw\bin\..\lib\gcc-lib\mingw32\3.3.1\..\..\..\libbgi.a(winthread.o)(.text+0x522):winthread.cxx: undefined reference `std::string::_rep::_s_empty_rep_storage' c:\oji\mingwstudio\mingw\bin\..\lib\gcc-lib\mingw32\3.3.1\..\..\..\libbgi.a(winthread.o)(.text+0x57e):winthread.cxx: undefined reference `__gnu_cxx::__exchange_and_add(int volatile*, int)'
any idea?
Comments
Post a Comment