Tag Info

New answers tagged

1

The CXX variable doesn't affect how the shell resolves program name g++: that just follows the usual conventions of your executable search path $PATH, and is finally determined by a symbolic link e.g. on my 14.04 system $ which g++ /usr/bin/g++ while $ ls -l $(which g++) lrwxrwxrwx 1 root root 7 Apr 7 2014 /usr/bin/g++ -> g++-4.8 If you want to ...


0

If at all possible, you should probably develop this from a live DVD/USB so that you don't have to worry about making a mistake. Push your work to a remote server just in case and then do all of your development on the live device so if something goes wrong, you can just wipe it and reinstall it without losing any personal data.


0

here you have written : if ( stromp(pass, passsword) == 0 ) which is incorrect...it is strcmp function correct code is here below #include <stdio.h> #include <stdlib.h> #include <string.h> #define password "Please enter your password" int main(int args, char *argv[]) { char pass[100]; printf("Please enter your password\n\n"); ...


0

It's a bit appalling to watch. Use only uppercase alphabetical characters, underscores or numbers to define constants or macros, in order to not mix them with other symbols int main(int argc, char *argv[]) Compound statements must be grouped with {}, not with () stromp() is not a function, strcmp() is ptintf() is not a function, printf() is Use whitespace ...


0

All the compiler options, include and library paths, and library directives required to build a simple mysql client should be provided by the mysql_config utility. In particular, nothing in /var/lib/mysql should be required. Unfortunately AFAIK Eclipse CDT does not currently support direct command substitution within the IDE. (IIRC it now supports ...


0

Add -lrt after the source file, example: g++ -O3 -o netmon netmon.cpp -lrt Here is an other discussion about the same problem.


2

Add the path to the header (snap-core, snap-adv, glib-core, snap-exp) and the object file Snap.o Example for: examples/graphgen/graphgen.cpp: g++ graphgen.cpp ../../snap-core/Snap.o -I../../snap-core -I../../snap-adv -I../../glib-core -I../../snap-exp


1

You can use system() function defined in the header stdlib.h. #include<stdlib.h> int main() { system("dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 \"org.freedesktop.login1.Manager.PowerOff\" boolean:true"); retrun 0; } This is advised over sudo shutdown because the former doesnot require root ...


1

… how can I send commands to terminal from my program … Using system, eg: #include <stdio.h> #include <stdlib.h> int main() { system("/bin/ls -la"); } or #include <stdio.h> #include <stdlib.h> int main() { system("sudo shutdown"); } Example % gcc foo.cpp % ./a.out [sudo] password for aboettger: % cat foo.cpp ...


1

Without understanding your PATH variable, I believe, there are some typos export PATH=$PATH:/opt/local/bin:/opt/local/sbin:/usr/bin/c++/usr/bin/make between .../c++ and /usr/bin... Use export PATH=$PATH:/opt/local/bin:/opt/local/sbin:/usr/bin/c++:/usr/bin/make And install g++ sudo apt-get install g++


1

Due to the mentioned page in your question Usage … A helper script named Magick++-config is installed under Unix which assists with recalling compilation options required to compile and link programs which use Magick++. … I believe, you looking for the following: % apt-file search Magick++-config graphicsmagick-libmagick-dev-compat: ...


1

The following command (apt-file) works if you know the name of a needed file, but not necessarily the package name. However, if you know the package name, it works with that too. ... "apt-file find" would be used to look for what specific file (of a package) is installed via the command line. Then "apt-get install" (via the command line) would be used to ...


0

After installing libmagick++-dev: sudo apt-get install libmagick++-dev I ran: sudo apt-file find Magick++.h This gave me multiple hits, but the relevant one was: /usr/include/ImageMagick/Magick++.h


2

Let's see $ apt-cache search dev | grep magick libmagick++-dev - object-oriented C++ interface to ImageMagick - development files libmagickcore-dev - low-level image manipulation library - development files libmagickwand-dev - image manipulation library - development files php5-imagick - ImageMagick module for php5 graphicsmagick-libmagick-dev-compat - ...


0

The best solution I could find is to make a separate daemon that run as service which monitor /dev/input/.. events and let the other user tools to connect to itself and listen for input events. Think something that replace XEvent. (bringing those input events to user space)



Top 50 recent answers are included