|
Don't know how in plain C/C++, I program only in Win32.
For Win32 the function is GetLocaleInfo().
To get the thousand's and decimal separators. Call:
GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, separator, 2)
GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, separator, 2)
The full list of constants is at:
http://msdn.microsoft.com/en-us/library/dd464799%28v=VS.85%29.aspx[^]
To speed things up, just make each call once at beginning of function.
|
|
|
|
|
Hi!
I'm working on a project (LogMap) using wxWidgets and glut, in linux. When I link dynamically everything goes ok. But when I try to link statically, ld gives an error message:
g++ *.cpp -static -lglut `wx-config --libs` `wx-config --cxxflags` `wx-config --gl-libs` -o logmap
/usr/lib/gcc/i586-suse-linux/4.4/../../../../i586-suse-linux/bin/ld: cannot find -lglut
collect2: ld returned 1 exit status
Does anyone have an idea of what is happening? Any idea of how to solve it?
Thanks in advance.
|
|
|
|
|
Does the libglut.a file exist on your system?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I cannot find neither libglut.a nor any wxWidgets libraries in .a format. It means I cannot statically compile, doesn't it?
I'm trying to find them in internet. Any help would be appreciated.
|
|
|
|
|
At least, I suppose, you may build yourself the static library.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
That's what I'm trying to do right now.
|
|
|
|
|
But I cannot find any info about how to build the static library... neither glut nor freeglut. Any idea?
|
|
|
|
|
I don't think the glut release includes a static lib build. You could create one yourself (wouldn't be too difficult), but you might want to check the glut license terms first to see if it's allowed. They may not want it distributed in any form other than the dll.
L u n a t i c F r i n g e
|
|
|
|
|
Perhaps you can tell me how do I build glut as static lib.
|
|
|
|
|
Create a static lib project, add the required files and build.
You'll probably have to redefine an export macro to make it compatible with static linking. Typically, a DLL will have some code block in it's header file that looks like this:
#ifdef MYLIB_EXPORTS
#define MYLIB_API __declspec(dllexport)
#else
#define MYLIB_API __declspec(dllimport)
#endif
You'll have to redefine MYLIB_API for a static build to something like this:
#ifdef MYLIB_STATIC_BUILD
#define MYLIB_API
#else
#ifdef MYLIB_EXPORTS
#define MYLIB_API __declspec(dllexport)
#else
#define MYLIB_API __declspec(dllimport)
#endif
#endif
I say again, though, check the license terms and make sure you aren't violating them.
L u n a t i c F r i n g e
|
|
|
|
|
It is Linux...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
There are no export macros needed with gcc on Linux, not that I am aware of. Basically whatever functions/classes you link into your static library will be exported.
/Moak
Edit: Pallini, I replied to the wrong person, sorry.
|
|
|
|
|
CPallini wrote: It is Linux...
Eek! Missed that.
L u n a t i c F r i n g e
|
|
|
|
|
I may just guess (I haven't glut) there is an option in the makefile (possibly you may pass a parameter to 'make configure' command).
As extreme resource, you may hack the makefile (OMG).
You may also find a package containing the static library binary, I think you should search for libglut-devel .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Finally, I found libglut.a in an older version of Suse in my laptop. The problem now, when linking against wxwidgets libraries, is that it gives lots and lots of errors. Anyway, I'm resigning myself to link dynamically. Thanks guys for your help.
|
|
|
|
|
i read the data of a csv file in a buffer and then update the csv file.when i run the application and try to read the data again in buffer it shows empty even when file contains data.wat the problem may be?
|
|
|
|
|
what you want to do?if you have read data in buffer then must be contain data in buffer.I think some where in you code buffer have lost data.Please check it.
|
|
|
|
|
when i run the application first time buffer contains correct data of file but when i close and run the application again and read file data in buffer then buffer contains empty?
|
|
|
|
|
First time your code work fine then you close exe and agaim run then show blank.Am i right?Please show code here?
|
|
|
|
|
Are you releasing the file properly when your application closes?
Ali
|
|
|
|
|
Member 590310 wrote: and then update the csv file
What will be done here ?
virtual void BeHappy() = 0;
|
|
|
|
|
actually i detected the problem first time it copies all the data of file in buffer but in next executions it reads data from file only one character at a time.i dnt knw wat is the reason?
|
|
|
|
|
Can you open your file by Notepad.exe
before and after the first running ?
virtual void BeHappy() = 0;
|
|
|
|
|
yes i do there are no changes in file before and after running..
|
|
|
|
|