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
Related
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.
Recently I have updated my MacBook operating system to Catalina 10.15.7 and Xcode command line tools to 12.1. Ever since I have been getting the following error when I try to use any C++ compiler:
gcc A3v2.cpp
In file included from /usr/local/include/c++/9.2.0/bits/postypes.h:40,
from /usr/local/include/c++/9.2.0/iosfwd:40,
from /usr/local/include/c++/9.2.0/ios:38,
from /usr/local/include/c++/9.2.0/ostream:38,
from /usr/local/include/c++/9.2.0/iostream:39,
from A3v2.cpp:13:
/usr/local/include/c++/9.2.0/cwchar:44:10: fatal error: wchar.h: No such file or directory
44 | #include <wchar.h>
| ^~~~~~~~~
compilation terminated.
I have tried removing and re installing command line tools but it hasn't worked (amongst trying various other solutions I've found on Stackoverflow). When I run sudo find on wchar.h I get the following.
sudo find /Library -name wchar.h
find: /Library/Application Support/com.apple.TCC: Operation not permitted
/Library/Developer/CommandLineTools/usr/include/c++/v1/wchar.h
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/wchar.h
As a current work around (as I need a c++ compiler for a current assignment) I have been using:
/usr/bin/gcc A3v2.cpp
however I'm hoping this will just be temporary. I think this is a path problem since the missing header file exsits? Not sure what I am doing when it comes to specifying file paths so please let me know if you know how to solve this. Thanks!
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.
If I start gdb -tui or gdbtui with an -g flag compiled file, then set b main and press r I get the hint dl-debug.c:74 no such file or directory and the output while stepping through the source window will be written to the source window at the bottom, which also messes up this window so that is not really readable. I've already looked at askubuntu.com and Sourceware Bugzilla – Bug List and at this site but found no solution.
I also tried out sudo apt-get install ddd on another machine to go to the trouble out of the way, but then I only get authentication failure, which I also already asked without response on ask ubuntu.
Any help or hint is appreciated.
dl-debug.c:74 no such file or directory
This message means that you've tried to step into GLIBC (more precisely the dynamic loader) source, which you didn't install.
Solution: don't try to step into it, or install GLIBC source and make GDB find it (help directory).
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.