dev-cpp-users Mailing List for Dev-C++ (Page 151)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(15) |
Oct
(115) |
Nov
(154) |
Dec
(258) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(377) |
Feb
(260) |
Mar
(249) |
Apr
(188) |
May
(152) |
Jun
(150) |
Jul
(195) |
Aug
(202) |
Sep
(200) |
Oct
(286) |
Nov
(242) |
Dec
(165) |
| 2002 |
Jan
(245) |
Feb
(241) |
Mar
(239) |
Apr
(346) |
May
(406) |
Jun
(369) |
Jul
(418) |
Aug
(357) |
Sep
(362) |
Oct
(597) |
Nov
(455) |
Dec
(344) |
| 2003 |
Jan
(446) |
Feb
(397) |
Mar
(515) |
Apr
(524) |
May
(377) |
Jun
(387) |
Jul
(532) |
Aug
(364) |
Sep
(294) |
Oct
(352) |
Nov
(295) |
Dec
(327) |
| 2004 |
Jan
(416) |
Feb
(318) |
Mar
(324) |
Apr
(249) |
May
(259) |
Jun
(218) |
Jul
(212) |
Aug
(259) |
Sep
(158) |
Oct
(162) |
Nov
(214) |
Dec
(169) |
| 2005 |
Jan
(111) |
Feb
(165) |
Mar
(199) |
Apr
(147) |
May
(131) |
Jun
(163) |
Jul
(235) |
Aug
(136) |
Sep
(84) |
Oct
(88) |
Nov
(113) |
Dec
(100) |
| 2006 |
Jan
(85) |
Feb
(119) |
Mar
(33) |
Apr
(31) |
May
(56) |
Jun
(68) |
Jul
(18) |
Aug
(62) |
Sep
(33) |
Oct
(55) |
Nov
(19) |
Dec
(40) |
| 2007 |
Jan
(22) |
Feb
(49) |
Mar
(34) |
Apr
(51) |
May
(66) |
Jun
(43) |
Jul
(116) |
Aug
(57) |
Sep
(70) |
Oct
(69) |
Nov
(97) |
Dec
(86) |
| 2008 |
Jan
(32) |
Feb
(47) |
Mar
(106) |
Apr
(67) |
May
(28) |
Jun
(39) |
Jul
(31) |
Aug
(25) |
Sep
(18) |
Oct
(25) |
Nov
(5) |
Dec
(21) |
| 2009 |
Jan
(33) |
Feb
(27) |
Mar
(27) |
Apr
(22) |
May
(22) |
Jun
(10) |
Jul
(17) |
Aug
(9) |
Sep
(21) |
Oct
(13) |
Nov
(4) |
Dec
(11) |
| 2010 |
Jan
(10) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(26) |
Nov
(9) |
Dec
(1) |
| 2011 |
Jan
(21) |
Feb
(16) |
Mar
(4) |
Apr
(19) |
May
(26) |
Jun
(9) |
Jul
(6) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(2) |
Dec
(1) |
| 2012 |
Jan
(4) |
Feb
(7) |
Mar
(4) |
Apr
|
May
(1) |
Jun
(10) |
Jul
(1) |
Aug
(1) |
Sep
(18) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
| 2013 |
Jan
(4) |
Feb
(2) |
Mar
(15) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
|
| 2014 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(4) |
| 2015 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(9) |
Nov
(35) |
Dec
(6) |
| 2016 |
Jan
(7) |
Feb
(10) |
Mar
(10) |
Apr
(9) |
May
(13) |
Jun
(9) |
Jul
(1) |
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Scott B. <doo...@ya...> - 2005-02-21 01:04:13
|
Regarding my previous message about the fltk compile error, I have now found a solution. If I select File->new->project->gui->fltk then the program compiles and runs okay. Previously I had selected the 'console' or 'empty project' options and then tried to link the library files manually in the Project Options menu, which led to the compile error. --------------------------------- Find local movie times and trailers on Yahoo! Movies. |
|
From: Alfred P. R. <al...@ya...> - 2005-02-20 22:44:02
|
This is solved by doing a search in the library files for the text 'DeleteObject@4' as an example. Don't mind the link, as IE isn't smart enough to know that the above isn't an e-mail address. Once found, add it to the linker line. Searching on my implementation,: $ grep -ri 'DeleteObject@4' * <in dev-cpp/lib, BTW> Binary file libfltk.a matches Binary file libgdi32.a matches My take is that the actual entity referenced is in libgdi32.a and not libfltk.a, which you actually use in your link line below. I've had this problem numerous times, and am very thankful for the Unix-like capability that has finally been ported to Windows, as exampled by grep. The MS DOS command, BTW, is findstr, which is a poor subsitute for grep, IMHO. I'm working on an application right now with 9 modules that uses: #include <FL/Fl.H> #include <FL/Fl_Ask.H> #include <FL/Fl_Button.H> #include <FL/FL_Clock.H> #include <FL/Fl_Check_Button.H> #include <FL/Fl_Double_Window.H> #include <FL/Fl_Group.H> #include <FL/Fl_Image.H> #include <FL/Fl_Input.H> #include <FL/Fl_Light_Button.H> #include <FL/Fl_Progress.H> #include <FL/Fl_Round_Button.H> #include <FL/Fl_Text_Buffer.H> #include <FL/Fl_Text_Display.H> I've got to manually include in the Project Options-->Parameters-->Linker the following: ../Dev-Cpp/lib/libfltk.a ../Dev-Cpp/lib/libole32.a ../Dev-Cpp/lib/libuuid.a ../Dev-Cpp/lib/libwsock32.a Or I get reference errors. I have no clue as to why Dev-Cpp doesn't find them on it's own. Scott Brown <doo...@ya...> wrote: Hello, I am trying to compile an example program which uses FLTK, but I get the following error message: Compiler: Default compiler Building Makefile: "C:\Dev-Cpp\MyProjects\Makefile.win" Executing make... make.exe -f "C:\Dev-Cpp\MyProjects\Makefile.win" all g++.exe -c fltkTest.cpp -o fltkTest.o -I"C:/Dev-Cpp/include/c++/3.3.1" -I"C:/Dev-Cpp/include/c++/3.3.1/mingw32" -I"C:/Dev-Cpp/include/c++/3.3.1/backward" -I"C:/Dev-Cpp/lib/gcc-lib/mingw32/3.3.1/include" -I"C:/Dev-Cpp/include/FL" -I"C:/Dev-Cpp/include" fltkTest.cpp:25:2: warning: no newline at end of file g++.exe fltkTest.o -o "FLTKProject2.exe" -L"C:/Dev-Cpp/lib" ../lib/libfltk.a ../lib/libfltk_forms.a ../lib/libfltk_gl.a ../lib/libfltk_images.a ../lib/libfltk.a(Fl.o)(.text+0x74a):Fl.cxx: undefined reference to `DeleteObject@4' <snip> Alfred P. Reaud |
|
From: Scott B. <doo...@ya...> - 2005-02-20 14:49:20
|
Hello, I am trying to compile an example program which uses FLTK, but I get the following error message: Compiler: Default compiler Building Makefile: "C:\Dev-Cpp\MyProjects\Makefile.win" Executing make... make.exe -f "C:\Dev-Cpp\MyProjects\Makefile.win" all g++.exe -c fltkTest.cpp -o fltkTest.o -I"C:/Dev-Cpp/include/c++/3.3.1" -I"C:/Dev-Cpp/include/c++/3.3.1/mingw32" -I"C:/Dev-Cpp/include/c++/3.3.1/backward" -I"C:/Dev-Cpp/lib/gcc-lib/mingw32/3.3.1/include" -I"C:/Dev-Cpp/include/FL" -I"C:/Dev-Cpp/include" fltkTest.cpp:25:2: warning: no newline at end of file g++.exe fltkTest.o -o "FLTKProject2.exe" -L"C:/Dev-Cpp/lib" ../lib/libfltk.a ../lib/libfltk_forms.a ../lib/libfltk_gl.a ../lib/libfltk_images.a ../lib/libfltk.a(Fl.o)(.text+0x74a):Fl.cxx: undefined reference to `DeleteObject@4' ../lib/libfltk.a(Fl.o)(.text+0x1615):Fl.cxx: undefined reference to `DeleteObject@4' ../lib/libfltk.a(Fl.o)(.text+0x172c):Fl.cxx: undefined reference to `CreateRectRgn@16' ../lib/libfltk.a(Fl.o)(.text+0x1741):Fl.cxx: undefined reference to `CombineRgn@16' ../lib/libfltk.a(Fl.o)(.text+0x174a):Fl.cxx: undefined reference to `DeleteObject@4' ../lib/libfltk.a(Fl.o)(.text+0x1776):Fl.cxx: undefined reference to `CreateRectRgn@16' ../lib/libfltk.a(Fl.o)(.text+0x178d):Fl.cxx: undefined reference to `DeleteObject@4' ../lib/libfltk.a(Fl.o)(.text+0x721):Fl.cxx: undefined reference to `GdiFlush@0' ../lib/libfltk.a(Fl_x.o)(.text+0x590):Fl_x.cxx: undefined reference to `select@20' ../lib/libfltk.a(Fl_x.o)(.text+0x5e2):Fl_x.cxx: undefined reference to `__WSAFDIsSet@8' ../lib/libfltk.a(Fl_x.o)(.text+0x5fc):Fl_x.cxx: undefined reference to `__WSAFDIsSet@8' ../lib/libfltk.a(Fl_x.o)(.text+0x614):Fl_x.cxx: undefined reference to `__WSAFDIsSet@8' ../lib/libfltk.a(Fl_x.o)(.text+0x725):Fl_x.cxx: undefined reference to `select@20' ../lib/libfltk.a(Fl_x.o)(.text+0xe83):Fl_x.cxx: undefined reference to `CreateRectRgn@16' ../lib/libfltk.a(Fl_x.o)(.text+0xf0c):Fl_x.cxx: undefined reference to `CombineRgn@16' ../lib/libfltk.a(Fl_x.o)(.text+0xf15):Fl_x.cxx: undefined reference to `DeleteObject@4' ../lib/libfltk.a(Fl_x.o)(.text+0xf2d):Fl_x.cxx: undefined reference to `CreateRectRgn@16' ../lib/libfltk.a(Fl_x.o)(.text+0x1589):Fl_x.cxx: undefined reference to `UpdateColors@4' ../lib/libfltk.a(Fl_x.o)(.text+0x1c0a):Fl_x.cxx: undefined reference to `RegisterDragDrop@8' ../lib/libfltk.a(Fl_x.o)(.text+0x1c36):Fl_x.cxx: undefined reference to `OleInitialize@4' ../lib/libfltk.a(Fl_x.o)(.text+0x2126):Fl_x.cxx: undefined reference to `SetTextAlign@8' ../lib/libfltk.a(Fl_x.o)(.text+0x2133):Fl_x.cxx: undefined reference to `SetBkMode@8' ../lib/libfltk.a(fl_rect.o)(.text+0x28):fl_rect.cxx: undefined reference to `MoveToEx@16' ../lib/libfltk.a(fl_rect.o)(.text+0x3d):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x51):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x62):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x73):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0xf6):fl_rect.cxx: undefined reference to `MoveToEx@16' ../lib/libfltk.a(fl_rect.o)(.text+0x108):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x145):fl_rect.cxx: undefined reference to `MoveToEx@16' ../lib/libfltk.a(fl_rect.o)(.text+0x154):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x162):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x1a5):fl_rect.cxx: undefined reference to `MoveToEx@16' ../lib/libfltk.a(fl_rect.o)(.text+0x1b4):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x1c5):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x1d5):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x20f):fl_rect.cxx: undefined reference to `MoveToEx@16' ../lib/libfltk.a(fl_rect.o)(.text+0x21d):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x265):fl_rect.cxx: undefined reference to `MoveToEx@16' ../lib/libfltk.a(fl_rect.o)(.text+0x274):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x282):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x2c5):fl_rect.cxx: undefined reference to `MoveToEx@16' ../lib/libfltk.a(fl_rect.o)(.text+0x2d4):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x2e5):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x2f5):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x32c):fl_rect.cxx: undefined reference to `MoveToEx@16' ../lib/libfltk.a(fl_rect.o)(.text+0x33b):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x351):fl_rect.cxx: undefined reference to `SetPixel@16' ../lib/libfltk.a(fl_rect.o)(.text+0x37c):fl_rect.cxx: undefined reference to `MoveToEx@16' ../lib/libfltk.a(fl_rect.o)(.text+0x391):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x39f):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x3b5):fl_rect.cxx: undefined reference to `SetPixel@16' ../lib/libfltk.a(fl_rect.o)(.text+0x3d7):fl_rect.cxx: undefined reference to `MoveToEx@16' ../lib/libfltk.a(fl_rect.o)(.text+0x3eb):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x3fe):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x40c):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x436):fl_rect.cxx: undefined reference to `MoveToEx@16' ../lib/libfltk.a(fl_rect.o)(.text+0x44b):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x45e):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x471):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x47f):fl_rect.cxx: undefined reference to `LineTo@12' ../lib/libfltk.a(fl_rect.o)(.text+0x4c9):fl_rect.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(fl_rect.o)(.text+0x4df):fl_rect.cxx: undefined reference to `Polygon@12' ../lib/libfltk.a(fl_rect.o)(.text+0x535):fl_rect.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(fl_rect.o)(.text+0x54b):fl_rect.cxx: undefined reference to `Polygon@12' ../lib/libfltk.a(fl_rect.o)(.text+0x57c):fl_rect.cxx: undefined reference to `SetPixel@16' ../lib/libfltk.a(fl_rect.o)(.text+0x5b6):fl_rect.cxx: undefined reference to `SelectClipRgn@8' ../lib/libfltk.a(fl_rect.o)(.text+0x5dd):fl_rect.cxx: undefined reference to `DeleteObject@4' ../lib/libfltk.a(fl_rect.o)(.text+0x644):fl_rect.cxx: undefined reference to `CreateRectRgn@16' ../lib/libfltk.a(fl_rect.o)(.text+0x660):fl_rect.cxx: undefined reference to `CombineRgn@16' ../lib/libfltk.a(fl_rect.o)(.text+0x68f):fl_rect.cxx: undefined reference to `CreateRectRgn@16' ../lib/libfltk.a(fl_rect.o)(.text+0x6f4):fl_rect.cxx: undefined reference to `DeleteObject@4' ../lib/libfltk.a(fl_rect.o)(.text+0x789):fl_rect.cxx: undefined reference to `RectInRegion@8' ../lib/libfltk.a(fl_rect.o)(.text+0x7d6):fl_rect.cxx: undefined reference to `CreateRectRgn@16' ../lib/libfltk.a(fl_rect.o)(.text+0x7e5):fl_rect.cxx: undefined reference to `CreateRectRgn@16' ../lib/libfltk.a(fl_rect.o)(.text+0x7f1):fl_rect.cxx: undefined reference to `CombineRgn@16' ../lib/libfltk.a(fl_rect.o)(.text+0x7ff):fl_rect.cxx: undefined reference to `EqualRgn@8' ../lib/libfltk.a(fl_rect.o)(.text+0x80e):fl_rect.cxx: undefined reference to `DeleteObject@4' ../lib/libfltk.a(fl_rect.o)(.text+0x814):fl_rect.cxx: undefined reference to `DeleteObject@4' ../lib/libfltk.a(fl_rect.o)(.text+0x82a):fl_rect.cxx: undefined reference to `GetRgnBox@8' ../lib/libfltk.a(fl_dnd.o)(.text+0x5b):fl_dnd.cxx: undefined reference to `DoDragDrop@16' ../lib/libfltk.a(fl_dnd.o)(.text$_ZN12FLDropSource14QueryInterfaceERK5_GUIDPPv+0xb):fl_dnd.cxx: undefined reference to `IID_IUnknown' ../lib/libfltk.a(fl_dnd.o)(.text$_ZN12FLDropSource14QueryInterfaceERK5_GUIDPPv+0x1f):fl_dnd.cxx: undefined reference to `IID_IDropSource' ../lib/libfltk.a(fl_dnd.o)(.text$_ZN12FLDataObject14QueryInterfaceERK5_GUIDPPv+0xb):fl_dnd.cxx: undefined reference to `IID_IUnknown' ../lib/libfltk.a(fl_dnd.o)(.text$_ZN12FLDataObject14QueryInterfaceERK5_GUIDPPv+0x1f):fl_dnd.cxx: undefined reference to `IID_IDataObject' ../lib/libfltk.a(fl_dnd.o)(.text$_ZN12FLDropTarget14QueryInterfaceERK5_GUIDPPv+0xb):fl_dnd.cxx: undefined reference to `IID_IUnknown' ../lib/libfltk.a(fl_dnd.o)(.text$_ZN12FLDropTarget14QueryInterfaceERK5_GUIDPPv+0x1f):fl_dnd.cxx: undefined reference to `IID_IDropTarget' ../lib/libfltk.a(fl_dnd.o)(.text$_ZN12FLDropTarget4DropEP11IDataObjectm8tagPOINTPm+0x10d):fl_dnd.cxx: undefined reference to `ReleaseStgMedium@4' ../lib/libfltk.a(fl_dnd.o)(.text$_ZN12FLDropTarget4DropEP11IDataObjectm8tagPOINTPm+0x1ed):fl_dnd.cxx: undefined reference to `ReleaseStgMedium@4' ../lib/libfltk.a(Fl_get_system_colors.o)(.text+0xad5):Fl_get_system_colors.cxx: undefined reference to `DeleteObject@4' ../lib/libfltk.a(fl_color.o)(.text+0x1e):fl_color.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(fl_color.o)(.text+0x38):fl_color.cxx: undefined reference to `CreatePen@12' ../lib/libfltk.a(fl_color.o)(.text+0x7a):fl_color.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(fl_color.o)(.text+0xc1):fl_color.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(fl_color.o)(.text+0xd7):fl_color.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(fl_color.o)(.text+0xec):fl_color.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(fl_color.o)(.text+0xf6):fl_color.cxx: undefined reference to `DeleteObject@4' ../lib/libfltk.a(fl_color.o)(.text+0x118):fl_color.cxx: undefined reference to `CreateSolidBrush@4' ../lib/libfltk.a(fl_color.o)(.text+0x12e):fl_color.cxx: undefined reference to `CreatePen@12' ../lib/libfltk.a(fl_color.o)(.text+0x154):fl_color.cxx: undefined reference to `CreatePen@12' ../lib/libfltk.a(fl_color.o)(.text+0x1d0):fl_color.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(fl_color.o)(.text+0x2d9):fl_color.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(fl_color.o)(.text+0x38d):fl_color.cxx: undefined reference to `CreateSolidBrush@4' ../lib/libfltk.a(fl_color.o)(.text+0x3fa):fl_color.cxx: undefined reference to `DeleteObject@4' ../lib/libfltk.a(fl_color.o)(.text+0x4cc):fl_color.cxx: undefined reference to `SelectPalette@12' ../lib/libfltk.a(fl_color.o)(.text+0x4da):fl_color.cxx: undefined reference to `RealizePalette@4' ../lib/libfltk.a(fl_color.o)(.text+0x4fb):fl_color.cxx: undefined reference to `GetDeviceCaps@8' ../lib/libfltk.a(fl_color.o)(.text+0x55b):fl_color.cxx: undefined reference to `CreatePalette@4' ../lib/libfltk.a(fl_font.o)(.text+0x58):fl_font.cxx: undefined reference to `CreateFontA@56' ../lib/libfltk.a(fl_font.o)(.text+0x77):fl_font.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(fl_font.o)(.text+0x8a):fl_font.cxx: undefined reference to `GetTextMetricsA@8' ../lib/libfltk.a(fl_font.o)(.text+0xa2):fl_font.cxx: undefined reference to `GetCharWidthA@16' ../lib/libfltk.a(fl_font.o)(.text+0x158):fl_font.cxx: undefined reference to `CreateFontA@56' ../lib/libfltk.a(fl_font.o)(.text+0x178):fl_font.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(fl_font.o)(.text+0x18b):fl_font.cxx: undefined reference to `GetTextMetricsA@8' ../lib/libfltk.a(fl_font.o)(.text+0x1a3):fl_font.cxx: undefined reference to `GetCharWidthA@16' ../lib/libfltk.a(fl_font.o)(.text+0x218):fl_font.cxx: undefined reference to `DeleteObject@4' ../lib/libfltk.a(fl_font.o)(.text+0x248):fl_font.cxx: undefined reference to `DeleteObject@4' ../lib/libfltk.a(fl_font.o)(.text+0x476):fl_font.cxx: undefined reference to `SetTextColor@8' ../lib/libfltk.a(fl_font.o)(.text+0x48c):fl_font.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(fl_font.o)(.text+0x4a8):fl_font.cxx: undefined reference to `TextOutA@20' ../lib/libfltk.a(fl_font.o)(.text+0x4b6):fl_font.cxx: undefined reference to `SetTextColor@8' ../lib/libfltk.a(Fl_Pixmap.o)(.text+0x13c):Fl_Pixmap.cxx: undefined reference to `CreateCompatibleDC@4' ../lib/libfltk.a(Fl_Pixmap.o)(.text+0x149):Fl_Pixmap.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(Fl_Pixmap.o)(.text+0x173):Fl_Pixmap.cxx: undefined reference to `BitBlt@36' ../lib/libfltk.a(Fl_Pixmap.o)(.text+0x17e):Fl_Pixmap.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(Fl_Pixmap.o)(.text+0x1a8):Fl_Pixmap.cxx: undefined reference to `BitBlt@36' ../lib/libfltk.a(Fl_Pixmap.o)(.text+0x1ae):Fl_Pixmap.cxx: undefined reference to `DeleteDC@4' ../lib/libfltk.a(Fl_Pixmap.o)(.text+0x1f5):Fl_Pixmap.cxx: undefined reference to `CreateCompatibleBitmap@12' ../lib/libfltk.a(Fl_Pixmap.o)(.text+0x267):Fl_Pixmap.cxx: undefined reference to `DeleteDC@4' ../lib/libfltk.a(Fl_Pixmap.o)(.text+0x3da):Fl_Pixmap.cxx: undefined reference to `DeleteObject@4' ../lib/libfltk.a(Fl_Bitmap.o)(.text+0xb6):Fl_Bitmap.cxx: undefined reference to `CreateBitmap@20' ../lib/libfltk.a(Fl_Bitmap.o)(.text+0x112):Fl_Bitmap.cxx: undefined reference to `GetDeviceCaps@8' ../lib/libfltk.a(Fl_Bitmap.o)(.text+0x122):Fl_Bitmap.cxx: undefined reference to `GetDeviceCaps@8' ../lib/libfltk.a(Fl_Bitmap.o)(.text+0x233):Fl_Bitmap.cxx: undefined reference to `CreateBitmap@20' ../lib/libfltk.a(Fl_Bitmap.o)(.text+0x30b):Fl_Bitmap.cxx: undefined reference to `DeleteObject@4' ../lib/libfltk.a(Fl_Bitmap.o)(.text+0x50b):Fl_Bitmap.cxx: undefined reference to `CreateCompatibleDC@4' ../lib/libfltk.a(Fl_Bitmap.o)(.text+0x51b):Fl_Bitmap.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(Fl_Bitmap.o)(.text+0x530):Fl_Bitmap.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(Fl_Bitmap.o)(.text+0x554):Fl_Bitmap.cxx: undefined reference to `BitBlt@36' ../lib/libfltk.a(Fl_Bitmap.o)(.text+0x55a):Fl_Bitmap.cxx: undefined reference to `DeleteDC@4' ../lib/libfltk.a(Fl_Image.o)(.text+0x38a):Fl_Image.cxx: undefined reference to `DeleteObject@4' ../lib/libfltk.a(Fl_Image.o)(.text+0xa60):Fl_Image.cxx: undefined reference to `CreateCompatibleDC@4' ../lib/libfltk.a(Fl_Image.o)(.text+0xa6d):Fl_Image.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(Fl_Image.o)(.text+0xa97):Fl_Image.cxx: undefined reference to `BitBlt@36' ../lib/libfltk.a(Fl_Image.o)(.text+0xaa2):Fl_Image.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(Fl_Image.o)(.text+0xacd):Fl_Image.cxx: undefined reference to `BitBlt@36' ../lib/libfltk.a(Fl_Image.o)(.text+0xad3):Fl_Image.cxx: undefined reference to `DeleteDC@4' ../lib/libfltk.a(Fl_Image.o)(.text+0xb14):Fl_Image.cxx: undefined reference to `CreateCompatibleBitmap@12' ../lib/libfltk.a(Fl_Image.o)(.text+0xb73):Fl_Image.cxx: undefined reference to `DeleteDC@4' ../lib/libfltk.a(Fl_Double_Window.o)(.text+0x1e):Fl_Double_Window.cxx: undefined reference to `CreateCompatibleDC@4' ../lib/libfltk.a(Fl_Double_Window.o)(.text+0x2d):Fl_Double_Window.cxx: undefined reference to `SetTextAlign@8' ../lib/libfltk.a(Fl_Double_Window.o)(.text+0x35):Fl_Double_Window.cxx: undefined reference to `SetBkMode@8' ../lib/libfltk.a(Fl_Double_Window.o)(.text+0x4c):Fl_Double_Window.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(Fl_Double_Window.o)(.text+0x66):Fl_Double_Window.cxx: undefined reference to `SelectPalette@12' ../lib/libfltk.a(Fl_Double_Window.o)(.text+0x7e):Fl_Double_Window.cxx: undefined reference to `CreateCompatibleDC@4' ../lib/libfltk.a(Fl_Double_Window.o)(.text+0x8b):Fl_Double_Window.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(Fl_Double_Window.o)(.text+0xb5):Fl_Double_Window.cxx: undefined reference to `BitBlt@36' ../lib/libfltk.a(Fl_Double_Window.o)(.text+0xbb):Fl_Double_Window.cxx: undefined reference to `DeleteDC@4' ../lib/libfltk.a(Fl_Double_Window.o)(.text+0x1c4):Fl_Double_Window.cxx: undefined reference to `DeleteDC@4' ../lib/libfltk.a(Fl_Double_Window.o)(.text+0x1e8):Fl_Double_Window.cxx: undefined reference to `CreateCompatibleBitmap@12' ../lib/libfltk.a(Fl_Double_Window.o)(.text+0x24b):Fl_Double_Window.cxx: undefined reference to `DeleteObject@4' ../lib/libfltk.a(Fl_Double_Window.o)(.text+0x299):Fl_Double_Window.cxx: undefined reference to `DeleteObject@4' ../lib/libfltk.a(fl_arci.o)(.text+0x168):fl_arci.cxx: undefined reference to `Arc@36' ../lib/libfltk.a(fl_arci.o)(.text+0x2f7):fl_arci.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(fl_arci.o)(.text+0x325):fl_arci.cxx: undefined reference to `Pie@36' ../lib/libfltk.a(fl_vertex.o)(.text+0x5e2):fl_vertex.cxx: undefined reference to `SetPixel@16' ../lib/libfltk.a(fl_vertex.o)(.text+0x612):fl_vertex.cxx: undefined reference to `Polyline@12' ../lib/libfltk.a(fl_vertex.o)(.text+0x6ca):fl_vertex.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(fl_vertex.o)(.text+0x6e2):fl_vertex.cxx: undefined reference to `Polygon@12' ../lib/libfltk.a(fl_vertex.o)(.text+0x7ea):fl_vertex.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(fl_vertex.o)(.text+0x808):fl_vertex.cxx: undefined reference to `PolyPolygon@16' ../lib/libfltk.a(fl_vertex.o)(.text+0x963):fl_vertex.cxx: undefined reference to `Arc@36' ../lib/libfltk.a(fl_vertex.o)(.text+0x984):fl_vertex.cxx: undefined reference to `SelectObject@8' ../lib/libfltk.a(fl_vertex.o)(.text+0x9a5):fl_vertex.cxx: undefined reference to `Pie@36' ../lib/libfltk.a(fl_draw_image.o)(.text+0x559):fl_draw_image.cxx: undefined reference to `SetDIBitsToDevice@48' make.exe: *** [FLTKProject2.exe] Error 1 Execution terminated Does anybody know how to fix this ? Scott Find local movie times and trailers on Yahoo! Movies. http://au.movies.yahoo.com |
|
From: Alfred P. R. <al...@ya...> - 2005-02-19 03:59:20
|
Has anybody seen problems with memory leaks while using FLTK? I'm having a problem with Fl_Text_Display trying to delete non-allocated variables in position_to_xy and draw_vline. These are both protected member functions which are called about 5 frames down from where I call statusTextDisplay->insert_position(textpos); with statusTextDisplay being a pointer to a new Fl_Text_Display(...). Alfred P. Reaud |
|
From: Alfred P. R. <al...@ya...> - 2005-02-19 03:46:29
|
astring.clear(); Bah...@ao... wrote: how can i format a string? (clear all data in it) .... i forgot the command lol Alfred P. Reaud |
|
From: <Bah...@ao...> - 2005-02-19 03:00:25
|
how can i format a string? (clear all data in it) .... i forgot the command lol |
|
From: Alfred P. R. <al...@ya...> - 2005-02-18 20:02:06
|
The other thing is file mode, text vs. binary. If you open the file in text mode, and you get an EOF character, the read will terminate, however you can read lines of text. In binary mode, EOF is just another character. I forget offhand which is the default open mode. The sites of pertinence are Microsoft's header library documentation: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcstdlib/html/vclrfcpluspluslibraryoverview.asp and C++ I/O: http://www.cppreference.com/cppio/ --- Gerson Lara <ja...@ya...> wrote: <snip> > So , I can only say tha the trouble seems to be with the opening of > the file. > In my few expreriences, if you read a file to the end, I mean, if you > read "all the file" once, you'll not be able to read again, even > moving the read pointer ( i.e. seekg(0, ios::beg ), unless you close > the file and re-open it. Is that happening to you? I recomend to read > all the file, and close it, so if you need it later, you have it in > RAM, you can modify the contens of the file in RAM and then use > ofstream to replace the contens of the file to actualize it. > > Im a very satisfied user of fstream, i can even read binary files > with it, like bitmap files or .mp3 files. so I can tell fstream is > powerful. So if you can't resolve, tell me more about your code. <snip> ===== Alfred P. Reaud |
|
From: Alfred P. R. <al...@ya...> - 2005-02-18 19:50:30
|
I concur. C/C++ can be self-documenting if you follow Per's advice. Otherwise it can be the most inscrutable code to understand and debug. I've had the two year problem, BTW! --- Per Westermark <pw...@ia...> wrote: <snip> > When declaring variables, always make sure that their names describes > the > variable function in a good way, i.e. > > int number_of_customers; > int remaining_attempts; > int kilobytes_transmitted; > int customer_idx; > ... > > Then you can read your source code two years from now, and understand > what > it does. <snip> ===== Alfred P. Reaud |
|
From: Gerson L. <ja...@ya...> - 2005-02-18 17:04:54
|
Hi all!
Iv'e seen you code, and it's almost axactly like mine!
That has always worked for me, so, I will just show you the little differences, maybe one of them brings your code to life!
int main(int argc, char* argv[]) // classic
{
//just printing the parameter list
cout << "running " << argv[0] << "\nwith parameters:\n";
for(int i = 1; i < argc; i++) cout << argv[i] << " ";
if(argc == 2){
cout << "\nTrying to open file " << argv[1] << endl;
ifstream BMP(argv[1], ios::in);
long FileSize = 0;
if(!BMP){
cout << "Could not open file\n";
return 0;
}else{
cout << "File opened\n";
BMP.seekg(0,ios::end); FileSize = BMP.tellg(); BMP.seekg(0, ios::beg);
p_buffer = new char[FileSize];// careful if you do it this way!
// supose p_buffer is of type char*
cout << "File size: " << FileSize << endl;
BMP.read( p_buffer, FileSize);
////// the rest of code goes here
Now: the differences:
You didn't show how you opened the file, so, may be there a "little thing"
I open it like this:
ifstream BMP(argv[1], ios::in);
or:
ifstream BMP("fichero.txt", ios::in);
the important for me here is: I use ifstream if Im gonna read the file, ofstream for writing. ( fstream ONLY if i need to read/write to the same file in a single operation)
the modes tha I use are: ios::in, ios::out, ios::app, ios::trunc, ios::bin
Then, the way of retrieving the file size is tha same, except for I use only 'ios' instead of ios_'base'.
I don't think that to be so important, but, exist tha posibility that there is some inheritance theme here, using just ios::whatever has allways worked fine for me.
The rest of thing seem to be just fine!!
So , I can only say tha the trouble seems to be with the opening of the file.
In my few expreriences, if you read a file to the end, I mean, if you read "all the file" once, you'll not be able to read again, even moving the read pointer ( i.e. seekg(0, ios::beg ), unless you close the file and re-open it. Is that happening to you? I recomend to read all the file, and close it, so if you need it later, you have it in RAM, you can modify the contens of the file in RAM and then use ofstream to replace the contens of the file to actualize it.
Im a very satisfied user of fstream, i can even read binary files with it, like bitmap files or .mp3 files. so I can tell fstream is powerful. So if you can't resolve, tell me more about your code.
Notes: I use Dev C++ 4.1
Question: what are you doing with this? ::: ap_socket->send(p_buffer, file_size);
is it networking stuff?
Jakob EKlund <mai...@ko...> wrote:
Ok, here is the thing.
I'm trying to read from a file. But for some reason the entire file wont
read.
It's really strange becaus fstream::read() is suposed to read all the data
at once (unlike readsome() )
Has any one of you ever run in to this problem.
The source:
//get the filesize
file.seekg( 0,ios_base::end );
file_size = file.tellg();
file.seekg( 0,ios_base::beg );
p_buffer = new char[file_size];
cout << "file size:" << file_size<
file.read(p_buffer, file_size);
cout << "gcount: "<< file.gcount()<
ap_socket->send(p_buffer, file_size);
delete p_buffer;
the output:
file size:6090
gcount: 5
---------------------------------
|
|
From: Per W. <pw...@ia...> - 2005-02-18 14:59:39
|
This list is - as is quite obvious from the name - for users of Dev-C++, i.e. a free IDE alternative for use instead of Visual C++. Most code discussed here is because of this about the use of different free libraries together with Dev-C++. One very good framework for platform-independant code is wxWidgets. It contains a large number of nice example programs - windows applications, graphics, networking, etc. The wxWidgets library is possible to use with most compilers - including VC++. Information, examples etc are available at: http://www.wxwidgets.org/ /Per W On Fri, 18 Feb 2005, Gerald Humphreys wrote: > Hello Everyone > > This is my first post and i am just starting c++. So if you could help me i > would appreciate it. I am a vb programmer wanting to go into c++. My first > visual basic program was just a small calculate with 2 text boxes and a > Button, now when you enter in an integer in the 2 text boxes and click on the > Button it will multply those and give the answer in a message box. I am > asking if someone can please show me how to do that in a c++ app not in the > concoll way. It would be nice if soneone can do it it Microsoft visual c++. > > Regards > Gerald Humphreys |
|
From: Per W. <pw...@ia...> - 2005-02-18 14:52:47
|
First of all - never add a prefix "var" or similar that doesn't mean anytning. Second - a variable name may contain digits, but it may not start with a digit, so "1" is not a valid variable name. When declaring variables, always make sure that their names describes the variable function in a good way, i.e. int number_of_customers; int remaining_attempts; int kilobytes_transmitted; int customer_idx; ... Then you can read your source code two years from now, and understand what it does. A variable named "test" doesn't give much information about it's use. You might possibly be testing something, but testing what? /Per W On Fri, 18 Feb 2005, Gerald Humphreys wrote: > Hi all > > I have been on a couple of c++ websites. Some of them say to declair an > interger vairable you will you this code. > > int var1; > int vartest; > > And some of them say this > > int 1; > int test; > > Which one is correct do you have to use that var. > > Regards > Gerald > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Paul P. <pog...@gm...> - 2005-02-18 13:29:16
|
Hi.
Suppose I have a code like this:
=09template <class X, typename T>
=09class I {
=09 ...
=09};
=09class A {
=09 ...
=09};
and would like to define `IA <T>' to be exactly the same type as `I <A, T=
>'.
Sort of a templated typedef. However, what comes to mind doesn't work:
=09template <typename T>
=09typedef I <A, T> IA;
=09test.cpp:18: template declaration of `typedef class I<A, T> IA'
or like this:
=09template <typename T>
=09typedef I <A, T> IA <T>;
=09test.cpp:18: template-id `IA<T>' used as a declarator
=09test.cpp:18: template declaration of `typedef class I<A, T> IA'
Is there a way to do this in C++?
Paul
P.S. I'm not subscribed, please CC me.
|
|
From: Jakob E. <mai...@ko...> - 2005-02-18 13:10:22
|
GUI programming in C++ is alot harder than in VB(atleast that's what I've= =20 heard, I've never used vb). A good startingpoint is probably this site: http://www.winprog.org/tutorial/ Den 2005-02-18 09:44:14 skrev Gerald Humphreys <gl...@we...>: > Hello Everyone > > This is my first post and i am just starting c++. So if you could help = =20 > me i > would appreciate it. I am a vb programmer wanting to go into c++. My =20 > first > visual basic program was just a small calculate with 2 text boxes and a > Button, now when you enter in an integer in the 2 text boxes and click = =20 > on the > Button it will multply those and give the answer in a message box. I am > asking if someone can please show me how to do that in a c++ app not in= =20 > the > concoll way. It would be nice if soneone can do it it Microsoft visual = =20 > c++. > > Regards > Gerald Humphreys > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users= . > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Jakob E. <mai...@ko...> - 2005-02-18 11:52:34
|
Ok, here is the thing. I'm trying to read from a file. But for some reason the entire file wont = =20 read. It's really strange becaus fstream::read() is suposed to read all the dat= a =20 at once (unlike readsome() ) Has any one of you ever run in to this problem. The source: //get the filesize=09 file.seekg( 0,ios_base::end ); file_size =3D file.tellg(); file.seekg( 0,ios_base::beg ); p_buffer =3D new char[file_size]; cout << "file size:" << file_size<<endl; file.read(p_buffer, file_size); cout << "gcount: "<< file.gcount()<<endl; ap_socket->send(p_buffer, file_size); delete p_buffer; the output: file size:6090 gcount: 5 |
|
From: Gerald H. <gl...@we...> - 2005-02-18 09:14:03
|
Hi all I have been on a couple of c++ websites. Some of them say to declair an interger vairable you will you this code. int var1; int vartest; And some of them say this int 1; int test; Which one is correct do you have to use that var. Regards Gerald |
|
From: Gerald H. <gl...@we...> - 2005-02-18 07:32:11
|
Hello Everyone This is my first post and i am just starting c++. So if you could help me i would appreciate it. I am a vb programmer wanting to go into c++. My first visual basic program was just a small calculate with 2 text boxes and a Button, now when you enter in an integer in the 2 text boxes and click on the Button it will multply those and give the answer in a message box. I am asking if someone can please show me how to do that in a c++ app not in the concoll way. It would be nice if soneone can do it it Microsoft visual c++. Regards Gerald Humphreys |
|
From: Jeremy H. <jer...@co...> - 2005-02-17 09:59:27
|
Farzan Hajian wrote: > Is there any function in C/C++ that can return string containing a > specified number of characters from the right side of another string? > I assume you mean something like this: string s = 'this_is_a_string'; And you want, say, 'string'. You can do this: string result = s.substr(s.size() - 6); There's a lot of other stuff you can do with strings. Here's a few string pages. Basic: http://www.msoe.edu/eecs/ce/courseinfo/stl/string.htm http://www.bgsu.edu/departments/compsci/docs/string.html More detailed: http://www.sgi.com/tech/stl/basic_string.html http://www.yolinux.com/TUTORIALS/LinuxTutorialC++StringClass.html |
|
From: Marco S. <msc...@xs...> - 2005-02-17 09:56:40
|
----- Original Message ----- From: "Farzan Hajian" <far...@ho...> To: <dev...@li...> Sent: Thursday, February 17, 2005 10:44 AM Subject: [Dev-C++] Problem with string..... > Is there any function in C/C++ that can return string containing a > specified number of characters from the right side of another string? dest = source.substr(source.length() - n, n); |
|
From: Farzan H. <far...@ho...> - 2005-02-17 09:45:05
|
Is there any function in C/C++ that can return string containing a =20 specified number of characters from the right side of another string? --=20 Using Opera's revolutionary e-mail client: http://www.opera.com/m2/ |
|
From: Alfred P. R. <al...@ya...> - 2005-02-17 06:29:38
|
Open a new project (File->New) in Dev-Cpp then add the source files with the + icon on the top part of the dev-cpp window. Make sure that you configure the new project correctly as there's lots of entries an options. Sorry for the short reply, as I've got to go catch a bus! sana thoibi <lei...@ya...> wrote: Hi, I have some c++ sourcecode.I have also downloaded Dev-C++.I am having problem getting the sourcecode to compile.How do I make a project from the existing source codes. Alfred P. Reaud |
|
From: sana t. <lei...@ya...> - 2005-02-17 05:24:50
|
Hi, I have some c++ sourcecode.I have also downloaded Dev-C++.I am having problem getting the sourcecode to compile.How do I make a project from the existing source codes. I would be glad if you could help me.Thanking you in anticipation. Leihao. __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 |
|
From: Alfred P. R. <al...@ya...> - 2005-02-17 00:17:24
|
Pardon all, in advance, for the length of this reply!
Don't waste your time Anton, with the rand() function. I spent a week last month going through RNGs, developing an implementation of random number generators that pass the DieHard tests. The system rand() function is severely deficient, and fails ALL Diehard tests!
I wound up using The Mother (integer arithemetic) and an implementation of the Wichman and Hill (double precision) procedure RNG. The original implementation of both, as available on the Internet, may return both integer and double precesion values concurrently. An excellent page on RNGs is Random Numbers and Monte Carlo Methods, Random Number Generators.
As both are public domain, and therefore not copy-rightable by me, I'll give you the coding to both. These PASS ALL of the DieHard tests in an excellent fashion, with very good period. I've statistics on both of these, BTW, created using a 300M unsigned 16 bit integer test file using the constant seed -1 (I've also the code available for generating the test file, running DieHard, and pattern repetition checking.)
George Marsaglia's "The Mother" RNG:
// Mother RNG related defines.
#define m16Long 65536L /* 2^16 */
#define m16Mask 0xFFFF /* Mask for lower 16 bits */
#define m15Mask 0x7FFF /* Mask for lower 15 bits */
#define m31Mask 0x7FFFFFFF /* Mask for 31 bits */
#define m32Double 4294967295.0 /* 2^32-1 */
// Mother related variables.
bool topword; // Return to Mother RNG word if true.
short mother1[10]; // Arrays of values for Mother RNG.
short mother2[10];
long current_mother; // Current 32 bit Mother RNG random number.
The Mother Itself:
unsigned int mrand ( void ) {
/*
Name: Modified Mother Random Number Generator
Copyright: 2005, Happy Cat Technologies
Author: Alfred P. Reaud
Date: 01/02/05 22:34
Description: This member is an unsigned integer implementation of George Marsaglia's
The Mother of All Random Number Generators. The seed is set at the time of
this class's construction from the system clock. Verification has occurred
using the Diehard battery of tests, with no significant differences encountered
between this implementation using a timer generated seed and the test
implementation using a constant seed.
RETURNS: An unsigned integer is returned representing a 16 bit random number.
VERIFIED: 02/02/05 22:39 Passes the DIEHARD RNG TESTS! 200 nsec/number.
*/
unsigned long number1, number2;
// Check for which word to return.
if (topword) {
// Return the top 16 bits.
topword = false;
return (unsigned int)((current_mother >> 16) & m16Mask);
}
else {
// Generate a new random number, save, and return the bottom 16 bits.
topword = true;
/* Move elements 1 to 8 to 2 to 9 */
memmove( mother1 + 2, mother1 + 1, 8 * sizeof(short) );
memmove( mother2 + 2, mother2 + 1, 8 * sizeof(short) );
/* Put the carry values in numberi */
number1 = mother1[0];
number2 = mother2[0];
/* Form the linear combinations */
number1 += 1941 * mother1[2] + 1860 * mother1[3] + 1812 * mother1[4]
+ 1776 * mother1[5] + 1492 * mother1[6] + 1215 * mother1[7]
+ 1066 * mother1[8] + 12013 * mother1[9];
number2 += 1111 * mother2[2] + 2222 * mother2[3] + 3333 * mother2[4]
+ 4444 * mother2[5] + 5555 * mother2[6] + 6666 * mother2[7]
+ 7777 * mother2[8] + 9272 * mother2[9];
/* Save the high bits of numberi as the new carry */
mother1[0] = number1 / m16Long;
mother2[0] = number2 / m16Long;
/* Put the low bits of numberi into motheri[1] */
mother1[1] = m16Mask & number1;
mother2[1] = m16Mask & number2;
current_mother = (((long)mother1[1]) << 16) + (long)mother2[1];
return (unsigned int)(current_mother & m16Mask);
}
}
Initializing "The Mother":
{
short n = 0;
short *p = NULL;
unsigned short sNumber = 0;
unsigned long seed_dWord = 0;
unsigned long number = 0;
// Initialize the Mother RNG.
seed_dWord = (rand() << 16) + rand();
sNumber = seed_dWord & m16Mask; /* The low 16 bits */
number = seed_dWord & m31Mask; /* Only want 31 bits */
p = mother1;
for ( n = 18; n--; ) {
/* One line multiply-with-carry */
number = 30903 * sNumber + (number >> 16);
*p++ = sNumber = number & m16Mask;
if (n == 9) p = mother2;
}
/* Make cary 15 bits */
mother1[0] &= m15Mask;
mother2[0] &= m15Mask;
}
Wichman and Hil RNG:
#define TWORAISED16 65536 // 2^16. Used to extract a random unsigned integer.
unsigned int secure_random ( void ) {
/*
Name: Secure Random Member Function
Copyright: 2004-2005, Happy Cat Technologies
Author: Alfred P. Reaud
Date: 28/01/05 21:26
Description: This member implements a more secure random number generator using
the Wichman and Hill procedure.
RETURNS: An unsigned integer is returned representing a 16 bit random number.
VERIFIED: 28/01/05 21:26 Passes the DIEHARD RNG TESTS! 975 nsec/number.
*/
int ix, iy, iz;
double result, rand_f, i_part;
// Create 3 random numbers.
ix = (171 * rand()) % 30269;
iy = (172 * rand()) % 30307;
iz = (170 * rand()) % 30323;
// Sum them as a double.
result = ((double)ix / 30269.0) + ((double)iy / 30307.0) + ((double)iz / 30323.0);
// Make a random number that will be 16 bits wide.
rand_f = modf(result, &i_part) * TWORAISED16;
result = modf(rand_f, &i_part);
return ((unsigned int)i_part) % TWORAISED16;
}
Anton Zilman <zi...@ma...> wrote:
Hi,
I need to produce random numbes uniformly distributed between 0 and 1. I can use (rand()%MAX_INT)/MAX_INT, but this gives me only 30 thousand something different numbers, because rand() is an integer.
So, if I cannot simulate something probability of which is less than 1/MAX_INT. Is there an analog of drand() function in Dec C/C++?
If anyone can help, it is apprecated!
Anton
Alfred P. Reaud
|
|
From: <Mat...@Ve...> - 2005-02-16 22:25:11
|
Perhaps you should just get some raw hardware random numbers from some place like random.org or HotBits. Then just do something like this: void* p; while ((p+8)<=size) { unsigned long long* LL = reintepret_cast<unsigned long long*>(void* p); long double r = double(1/LL); p=p+8; } where p is a pointer to the random bits you loaded into ram somehow, maybe with fread() or some kind of simple stream code, whatever you use doesn't matter as long as it's binary mode. That should be a little bit tricky, but extremely accurate way to get some fractional numbers. You could also do the same general thing a little less accurately and randomly by making an array of shorts (up to 32767 is a short on i386) containing the output of many rand() calls. Then accumulate every so many shorts together into a long or long long with a pointer of some kind and your friend reinterpret_cast<T>(x) and divide 1 by this value to make some random fraction. Make sure you cast when you do the division just to make sure the compiler uses floating point math, so you'll get an accurate result. If you do this, don't define the array with values any bigger than rand() returns or you'll be adding predictable zeros to your random numbers, which is a bad thing to do. -----Original Message----- From: dev...@li... [mailto:dev...@li...]On Behalf Of Anton Zilman Sent: Wednesday, February 16, 2005 2:05 PM To: dev...@li... Subject: [Dev-C++] random numbers with double precision Hi, I need to produce random numbes uniformly distributed between 0 and 1. I can use (rand()%MAX_INT)/MAX_INT, but this gives me only 30 thousand something different numbers, because rand() is an integer. So, if I cannot simulate something probability of which is less than 1/MAX_INT. Is there an analog of drand() function in Dec C/C++? If anyone can help, it is apprecated! Anton ___________________________________________________________________ The information contained in this message and any attachment may be proprietary, confidential, and privileged or subject to the work product doctrine and thus protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify me immediately by replying to this message and deleting it and all copies and backups thereof. Thank you. |
|
From: Anton Z. <zi...@ma...> - 2005-02-16 22:05:21
|
Hi, I need to produce random numbes uniformly distributed between 0 and 1. = I can use (rand()%MAX_INT)/MAX_INT, but this gives me only 30 thousand = something different numbers, because rand() is an integer. So, if I cannot simulate something probability of which is less than = 1/MAX_INT. Is there an analog of drand() function in Dec C/C++? If anyone can help, it is apprecated! Anton |
|
From: Alfred P. R. <al...@ya...> - 2005-02-16 20:13:06
|
That sounds more like a system function. at and cron are the utilities that provide that functionality in Unix/Linux. Both can be shelled from a process or thread. For Windows, that functionality belongs to the Windows Task Scheduler. How that would be called from a process or thread is beyond me. IMO, you could in theory set up a hidden background process that creates the functionality you are looking for, but it would be both replicating a system function and using up unnecessary resources, as some part of the process would have to stay alive to monitor the system time. If you find how to add a task to the Windows Task Scheduler from a process or thread, please post your findings! "Patel, Nilesh M" <Nil...@qu...> wrote: Does anyone know the syntax to call a function that will create a new data file after a given time. For example datafile2 will be created everyday after 20 hours or 10 hours. Any clue. -----Original Message----- From: dev...@li... [mailto:dev...@li...]On Behalf Of dev...@li... Sent: Monday, February 14, 2005 11:16 PM To: dev...@li... Subject: Dev-cpp-users digest, Vol 1 #2318 - 3 msgs Send Dev-cpp-users mailing list submissions to dev...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/dev-cpp-users or, via email, send a message with subject or body 'help' to dev...@li... You can reach the person managing the list at dev...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of Dev-cpp-users digest..." ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=click _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users Alfred P. Reaud |