mex error 206 Matlab - c++

The cpp code I received for a project isn't working so I want to compile and see if it compiles. It didn't compile, but I tried compiling another cpp file that I know works just to see what would happen. In both cases I get the following error:
EDU>> mex max.cpp
xcodebuild: error: SDK "macosx10.7" cannot be located.
xcrun: error: unable to find utility "clang++", not a developer tool or in PATH
mex: compile of ' "max.cpp"' failed.
Any suggestions how I can either fix the cpp file or maybe I'm not running this correctly? Can't figure out where to go from here.
EDIT:
I figured it out. My mexopts.sh file was pointing to an old version of mac so I had to manually edit that file and change 10.7 to 10.9.

I figured it out. My mexopts.sh file was pointing to an old version of mac so I had to manually edit that file and change 10.7 to 10.9.

Related

Cannot find Valgrind executable for use with CLion?

I am trying to connect Valgrind with CLion 2020.2.1 for testing purposes, but CLion (and perhaps I) cannot locate the Valgrind executable.
The path I am currently using is:
\\wsl$\Ubuntu\usr\bin\valgrind
But when I try to run anything with Valgrind using this path I get a message stating that it cannot run the program because of this error:
CreateProcess error=193, %1 is not a valid Win32 application
Which seemed to make sense upon further research, as what I am selecting (\usr\bin\valgrind) appears to be a .cpp source file and not an executable - as the error would indicate - but now I don't know what the issue is. If that isn't what CLion is looking for, then where is the file it is looking for?
Have also tried path '/usr/bin/valgrind/' which resulted in "Valgrind executable not found." when I tried to compile.
If anyone has any advice it would be greatly appreciated!!

Xcode command line tools not finding header files (Catalina Update 10.15.7)

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!

error when trying to compile with MinGW: cannot execute cc1plus

I did a clean install of MinGW on Windows 7 32bit with the GUI Installer, and installed
ming32-base-bin
mingw32-gcc-g++-bin
msys-base-bin
When trying to compile a simple "Hello World.cpp" from the cmd.exe i get the error:
C:\Users\Lorenzo\Desktop>g++ "Hello World.cpp" -o"Hello World.exe" -m32
g++: fatal error: cannot execute 'cc1plus': CreateProcess: No such file or directory.
compilation terminated.
The weird thing is that by grabbing the file from the desktop and putting it over g++.exe (so that i open the file with the application) in the MinGW directory, i don't get any error.
A temporary fix i found was to have a new environmet variable pointing in the folder where cc1plus is (C:\MinGW\libexec\gcc\mingw32\9.2.0). The program runs but doesn't include the libraries from C:/MinGw/lib and C:/MinGw/Include, i have to include those manually, which shouldn't occur (i guess).
I don't want to do this crude fix since i know i'll encounter some other problems with time.
Ok. I found the solution with some luck.
It is as simple as adding .exe to g++
> g++.exe *input file* -o*output.exe*
Don't Know if it's a bug or not, but this works for me.
I'm not sure which MinGW you used exactly, but it's better to use MinGW-w64.
There is a standalone build you can get from http://winlibs.com/ that doesn't require installation. The site also gives some instructions on how to use it.

How do I run a simple C++ program in the Cloud9 IDE?

I am working on a translation application in my high school Computer Science Advanced Studies class. MY school's computers have a CodeBlocks IDE, but no compiler installed. So, I decided to try and find one online that I can use, and Cloud9 seemed like a good prospect. However, when I try to run my program, I get errors such as the following:
g++: error: /home/ubuntu/workspace/English-Spanish: No such file or directory
g++: fatal error: no input files
compilation terminated.
chmod: cannot access ‘/home/ubuntu/workspace/runme’: No such file ordirectory
sh: 1: /home/ubuntu/workspace/runme: not found
I'm not sure where the problem is or how to fix it. Any tips? I'm new to the online IDE scene.
Looks like you didn't add any source code to your project.
I figured out what was wrong. It was a simple mistake, really. My project's filename was "English-Spanish Translator," but spaces are not acceptable for filenames. I renamed it "eng-esp_translate.cpp," and it ran just fine.

fatal error: 'libpq++' file not found

I would love to use libpq++ library in my C++ project but I am unable to get it working.
So far, I have installed libpqxx-dev libpqxx-4.0 packages on my Ubuntu 14.04 and provided -llibpq++ to clang++.
However, no matter what I do, I still get following error:
src/serverdata.h:4:10: fatal error: 'libpq++' file not found
It seems that I didn't install libpq++ properly but I don't really see any problem.
Any help would be highly appreciated.
Seems to me, your src/serverdata.h has 4th line like:
#include "libpq++"
If so, change it to something like:
#include <pqxx/basic_connection.hxx>
PS. Files in dev packet are listed here