svm-scale: command not found - c++

I am running a cpp code in xcode along with opencv. Inside the cpp code, there is a command line:
system("svm-scale -r allrange test_ind>> test_ind_scaled")
When i run the code, it's give a error like svm-scale: command not found
But when i run this command line (svm-scale -r allrange test_ind>> test_ind_scaled) from terminal, it's giving no error.
Any suggestion how to run this command line from inside the cpp code ?
Any suggestions would be greatly appreciated.

Try running svm-scale with its full path. Reading other xcode-related questions hinted that xcode might not use your PATH variable, so system doesn't know where to look for the specific command.

Related

CreateProcess error=206, Eclipse CDT with GCC compile ThreadX+GUIX

When I compile ThreadX+GUIX project of eclipse CDT with arm-none-eabi-gcc(Win7 64bit). It come out make (e=206). I found the same problems happened almost in JAVA development,but their solutions are not work for the CDT. Here is the compile error information:
I know the reason is because the GUIX has 1311 source files, and the compile and link operation command comes beyond the 8192 command limit. I have try to update the eclipse ,and move my workspace to the root of disk ,but the error still comes out. Now I don't know how to solve this problem. Anybody help me
If it is failing during linker/librarian stage, I modify the librarian command line to use an object_list.txt file to feed in the object file list, rather than specify them all on the command line. So something like this:
arm-elf-ar -r libguix.a #../object_list.txt
I use a python script to generate object_list.txt from the list of .c files, so it looks like this:
./common/src/gx_accordion_menu_create.o
./common/src/gx_accordion_menu_draw.o
./common/src/gx_accordion_menu_event_process.o
./common/src/gx_accordion_menu_position.o
./common/src/gx_animation_canvas_define.o
./common/src/gx_animation_complete.o
./common/src/gx_animation_create.o
./common/src/gx_animation_drag_disable.o
etc...
In your eclipse IDE there are settings to run your own custom linker command line rather than the default command line that isn't working.
Let me know if that helps you.

How do you use Clang-format on Emacs, Ubuntu?

I'm new to Ubuntu and Linux, so I'm sorry if this question seems to be too stupid. I hoped to have a function that can automatically format my C++ codes, so I installed clang-format by the following terminal command:
sudo aptitude install clang-format
To make it work with Emacs, I searched on the Internet for a solution and modified my "~/.emacs" file, adding the following line:
(setq clang-format-executable "/usr/bin/clang-format-6.0")
Now in Emacs, when I used the command M-x clang-format-buffer or similar commands on a C++ file, it succeeded, but the source code didn't seem to be formatted at all (sorry that I can't directly post images for some reason):
https://i.stack.imgur.com/gNIvn.png
https://i.stack.imgur.com/eKLXl.png
Is there anything else I'm missing in setting up clang-format, or what's the proper way to set it up?
I appreciate any help!
I got it.
First, installing Clang-format this way was unnecessary. The proper way to do it was by using Emacs' package-install command.
package-install clang-format
Then I did this in the .emacs file:
(load "/usr/share/emacs/site-lisp/clang-format-6.0/clang-format.el")
Hope this helps anyone facing the same problem.

How to run c++ program in mac terminal

I have installed c++4.9 in my mac, but compilation just terminated somehow. Could someone tell me why? thanks!
If you read the line above "compilation terminated." you get an explanation of why. #include <wchar.h> was the cause of the error: wchar.h could not be found. Please read the errors the compiler shows you.
Chances are you need to reinstall the command-line tools.
It seems like the top of your terminal output (which actually prints the call to g++) is missing, but the directory that holds wchar.h is not being found. On my mac it is /usr/include/c++/4.2.1/tr1. You can add the directory to your path:
> export PATH=$PATH:/user/include/c++/4.2.1/tr1
Or use a makefile that searches this path for headers.
Of course, you need to make sure you have this header in the first place.
Go to http://developer.apple.com and command line tools installer for Mavericks otherwise you can just type this in your terminal to install all the command line tools
xcode-select --install

xtk-deps.js file missing?

I am ref to https://github.com/xtk/X/wiki/X:DevelopersHeadsUp
I tried Running XTK during development.
I did the following steps
1) Fork XTK on Github to get the latest sources http://github.com/XTK/X
2) Clone it to your hard drive
But i couldn't find the xtk-deps.js file in the folder.
When i try
./build.py -d
Its complaining that "The command line is too long" and not generating xtk-deps.js file. Can some one help me where i went wrong ?
Yep, the error comes from the python script builds via a shell command line which is too long for the Windows prompt. The best is using Linux or Mac, or we can give you one and then you'll have to edit it manualy when you add/remove classes but it's not the easiest !

How do you run a command line program after compiling with GCC on OSX?

Some of Facebooks programmer puzzles look fun, so I'm trying to get set up to code in C++ on my mac. I decided to try compiling some of my old CS homework with GCC to get started.
My code compiles fine, but when I try to run the executable (called "encrypt") I get this:
-bash: encrypt: command not found
I checked the permissions on the file and it seems to have execute permission. What am I missing here?
The current directory isn't in your $PATH, so you have to tell the shell to execute encrypt in the current directory.
./encrypt
or
/path/to/directory/encrypt
You need to execute it as ./encrypt
Try ./encrypt rather than encrypt. Bash won't look for executables with relative paths outside the path.