Programming :: Detect Current OS In Compile Time?
Dec 8, 2010
Code:
#if defined(WIN32) || defined(WIN64)
#define WINDOWS
#endif
[code]....
what is the directive thats required to detect a linux system? i want to to be able to detect which platform im compiling on automatically.
View 5 Replies
ADVERTISEMENT
Jun 9, 2010
Is there a way to get the current time as provided from NTP (not the currently set time on the server)?
View 4 Replies
View Related
Jun 28, 2010
Detect the current window that has the focus. For example at the moment am using firefox therefore teh function should say firefox is the main window.
View 2 Replies
View Related
Jun 18, 2010
I'm looking for a function (prefer POSIX, but Linux specific would do if it has to) to get the current timezone offset. For my location, eastern USA, that should be -14400 when daylight time is in effect, and -18000 otherwise.
View 1 Replies
View Related
Jan 15, 2011
It is known and well described in C++ standard ('C++ Standard - ANSI ISO IEC 14882 2003.pdf') that under certain circumstances types are promoted - for example, 'int' is promoted to 'double'.My design goal is to create wrappers around standard scalar types (like 'double', 'float', 'long', etc.) that would prevent such conversions/promotions, i.e. I want to create a really strictly typed C++ environment (like, say, OCaml).
However, the promotion is caught at runtime.Is there a way in C++ to catch/block such promotions/conversion at compile time ?
View 7 Replies
View Related
Jan 14, 2010
I want pass a variable at compile time.
for example in x.c
int global_var = POSITION;
How can I send this POSITION at compile time. ie like # make POSITION=10 Is it possible?
View 5 Replies
View Related
Dec 25, 2010
How can I print the current time of my system with a batch file. My os is ubuntu.
View 4 Replies
View Related
Jan 10, 2010
I have a program with a variable named current, but it is not declared. The syntax is current -> othervariable. Theoreticaly there should be no problem with this program. Just wondering what woudl cause this? Which linux include file is current supposed to be declared in?
View 2 Replies
View Related
Jun 19, 2011
Under a Linux shell, how can I change the creation time of all a folder's files to the current time?
View 2 Replies
View Related
May 22, 2010
I'm looking for a good IDE for C/C++, that runs well in slackware. I used CodeBlocks, but I can't compile in the current, and its getting a little old. I see a lot of threads talking about anjunta and kdedeveloper, but I don't like these.
View 14 Replies
View Related
Dec 29, 2010
For sake of a clear picture of the problem, pretend I don't know anything about compiling.
How would I re-compile my current kernel's source? It's the i686 optimized kernel I selected from the install disc.
View 10 Replies
View Related
Mar 22, 2010
I'm trying to compile tolua++ so that i can use lua in conky 1.7.2, however I am running into a problem. tolua++ defaults to looking for lua 5.0 libraries and I have lua 5.1 installed since that is what conky requires. According to the README tolua++ can use lua-5.1 but I not sure how to configure tulua++ to use those libraries since it uses scons. Here is a what the README says...
Compiling for lua 5.1
Starting from version 1.0.8pre1, tolua++ can be compiled with both lua 5.0 and
5.1. Both versions will output the same code, and the C API (tolua++.h) is the
same.
The build system is not yet ready to detect/decide when to compile for 5.1,
the easiest way right now is to add a file called 'custom.py' on the root of
the package, with the following:
## BEGIN custom.py
CCFLAGS = ['-I/usr/local/include/lua5.1', '-O2', '-ansi']
LIBPATH = ['/usr/local/lib']
LIBS = ['lua5.1', 'dl', 'm']
tolua_bin = 'tolua++5.1'
[Code]....
View 1 Replies
View Related
Mar 10, 2010
I just used sbopkg to download and compile Digikam 1.0.0 from slackbuilds.org. But compilation stops with an error regarding "png loader". I guess this has to do with the libpng issue mentioned in the changelog.
Nevertheless: Has anyone been able to compile Digikam on the latest Slackware64-current?
View 10 Replies
View Related
Jan 8, 2010
I'm using the slackware64 current slackbuild to build a new firefox for -current 32 (I like dynamically linked cairo for fonts). But I am getting a compile error...
c++ -o host_dump_symbols.o -c -O -I./../.. -I. -I. -I../../../../../../dist/include -I../../../../../../dist/include/breakpad_linux_common -I/tmp/mozilla-1.9.1/dist/include/nspr -I/tmp/mozilla-1.9.1/dist/sdk/include -I/tmp/mozilla-1.9.1/dist/include/nspr dump_symbols.cc
[Code]....
View 7 Replies
View Related
May 2, 2010
Running slackware-current
The krusader slackbuild crashes on my machine with the following error, see attached.
View 3 Replies
View Related
May 1, 2011
My linux laptop isn't able to detect the current battery state. I am using slackware64 13.37 xfce with a Toshiba L645 laptop.
This is what I came up with so far.
Code:
lsmod
Module Size Used by
snd_seq_dummy 1479 0
snd_seq_oss 30116 0
[Code].....
I use a program called conky that reports my cpu frequency and most of the time it's always at 0.93GHz instead of 2.53GHz. Sometimes it jumps to 1.20GHz and 2.53GHz but falls back down to 0.93GHz. Is this normal?
View 13 Replies
View Related
Apr 4, 2010
I tried to install VirtualBox 32 bit on my 64bit Fedora11 OS. I took the 32 bit version as I want to run a 32bit software. I collected all information I could get from other forums. That's what I did: I downloaded and installed [URL]
yum groupinstall "Development Tools"
/etc/init.d/vboxdrv setup
Now I got stucked with the error Qt WARNING: QGtkStyle was unable to detect the current GTK+ theme. I searched for qt or qgtkstyle on my system and found files containing both but don't know what to do here.
View 2 Replies
View Related
Jun 26, 2011
Why is the output of the following commands different?
root@vmi2115:/var# hwclock
Sun 26 Jun 2011 01:21:38 PM CEST -0.273230 seconds
root@vmi2495:/var# date
Sun Jun 26 15:21:39 CEST 2011
root@vmi2115:/var#
And can I change the current time on Linux?
View 4 Replies
View Related
Aug 15, 2011
I want to recompile apache so I can select a different MPM compile time option. I have looked in the graphical application manager, but I don't see a development version of apache like you do for many of the packages. Am I not looking in the right place for the source code for the Apache 2.2.17 available with FC14?
Alternatively, I can download the source from apache.org for 2.2.17. However, the install options default to a host of different directories than the FC14 version does. Being somewhat OCD I hate to mess up my FC14 system by installing to a bunch of anomalous directories, and I don't want to break anything. I can change the default install directories, if I knew what the FC14 apache 2.2.17 was compiled with. There is an httpd-devel-2.2.17-1 package. But the description makes it sound like it is for developing additional modules. I want to recompile the main httpd-2.2.17-1 package. Does anyone know if this is a possibility?
View 3 Replies
View Related
Feb 18, 2011
I want to know the time on a server accurate to the millisecond.there's this way:
local $ ssh user@servername
Welcome to server!
server $ date
Fri Feb 18 11:27:50 EST 2011
But I need more accuracy. Is there a command that will be more precise?
View 2 Replies
View Related
Dec 7, 2010
I am using the Terminal. I would like to know how do I put the current date and time on my machine and the date from a certain URL that has .php extension into a file.
View 3 Replies
View Related
Jan 18, 2009
After much too often wondering "hey, when did I actually start this time-consuming command?", I'm considering adding a timestamp to my bash prompt.My first try was simple: PS1="(A) $PS1" which gives a display like:(16:58) exscape ~ #
However, the problem with that approach is that it displays the time when the line was written, not when the command on it was executed. So, if I run "ls" at 16:58, and get a new prompt "(16:58) ..." and then run the next command 2 hours later, it'll look like this:(16:58) exscape ~ # new-commandI of course want the line to display the time when the command was actually run, not when the prompt appeared.
View 9 Replies
View Related
Jan 9, 2009
I need to know how to get the current time with nano seconds on a linux box using c++?
View 3 Replies
View Related
Jun 9, 2011
I need to write a small application which needs to detect if the system time is changed by an another application/user and perform some action as soon as it is detected (maybe log the data that time has changed, along with info about which application/user changed it).
How can this be achieved?
I have good programming experiences in shell script, c and beginner level in python.
I don't need to know when it was changed, just need to know who/what changed it.
The system uses NTP to sync the time, but it is also possible for anyone/any application to change the time(for eg: using the simple "date" command as well).
View 2 Replies
View Related
Jul 24, 2010
Does anyone know if there exists a screen saver which simply displays the current time? That would allow me to quickly determine what time it is whether I'm sitting at my computer or sitting across the room
View 2 Replies
View Related
May 21, 2010
Sometimes it is possible to trick a Linux app by calling it like this:
HOME=/tmp/foo myapp
This would make myapp think /tmp/foo is the home directory, it won't try to get the user id, find its home directory via getpwent(). This is useful when myapp must be forced to dump some of its config files into a non-standard location different than ~.
A similar trick can be done like this: LANG=foo LC_ALL=bar myapp
This is useful when myapp needs to be called once with a different locale without having to make the change persistent by using the export bash built-in or even modify stuff in /etc/profile.
Is it possible to pull the same trick with time and date? The goal is to make an app use another time than the system ones. The final goal - to make timestamps that appear in logs/commit messages not being tied to the system time.
View 1 Replies
View Related
Aug 21, 2011
I am reading about jiffies in linux kernel. In one of the related example in the book Linux Device Driver, the author use
head -8 /proc/currentime
to print out some time information.
However this file is not present in my linux installation (kernel: 2.6.32-131.6.1.el6.x86_64). Why is it the case? Is it because the file path is no longer valid, or it is a distribution feature thing? It is not present in OSX too. What would be an equivalent in OSX?
View 1 Replies
View Related
Jan 20, 2011
[URL] While I could follow it: For what I am trying to do, it did not work. how to get it working?
View 8 Replies
View Related
Aug 26, 2010
I want to run a script that runs after every 15 minutes that i will do using crontab. But in script want to search a string from the last 15 minutes logs in log file containing data of whole day.
how i can search the string according to time difference that is logs from from current time and current time - 15 minutes.
Sample logs are as follows:
26-Aug-2010 16:38:46,055|9172310750|subscription_app|31ba267e%3A12aadd47bdc%3A50e9|ChargeAmount|ChargingIntercep tor - subscriber details processed sucessfully- {arg0.referenceCode=balanceEnquiry:true;subsChannel:Unknown;channelType:Subscription;transactionId:3
[Code]....
View 6 Replies
View Related
Jan 27, 2011
How to change the hostname without affecting current status ie i dont need to change the already having time, just rename the hostname.. what is the command to refresh
View 2 Replies
View Related