dev-cpp-users Mailing List for Dev-C++ (Page 229)
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: Stewart, J. <JSt...@ra...> - 2004-04-15 08:29:14
|
I did this just then, firstly I: reimp Sigmalib.lib .. which outputted 3 .obj files and 1 .dll=20 Then I ran ar rcs libsigma.a *.obj *.dll .. to create the .a file (as per the = reimp README instructions) however i still get the same problems. am I missing a step here? Now I am linking with the following gcc.exe -D__DEBUG__ JOSHspares1.o -o "Simu1testbuild.exe" = -L"C:/Dev-Cpp/lib" -L"C:/logistics/testbuild1/lib" -L"C:/Dev-Cpp/lib" = -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 = -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 --verbose lib/libsigma.a =20 Reading specs from C:/Dev-Cpp/Bin/../lib/gcc-lib/mingw32/3.2/specs Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as = --host=3Dmingw32 --target=3Dmingw32 --prefix=3D/mingw --enable-threads = --disable-nls --enable-languages=3Df77,c++,objc,ada = --disable-win32-registry --disable-shared -Josh -----Original Message----- From: Alexander Streit [mailto:a.s...@qu...] Sent: Thursday, 15 April 2004 14:58 To: Stewart, Joshua Cc: dev...@li... Subject: Re: [Dev-C++] errors when linking to a .lib Joshua, The reimp tool does exactly what you need. You get it as part of the=20 "MinGW Utilities". Download it from here:=20 http://prdownloads.sf.net/mingw/mingw-utils-0.3.tar.gz?download it will turn a XXX.lib to a libXXX.a file, ready to be used with = Dev-Cpp. Stewart, Joshua wrote: >I am trying to link a C program with a .lib library file that was = provided to me by a third party. >All I have is a .lib, header files and an example program with MSVC = project files. I want to try and use DevC++ to link the sample provided = but I am having some trouble. > >When trying to use DevC++ to link I get the following errors. > >lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0xb1): In function = `c_initfiles': >c:\sig16dev\misc\c:20: undefined reference to `_chkesp' >fu000005.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' >nmth000000.o(.idata$4+0x0): undefined reference to `_nm___iob' > >I think this is because the lib was built in MS Visual C++ and there = are functions in the library (eg initfiles) that are making references = to weird MS things. The people that provide the lib also provided me = with a MSVC workspace/project, which I am able to use my friends copy of = MSVC to compile and link without hassel. > >I tried to import the MSVC dsp file using the DevC++ import feature, = but that also failed to build, with the same errors. > >i read somewhere in the archives that i might need to use reimp to = convert the .lib to an .a file? >would this help? how would I do this? Could I then put in my own dummy = copy of _chkesp and ar myself a new library? > >If anyone has seen this thing before when trying to port other MSVC = libraries or trying to use third party libs maybe you can help. Or = perhaps I am missing a simple linker switch (I am new to DevC++). Any = assistance is greatly appreciated. > >Attached is a copy of the link output. > |
|
From: Per W. <pw...@ia...> - 2004-04-15 08:26:06
|
Sorry, but that won't help. Converting a library from .lib to .a doesn't change the fact that the library contains references to the Visual C++ runtime library while GCC has it's own RTL. I don't think there is anything you can do to make use of this library with DevC++, less than to create a stub program using VC++ that reexports the functions. /Per W On Thu, 15 Apr 2004, Alexander Streit wrote: > Joshua, > > The reimp tool does exactly what you need. You get it as part of the > "MinGW Utilities". > Download it from here: > http://prdownloads.sf.net/mingw/mingw-utils-0.3.tar.gz?download > > it will turn a XXX.lib to a libXXX.a file, ready to be used with Dev-Cpp. > > Stewart, Joshua wrote: > > >I am trying to link a C program with a .lib library file that was provid= ed to me by a third party. > >All I have is a .lib, header files and an example program with MSVC proj= ect files. I want to try and use DevC++ to link the sample provided but I a= m having some trouble. > > > >When trying to use DevC++ to link I get the following errors. > > > >lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0xb1): In function `c_initf= iles': > >c:\sig16dev\misc\c:20: undefined reference to `_chkesp' > >fu000005.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' > >nmth000000.o(.idata$4+0x0): undefined reference to `_nm___iob' > > > >I think this is because the lib was built in MS Visual C++ and there are= functions in the library (eg initfiles) that are making references to weir= d MS things. The people that provide the lib also provided me with a MSVC w= orkspace/project, which I am able to use my friends copy of MSVC to compile= and link without hassel. > > > >I tried to import the MSVC dsp file using the DevC++ import feature, but= that also failed to build, with the same errors. > > > >i read somewhere in the archives that i might need to use reimp to conve= rt the .lib to an .a file? > >would this help? how would I do this? Could I then put in my own dummy c= opy of _chkesp and ar myself a new library? > > > >If anyone has seen this thing before when trying to port other MSVC libr= aries or trying to use third party libs maybe you can help. Or perhaps I am= missing a simple linker switch (I am new to DevC++). Any assistance is gre= atly appreciated. > > > >Attached is a copy of the link output. > > > >Josh Stewart. > > > > > >------------------------------------------------------------------------ > > > >Compiler: Default compiler > >Building Makefile: "C:\logistics\testbuild1\Makefile.win" > >Executing make... > >make.exe -f "C:\logistics\testbuild1\Makefile.win" all > >gcc.exe -D__DEBUG__ JOSHspares1.o -o "Simu1testbuild.exe" -L"C:/Dev-Cpp= /lib" -L"C:/logistics/testbuild1/lib" -L"C:/Dev-Cpp/lib" -lkernel32 -luser3= 2 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lu= uid -lodbc32 -lodbccp32 --verbose lib/Sigmalib.lib Reading specs from C:/D= ev-Cpp/Bin/../lib/gcc-lib/mingw32/3.2/specs > >Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as= --host=3Dmingw32 --target=3Dmingw32 --prefix=3D/mingw --enable-threads --d= isable-nls --enable-languages=3Df77,c++,objc,ada --disable-win32-registry -= -disable-shared > >Thread model: win32 gcc version 3.2 (mingw special 20020817-1) > > C:\Dev-Cpp\Bin\..\lib\gcc-lib\mingw32\3.2\..\..\..\..\mingw32\bin\ld.ex= e -Bdynamic -o Simu1testbuild.exe C:/Dev-Cpp/Bin/../lib/gcc-lib/mingw32/3.2= /../../../crt2.o C:/Dev-Cpp/Bin/../lib/gcc-lib/mingw32/3.2/crtbegin.o -LC:/= Dev-Cpp/lib -LC:/logistics/testbuild1/lib -LC:/Dev-Cpp/lib -LC:/Dev-Cpp/Bin= /../lib/gcc-lib/mingw32/3.2 -LC:/Dev-Cpp/Bin/../lib/gcc-lib -LC:/Dev-Cpp/Bi= n/../lib/gcc-lib/mingw32/3.2/../../../../mingw32/lib -LC:/Dev-Cpp/Bin/../li= b/gcc-lib/mingw32/3.2/../../.. JOSHspares1.o -lkernel32 -luser32 -lgdi32 -l= winspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32= -lodbccp32 lib/Sigmalib.lib -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt = -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingw= ex -lmsvcrt C:/Dev-Cpp/Bin/../lib/gcc-lib/mingw32/3.2/crtend.o Info: resolv= ing __iob by linking to __imp___iob (auto-import) lib/Sigmalib.lib(./Debug/= Sigmalib.obj)(.debug$S+0x542):C:\Sig16dev\MISC\C: variable '_iob' can't be = auto-imported. Please read the documentation for ld's --enable-auto-import = for details. > >lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0x427): In function `c_init= lk': > >c:\sig16dev\misc\c:123: undefined reference to `_chkesp' > >lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0xb1): In function `c_initf= iles': > >c:\sig16dev\misc\c:20: undefined reference to `_chkesp' > >lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0x213): In function `c_disk= _in': > >c:\sig16dev\misc\c:75: undefined reference to `_chkesp' > >lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0x66): In function `c_askme= ': > >c:\sig16dev\misc\c:6: undefined reference to `_chkesp' > >lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0x3e2): In function `c_file= ': > >c:\sig16dev\misc\c:123: undefined reference to `_chkesp' lib/Sigmalib.li= b(./Debug/Sigmalib.obj)(.text+0x3dd):c:\sig16dev\misc\c:147: more undefined= references to `_chkesp' follow > >fu000001.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' > >fu000002.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' > >fu000003.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' > >fu000004.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' > >fu000005.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' > >nmth000000.o(.idata$4+0x0): undefined reference to `_nm___iob' make.exe:= *** [Simu1testbuild.exe] Error 1 Execution terminated > > > > > >------------------------------------------------------------------------ > > > >"This email (including all attachments) is for the use of the named addr= essee only. You must not use, disclose, or copy any part of this email if y= ou are not the intended recipient. No rights of privacy, confidentiality, c= opyright or privilege are waived or lost by any mistransmission. If you rec= eive this email in error, please immediately delete it from your system, de= stroy all copies, and notify the sender. Emails may be interfered with, may= contain computer viruses or other defects, and may cause damage to your sy= stem. Raytheon gives no warranty in relation to the effect of this email on= your system, or the accuracy or completeness of its contents." > > > > > > -- > Alexander Streit > > PhD |
|
From: Alexander S. <a.s...@qu...> - 2004-04-15 06:58:53
|
Joshua, The reimp tool does exactly what you need. You get it as part of the=20 "MinGW Utilities". Download it from here:=20 http://prdownloads.sf.net/mingw/mingw-utils-0.3.tar.gz?download it will turn a XXX.lib to a libXXX.a file, ready to be used with Dev-Cpp.= Stewart, Joshua wrote: >I am trying to link a C program with a .lib library file that was provid= ed to me by a third party. >All I have is a .lib, header files and an example program with MSVC proj= ect files. I want to try and use DevC++ to link the sample provided but I= am having some trouble. > >When trying to use DevC++ to link I get the following errors. > >lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0xb1): In function `c_initf= iles': >c:\sig16dev\misc\c:20: undefined reference to `_chkesp' >fu000005.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' >nmth000000.o(.idata$4+0x0): undefined reference to `_nm___iob' > >I think this is because the lib was built in MS Visual C++ and there are= functions in the library (eg initfiles) that are making references to we= ird MS things. The people that provide the lib also provided me with a MS= VC workspace/project, which I am able to use my friends copy of MSVC to c= ompile and link without hassel. > >I tried to import the MSVC dsp file using the DevC++ import feature, but= that also failed to build, with the same errors. > >i read somewhere in the archives that i might need to use reimp to conve= rt the .lib to an .a file? >would this help? how would I do this? Could I then put in my own dummy c= opy of _chkesp and ar myself a new library? > >If anyone has seen this thing before when trying to port other MSVC libr= aries or trying to use third party libs maybe you can help. Or perhaps I = am missing a simple linker switch (I am new to DevC++). Any assistance is= greatly appreciated. > >Attached is a copy of the link output. > >Josh Stewart. > =20 > >------------------------------------------------------------------------= > >Compiler: Default compiler >Building Makefile: "C:\logistics\testbuild1\Makefile.win" >Executing make... >make.exe -f "C:\logistics\testbuild1\Makefile.win" all >gcc.exe -D__DEBUG__ JOSHspares1.o -o "Simu1testbuild.exe" -L"C:/Dev-Cpp= /lib" -L"C:/logistics/testbuild1/lib" -L"C:/Dev-Cpp/lib" -lkernel32 -luse= r32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32= -luuid -lodbc32 -lodbccp32 --verbose lib/Sigmalib.lib Reading specs fro= m C:/Dev-Cpp/Bin/../lib/gcc-lib/mingw32/3.2/specs >Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as= --host=3Dmingw32 --target=3Dmingw32 --prefix=3D/mingw --enable-threads -= -disable-nls --enable-languages=3Df77,c++,objc,ada --disable-win32-regist= ry --disable-shared >Thread model: win32 gcc version 3.2 (mingw special 20020817-1) > C:\Dev-Cpp\Bin\..\lib\gcc-lib\mingw32\3.2\..\..\..\..\mingw32\bin\ld.ex= e -Bdynamic -o Simu1testbuild.exe C:/Dev-Cpp/Bin/../lib/gcc-lib/mingw32/3= =2E2/../../../crt2.o C:/Dev-Cpp/Bin/../lib/gcc-lib/mingw32/3.2/crtbegin.o= -LC:/Dev-Cpp/lib -LC:/logistics/testbuild1/lib -LC:/Dev-Cpp/lib -LC:/Dev= -Cpp/Bin/../lib/gcc-lib/mingw32/3.2 -LC:/Dev-Cpp/Bin/../lib/gcc-lib -LC:/= Dev-Cpp/Bin/../lib/gcc-lib/mingw32/3.2/../../../../mingw32/lib -LC:/Dev-C= pp/Bin/../lib/gcc-lib/mingw32/3.2/../../.. JOSHspares1.o -lkernel32 -luse= r32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32= -luuid -lodbc32 -lodbccp32 lib/Sigmalib.lib -lmingw32 -lgcc -lmoldname -= lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgc= c -lmoldname -lmingwex -lmsvcrt C:/Dev-Cpp/Bin/../lib/gcc-lib/mingw32/3.2= /crtend.o Info: resolving __iob by linking to __imp___iob (auto-import) l= ib/Sigmalib.lib(./Debug/Sigmalib.obj)(.debug$S+0x542):C:\Sig16dev\MISC\C:= variable '_iob' can't be auto-imported. Please read the documentation fo= r ld's --enable-auto-import for details. >lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0x427): In function `c_init= lk': >c:\sig16dev\misc\c:123: undefined reference to `_chkesp' >lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0xb1): In function `c_initf= iles': >c:\sig16dev\misc\c:20: undefined reference to `_chkesp' >lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0x213): In function `c_disk= _in': >c:\sig16dev\misc\c:75: undefined reference to `_chkesp' >lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0x66): In function `c_askme= ': >c:\sig16dev\misc\c:6: undefined reference to `_chkesp' >lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0x3e2): In function `c_file= ': >c:\sig16dev\misc\c:123: undefined reference to `_chkesp' lib/Sigmalib.li= b(./Debug/Sigmalib.obj)(.text+0x3dd):c:\sig16dev\misc\c:147: more undefin= ed references to `_chkesp' follow >fu000001.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' >fu000002.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' >fu000003.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' >fu000004.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' >fu000005.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' >nmth000000.o(.idata$4+0x0): undefined reference to `_nm___iob' make.exe:= *** [Simu1testbuild.exe] Error 1 Execution terminated > =20 > >------------------------------------------------------------------------= > >"This email (including all attachments) is for the use of the named addr= essee only. You must not use, disclose, or copy any part of this email if= you are not the intended recipient. No rights of privacy, confidentialit= y, copyright or privilege are waived or lost by any mistransmission. If y= ou receive this email in error, please immediately delete it from your sy= stem, destroy all copies, and notify the sender. Emails may be interfered= with, may contain computer viruses or other defects, and may cause damag= e to your system. Raytheon gives no warranty in relation to the effect of= this email on your system, or the accuracy or completeness of its conten= ts." =20 > =20 > --=20 Alexander Streit PhD Candidate Media R&D Group Centre for IT Innovation Queensland University of Technology |
|
From: Stewart, J. <JSt...@ra...> - 2004-04-15 06:26:59
|
I am trying to link a C program with a .lib library file that was = provided to me by a third party. All I have is a .lib, header files and an example program with MSVC = project files. I want to try and use DevC++ to link the sample provided = but I am having some trouble. When trying to use DevC++ to link I get the following errors. lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0xb1): In function = `c_initfiles': c:\sig16dev\misc\c:20: undefined reference to `_chkesp' fu000005.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' nmth000000.o(.idata$4+0x0): undefined reference to `_nm___iob' I think this is because the lib was built in MS Visual C++ and there are = functions in the library (eg initfiles) that are making references to = weird MS things. The people that provide the lib also provided me with a = MSVC workspace/project, which I am able to use my friends copy of MSVC = to compile and link without hassel. I tried to import the MSVC dsp file using the DevC++ import feature, but = that also failed to build, with the same errors. i read somewhere in the archives that i might need to use reimp to = convert the .lib to an .a file? would this help? how would I do this? Could I then put in my own dummy = copy of _chkesp and ar myself a new library? If anyone has seen this thing before when trying to port other MSVC = libraries or trying to use third party libs maybe you can help. Or = perhaps I am missing a simple linker switch (I am new to DevC++). Any = assistance is greatly appreciated. Attached is a copy of the link output. Josh Stewart. |
|
From: Per W. <pw...@ia...> - 2004-04-14 20:36:09
|
No difference. Some people uses *.hpp just to inform the rest of the world that the header file contains C++ declarations. /Per W On Wed, 14 Apr 2004, faramarz yari wrote: > hi > can any body tell me what's the difference between *.h file and *.hpp? > thank u in advaced > > _________________________________________________________________ > The new MSN 8: smart spam protection and 2 months FREE* > http://join.msn.com/?page=features/junkmail > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&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: Tim S. <ti...@we...> - 2004-04-14 20:30:40
|
Hi faramarz, you have written: > can any body tell me what's the difference between *.h file and *.hpp? It is the same. Both are headerfiles. hpp is only showing that it is a C++ headerfile. so long Tim -- > Und wer als Root browst, gehoert eh | http://we-are-teh-b.org/~tim/borg.key > in Honig getunkt, in Wollfaeden gewaelzt | http://learn.to/quote > und im Streichelzoo ausgesetzt... | http://discworld.kicks-ass.org rockshop auf heise.de |
|
From: faramarz y. <far...@ho...> - 2004-04-14 20:16:44
|
hi can any body tell me what's the difference between *.h file and *.hpp? thank u in advaced _________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail |
|
From: <or...@vp...> - 2004-04-14 20:00:13
|
faramarz yari wrote: > hi anybody > i have a problem to using seprate c++ classes. > i have write a class "Search.cpp",it has two function in it. > it has not any main function. > now i want to write another file for example test_search > i want to instantiate an object from Search class in it and use it's=20 > function there. > i wrote: > Search s; > s.linear(); > but i can not use class Search in it because compiler does not know it. > what should i do? You need to put the definition of the class into a header file, and put=20 only the implementation into the .cpp file. Attached is a very small=20 demo on how to do it. -- Greetings, Bal=E1zs |
|
From: Alvin T. <al...@th...> - 2004-04-14 18:39:57
|
is school back in, already? #include "Search.h" -alvin faramarz yari wrote: > hi anybody > i have a problem to using seprate c++ classes. > i have write a class "Search.cpp",it has two function in it. > it has not any main function. > now i want to write another file for example test_search > i want to instantiate an object from Search class in it and use it's > function there. > i wrote: > Search s; > s.linear(); > but i can not use class Search in it because compiler does not know it. > what should i do? > in dev_c++ or borland c++? > thank u in advanced > > _________________________________________________________________ > STOP MORE SPAM with the new MSN 8 and get 2 months FREE* > http://join.msn.com/?page=features/junkmail > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&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 -- Alvin Thompson Navy: 34 Army: 6 |
|
From: Per W. <pw...@ia...> - 2004-04-14 18:32:30
|
You should create a file
Search.h
with contents:
#ifndef __SEARCH_H
#define __SEARCH_H
class Search {
...
void linear();
};
#endif
Create a file
Search.cpp
with contents:
#include ...
#include "Search.h"
void Search::linear() {
}
....
Create file
Test.cpp
with contents:
#include ...
#include "Search.h"
int main() {
Search s;
s.linear();
return 0;
}
/Per W
On Wed, 14 Apr 2004, faramarz yari wrote:
> hi anybody
> i have a problem to using seprate c++ classes.
> i have write a class "Search.cpp",it has two function in it.
> it has not any main function.
> now i want to write another file for example test_search
> i want to instantiate an object from Search class in it and use it's
> function there.
> i wrote:
> Search s;
> s.linear();
> but i can not use class Search in it because compiler does not know it.
> what should i do?
> in dev_c++ or borland c++?
> thank u in advanced
>
> _________________________________________________________________
> STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&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: faramarz y. <far...@ho...> - 2004-04-14 17:45:06
|
hi anybody
i have a problem to using seprate c++ classes.
i have write a class "Search.cpp",it has two function in it.
it has not any main function.
now i want to write another file for example test_search
i want to instantiate an object from Search class in it and use it's
function there.
i wrote:
Search s;
s.linear();
but i can not use class Search in it because compiler does not know it.
what should i do?
in dev_c++ or borland c++?
thank u in advanced
_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail
|
|
From: Per W. <pw...@ia...> - 2004-04-14 15:41:56
|
Have you looked at the Graphics Gems book series? They contain a lot of algorithms, and for some of them there are available code. I would be very surprised if they don't contain an example of the marching cubes algorithm since it is very common for rendering volumetric data. /Per W On Wed, 14 Apr 2004, michele wrote: > > > hi Jan, > if you are interested... > What I have to do is to render a 3D volume from sampled points (certain conditions define that volume)... > > So what I do is to divide the 3D space in a 3D grid and to test each point of this grid to know if it is inside or outside my suface... > Regards > (if you have some suggestions let me know! thanks) > > > > ----- Original Message ----- > From: Jan Ringos > To: michele > Sent: Friday, April 09, 2004 6:44 PM > Subject: Re: [Dev-C++] marching cubes (3D) > > > Very interesting. But honestly I see no use for it. In game I would instead use something like height-map or model with clipping definitons. > But I don't know what specific are you want to do with it. Anyway It shouldn't be too difficult to implement exact use. > > --- > Jan Ringos, Tr...@mx... > http://Tringi.Mx-3.cz > > ----- Original Message ----- > From: michele > To: Jan Ringos ; DEV-C++ > Sent: Friday, April 09, 2004 10:18 AM > Subject: Re: [Dev-C++] marching cubes (3D) > > > Hi... > > "The marching cubes algorithm is used in volume rendering to construct an isosurface from a 3D field of values. > The 2D analog would be to take an image, and for each pixel, set it to black if the value is below some threshold, and set it to white if it's above the threshold. Then smooth the jagged black outlines by skinning them with lines..." [James Sharman] > > if you (and someone else) want to read some interesting articles about marching cubes: > Introduction: > http://www.exaflop.org/docs/marchcubes/ind.html > > Article with some c code: > http://www.cfxweb.net/modules.php?name=News&file=article&sid=199 > (more available at http://matrix.netsoc.tcd.ie/~nash/metaballs/src/ gently by Nicholas: nn...@st...) > |
|
From: michele <mic...@li...> - 2004-04-14 15:24:08
|
hi Jan, if you are interested... What I have to do is to render a 3D volume from sampled points (certain = conditions define that volume)... So what I do is to divide the 3D space in a 3D grid and to test each = point of this grid to know if it is inside or outside my suface... Regards=20 (if you have some suggestions let me know! thanks) ----- Original Message -----=20 From: Jan Ringos=20 To: michele=20 Sent: Friday, April 09, 2004 6:44 PM Subject: Re: [Dev-C++] marching cubes (3D) Very interesting. But honestly I see no use for it. In game I would = instead use something like height-map or model with clipping definitons. But I don't know what specific are you want to do with it. Anyway It = shouldn't be too difficult to implement exact use. --- Jan Ringos, Tr...@mx... http://Tringi.Mx-3.cz ----- Original Message -----=20 From: michele=20 To: Jan Ringos ; DEV-C++=20 Sent: Friday, April 09, 2004 10:18 AM Subject: Re: [Dev-C++] marching cubes (3D) Hi... =20 "The marching cubes algorithm is used in volume rendering to = construct an isosurface from a 3D field of values. The 2D analog would be to take an image, and for each pixel, set it = to black if the value is below some threshold, and set it to white if = it's above the threshold. Then smooth the jagged black outlines by = skinning them with lines..." [James Sharman] if you (and someone else) want to read some interesting articles = about marching cubes: Introduction: http://www.exaflop.org/docs/marchcubes/ind.html =20 Article with some c code:=20 = http://www.cfxweb.net/modules.php?name=3DNews&file=3Darticle&sid=3D199 (more available at http://matrix.netsoc.tcd.ie/~nash/metaballs/src/ = gently by Nicholas: nn...@st...) |
|
From: Kevin B. <kev...@ma...> - 2004-04-13 16:49:19
|
It's a bad idea to assume that library code is "buggy" just because it doesn't do what you expect. In fact, the standard library is a carefully designed and extensively tested chunk of code. It is highly unlikely that a beginner poking at it in obvious (if naive) ways is going to discover a "bug" that has escaped legions of testers and developers. It is far more likely that the person in question simply doesn't understand how things work in C++, and has written their own bug. That is indeed the case here. This program is working exactly as specified in the C++ standard. The destructor for global objects are called *after* the main() function has exited. Standard I/O is not guaranteed to work at that time, although it might. Even if it does, though, since it will happen after the system() call in any case, you might well simply not notice it before the console window disappears. --- Kevin |
|
From: Buday G. <bu...@in...> - 2004-04-13 11:27:10
|
Hi All, do you know any easy way to do the above conversion (and vice versa) _not_ using GNU iconv library? - Gergely |
|
From: <or...@vp...> - 2004-04-13 11:09:33
|
Hi! Hey, thanks Krzysztof! Your comments were really helpful. After reading you comments, and Bjarne's talks, I now think how I should=20 decide. Thank you everyone, who helped me out! One more note about the Hungarian notation: m_ and sm_ prefixes are not actually part of the Hungarian notation.=20 Hungarion notation is like this: pstrName szAddress etc. I think that's a bit stupid, but m_ and that kind of stuff IS useful.=20 Here is a very good (a bit sarcastic) writing from the C++-FAQ Lite: ... If you have a Microsoft Windows background, you probably prefer the=20 "Hungarian" style which means you jkuidsPrefix vndskaIdentifiers ncqWith=20 ksldjfTheir nmdsadType... -- Greetings, Bal=E1zs |
|
From: Daniel K. O. <dan...@ya...> - 2004-04-13 09:59:00
|
OROSZI Balázs wrote: > It states that use public data ONLY if the whole thing is a data class > (a struct). But what if there ARE a few methods present for the class, > but mostly, it contains data? I tend to agree with Sroustrup: From http://www.artima.com/intv/goldilocks3.html > *Bjarne Stroustrup*: My rule of thumb is that you should have a real > class with an interface and a hidden representation if and only if you > can consider an invariant for the class. > What should count as an invariant? Suppose I have some class, which > stores a file-path internally. The follow up of the interview: > *Bill Venners*: What do you mean by invariant? > > *Bjarne Stroustrup*: What is it that makes the object a valid object? > An invariant allows you to say when the object's representation is > good and when it isn't. Take a |vector| as a very simple example. A > |vector| knows that it has n elements. It has a pointer to n elements. > The invariant is exactly that: the pointer points to something, and > that something can hold n elements. If it holds n+1 or n-1 elements, > that's a bug. If that pointer is zero, it's a bug, because it doesn't > point to anything. That means it's a violation of an invariant. So you > have to be able to state which objects make sense. Which are good and > which are bad. And you can write the interfaces so that they maintain > that invariant. That's one way of keeping track that your member > functions are reasonable. It's also a way of keeping track of which > operations need to be member functions. Operations that don't need to > mess with the representation are better done outside the class. So > that you get a clean, small interface that you can understand and > maintain. > Ando this: > *Bill Venners*: The invariant is a relationship between different > pieces of data in the class. > > *Bjarne Stroustrup*: Yes. If every data can have any value, then it > doesn't make much sense to have a class. Take a single data structure > that has a name and an address. Any string is a good name, and any > string is a good address. If that's what it is, it's a structure. Just > call it a |struct|. Don't have anything private. Don't do anything > silly like having a hidden name and address field with |get_name| and > |set_address| and |get_name| and |set_name| functions. Or even worse, > make a virtual base class with virtual |get_name| and |set_name| > functions and so on, and override it with the one and only > representation. That's just elaboration. It's not necessary. > So, (I think) your class is no more than a struct (with all data public), and methods to do stuffs with it. Daniel K. O. |
|
From: <or...@vp...> - 2004-04-13 09:29:11
|
Per Westermark wrote:
> No, the program doesn't end when main() returns. The desctructors for
> global objects will still be called. The problem with this program is t=
hat
> they are called _after_ system("PAUSE").
Indeed :)
After system("PAUSE"), World gets destroyed correctly, however it cannot=20
be "seen", as the dos prompt disappears :)
If it is run from a separate dos prompt, this is what we get:
--
Hello!
Press any key to continue . . .
Goodbye!
--
The expected behaviour.
--
Greetings,
Bal=E1zs
|
|
From: <or...@vp...> - 2004-04-13 09:24:10
|
Krzysztof Kapuscik wrote: > But for above example you could use: > return (c1.Save() && c2.Save() && c3.Save()); >=20 > Just remember (yeah, I know you remember this) that && operators are > evaluated as long as there is 0 value as operator argument, so if > you'll get c2.Save() =3D=3D false then c3.Save() will never be done (fo= r > all standard complaint compilers - if I good remember, I'm not so > sure, 'cause it is 1:38 AM in my time zone ;) ). Yes, it is ANSI standard, the shortcut-evaluation, already present in C. I have been reading here and there about this public-private stuff, but=20 still, there are very diverse styles. I have read this somewhere: -- Class variables should never be declared public. The concept of C++ information hiding and encapsulation is violated by=20 public variables. Use private variables and access functions instead.=20 One exception to this rule is when the class is essentially a data=20 structure, with no behavior (equivalent to a C struct). In this case it=20 is appropriate to make the class' instance variables public [2]. Note that structs are kept in C++ for compatibility with C only, and=20 avoiding them increases the readability of the code by reducing the=20 number of constructs used. Use a class instead. -- It states that use public data ONLY if the whole thing is a data class=20 (a struct). But what if there ARE a few methods present for the class,=20 but mostly, it contains data? Another question: I used the m_ (or simply m) prefix for variables in a=20 class, and they were mostly private or protected. What if I put the data=20 into the public section? Should I still use this (or other) prefix for=20 those too? (I don't use any other prefixes. Though I'm Hungarian, I DON'T use=20 Hungarian-notation :) -- Greetings, Bal=E1zs P.S.: Maybe i spend too much time pondering on unimportant things... |
|
From: Carlos <cy...@hi...> - 2004-04-13 09:20:49
|
Hello.=20
I'm using 'Dev-C++ 4.9.8.0' on 'MS Windows 2000
SP2'
with 'cygwin-1.5.9-1' installed.
I'm trying to build a simple socket app:
------------------//----------------
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
#include <unistd.h>=20
#define SERVER_PORT 1500
#define MAX_MSG 100
int main (int argc, char *argv[])
{ =20
return 0;
}
-----------------//---------------------
But I get this error message when trying to
compile:
----------------------//-----------------
Compiler: Default compiler
Executing gcc.exe...
gcc.exe "F:\cpp\lab\test01.c" -o
"F:\cpp\lab\test01.exe" -I"f:\Dev-Cpp\include"
-I"F:\cygwin\usr\include" -L"f:\Dev-Cpp\lib"
In file included from F:/cygwin/usr/include/asm/socket.h:14,
from F:/cygwin/usr/include/cygwin/socket.h:23,
from F:/cygwin/usr/include/sys/socket.h:15,
from F:/cpp/lab/test01.c:2:
F:/cygwin/usr/include/cygwin/if.h:79: parse error
before "caddr_t"
F:/cygwin/usr/include/cygwin/if.h:79: warning: no
semicolon at end of struct or union
F:/cygwin/usr/include/cygwin/if.h:79: warning: no
semicolon at end of struct or union
F:/cygwin/usr/include/cygwin/if.h:81: parse error
before '}' token
F:/cygwin/usr/include/cygwin/if.h:81: warning:
data definition has no type or storage class
F:/cygwin/usr/include/cygwin/if.h:82: parse error
before '}' token
Execution terminated
-----------------------------//----------
What am I doing wrong? Thank you very much.
-------------------------------------------------------------------------=
----------
Correo POP y 50 MB de espacio en HispaVista
http://www.hispavista.com/
-------------------------------------------------------------------------=
----------
=BFConoces eBay, el mayor centro de compra y venta en internet?
M=F3viles, port=E1tiles, pda=B4s, cd=B4s, c=E1maras digitales, videocamar=
as...
=A1Compra ahora a los mejores precios! http://ebay.hispavista.com/
|
|
From: Scott S. <age...@co...> - 2004-04-13 00:47:08
|
Run the program from the MS-DOS console.
alf wrote:
> I'm now onto arrays.
> The first prog works, in as there are no errors.
> I put in each number as instructed and all is well until the final
> enter. then the console screen flashes on then off in a nanosec.
> The cin.get(); worked on the other exercises but not on this one.
> I've tried the system("PAUSE"); syntax and that don't work either.
> both these syntax used the line before return(0);.
> how do I correct this?
> Thank you for the other answers.
>
>
|
|
From: Per W. <pw...@ia...> - 2004-04-12 23:49:52
|
No, the program doesn't end when main() returns. The desctructors for
global objects will still be called. The problem with this program is that
they are called _after_ system("PAUSE").
/Per W
On Mon, 12 Apr 2004, Scott Simontis wrote:
> Try manually calling the destructor in your code. I am not a master of
> C++, but I think I see what is going on here. The "World" class is
> global. Therefore, its life is the entire program. However, when main
> ends, the program ends. The solution here would probably to create an
> instance of the class within main or call the destructor yourself in the
> code, but I think the latter is poor programming, does anybody else know?
> Latif Dokter wrote:
>
> > here is the full code
> > #include <iostream>
> > #include <stdlib.h>
> >
> > using namespace std;
> > class World
> > {
> > public:
> > World () { std::cout << "Hello!\n"; }
> > ~World () { std::cout << "Goodbye!\n"; }
> > };
> >
> > World TheWorld;
> >
> > int main(int argc, char *argv[])
> > {
> >
> > system("PAUSE");
> > return 0;
> > }
> >
> > /-------Original Message-------/
> >
> > /*From:*/ Scott Simontis <mailto:age...@co...>
> > /*Date:*/ 04/12/04 10:55:55
> > /*To:*/ Latif Dokter <mailto:ld...@op...>
> > /*Subject:*/ Re: [Dev-C++] Buggy standard library?
> >
> > Did you call the destructor?
> > Latif Dokter wrote:
> >
> > > I am using Dev.C++ 4.9.8.7 When creating a program with class World
> > > where World () {} says Hello and ~World() {} says goodbye World
> > > TheWorld; when compiled and executed
> > > in Ms dos console the program prints hello but doesn't print goodbye I
> > > have read that I may have a buggy version of the standard library if
> > > so is there a patch if not what is happening and how can I fix it
> > >
> > >
> > >
> > >
> > > ____________________________________________________
> > > <http://www.incredimail.com/redir.asp?ad_id=309&lang=9
> > <http://www.incredimail.com/redir.asp?ad_id=309&lang=9>> /IncrediMail/
> > > - *Email has finally evolved* - *_Click Here_*
> > > <http://www.incredimail.com/redir.asp?ad_id=309&lang=9
> > <http://www.incredimail.com/redir.asp?ad_id=309&lang=9>>
> >
> >
> >
> >
> >
> >
> > ____________________________________________________
> > <http://www.incredimail.com/redir.asp?ad_id=309&lang=9> /IncrediMail/
> > - *Email has finally evolved* - *_Click Here_*
> > <http://www.incredimail.com/redir.asp?ad_id=309&lang=9>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&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: Scott S. <age...@co...> - 2004-04-12 23:32:09
|
Try manually calling the destructor in your code. I am not a master of
C++, but I think I see what is going on here. The "World" class is
global. Therefore, its life is the entire program. However, when main
ends, the program ends. The solution here would probably to create an
instance of the class within main or call the destructor yourself in the
code, but I think the latter is poor programming, does anybody else know?
Latif Dokter wrote:
> here is the full code
> #include <iostream>
> #include <stdlib.h>
>
> using namespace std;
> class World
> {
> public:
> World () { std::cout << "Hello!\n"; }
> ~World () { std::cout << "Goodbye!\n"; }
> };
>
> World TheWorld;
>
> int main(int argc, char *argv[])
> {
>
> system("PAUSE");
> return 0;
> }
>
> /-------Original Message-------/
>
> /*From:*/ Scott Simontis <mailto:age...@co...>
> /*Date:*/ 04/12/04 10:55:55
> /*To:*/ Latif Dokter <mailto:ld...@op...>
> /*Subject:*/ Re: [Dev-C++] Buggy standard library?
>
> Did you call the destructor?
> Latif Dokter wrote:
>
> > I am using Dev.C++ 4.9.8.7 When creating a program with class World
> > where World () {} says Hello and ~World() {} says goodbye World
> > TheWorld; when compiled and executed
> > in Ms dos console the program prints hello but doesn't print goodbye I
> > have read that I may have a buggy version of the standard library if
> > so is there a patch if not what is happening and how can I fix it
> >
> >
> >
> >
> > ____________________________________________________
> > <http://www.incredimail.com/redir.asp?ad_id=309&lang=9
> <http://www.incredimail.com/redir.asp?ad_id=309&lang=9>> /IncrediMail/
> > - *Email has finally evolved* - *_Click Here_*
> > <http://www.incredimail.com/redir.asp?ad_id=309&lang=9
> <http://www.incredimail.com/redir.asp?ad_id=309&lang=9>>
>
>
>
>
>
>
> ____________________________________________________
> <http://www.incredimail.com/redir.asp?ad_id=309&lang=9> /IncrediMail/
> - *Email has finally evolved* - *_Click Here_*
> <http://www.incredimail.com/redir.asp?ad_id=309&lang=9>
|
|
From: <or...@vp...> - 2004-04-12 23:01:05
|
Krzysztof Kapuscik wrote: > BTW. Throwing exceptions are sometimes not best way to inform that > something has not gone the right way. Sometimes (often?) it is better > to return bool (success/failure) or int (0=3Dsuccess, <>0 error code) > value. Yeah, I first used that, but this time I need exceptions, as there is=20 some inheritance involved, and not only one thing is saved, but several=20 Save's are called, and doing: if ( c1.Save() ) if ( c2.Save() ) if ( c3.Save() ) return true; else ... became too painful :) But for simple cases, returning bool would be absolutely fine! Thanks for your comments! -- Greetings, Bal=E1zs |
|
From: Daniel K. O. <dan...@ya...> - 2004-04-12 22:27:06
|
OROSZI Balázs wrote: > Suppose I have a class, which has some data. Mostly string data. Like > name, path, etc. Uptil now I always put these things into the private > part of my class, and I provided Get/Set methods for accessing them. > I ask: does it worth the extra overhead? I mean, what if I simply put > the data into the public section, and then I have 2 (or more) member > functions less, and the same access to the data. > > Can someone with more experience with C++ give some guidelines to me > about this. Posting personal experience would be the best! I recomend you to go search on Stroustrup's website for his interviews. I remember he answering your questions. It was almos like this: if you need to keep an invariant (like the rules about your data, to make sure it's always valid) then you have a class, with private members and set/get methods. But if all you need is to group the data togheter and there's no special invariant to take care of, you actually have a plain struct, and probably there's no need to the get/set methods. Stroustrup is (obviously) much more objective than me, so better read what he said about this. :) Daniel K. O. |