Stanford CS106B C++ libraries in XCode 4 - c++

I'm trying to use the Stanford CS106B C++ libraries, like simpio.h and genlib.h. I'm using XCode 4 (this is a beta version btw) and Mac OS X 10.6. I installed the libraries, but they don't seem to be showing up when I try to create a new project in XCode. Is there something different I should be doing with XCode 4 to get these libraries in?
There's probably a pretty basic solution to this problem, and if it were just a matter of frameworks in iOS, I could definitely get that to work with this version of XCode, but I've not really done this with C++ and XCode before, so I'm stuck.
Update on 7/20/11
I found a link to download the Xcode 2.5 tools as well as Xcode 3.0, both of which are described in the handout. I'm downloading both of them now. Does anyone know if Xcode 3.0 and 4.2 will run fine on the same machine?

Yes, multiple versions of Xcode work fine together. During the install, after the "Select a Destination" screen, you see a screen with the packages that will be installed. Click "Developer" folder to change to a custom location for each different Xcode version. The other tools (system and UNIX) cannot be moved.
After you have Xcode installed, just install your libraries in the usr/lib folder under your custom Xcode folder, and you should be good to go.

Related

Development an application with dependencies in macOS without Xcode

I have a project written in c++ using codelite IDE.
I compiled it windows, Ubuntu and Fedora successfully an I created installers for all of them (for Ubuntu a .deb package and for Fedora a .rpm package).
Recently, I could compile it in my macOS (10.14) an it works perfectly, and want to create a package in macOS (.app or .pkg).
It should be noted that my software has a lot of dependencies such as OpenGL frameworks and wxWidgets libraries and many libraries which I installed through brew and Xcode.
As mentioned my project is in codelite which does not generate a framework or .app package.
What should I do in this step?
Creating a .app bundle on the Mac is a relatively complex process - amongst other things, it has to be signed and notarised, and to do that you need to enroll in Apple's developer program ($99 per year).
So, because of that, I'd recommend creating an Xcode project to to the job. Once you have that, all the steps are automated. You will also be in a position to submit your app to the App Store, should you wish to.
A good way to build installer packages is to use Stephan Sudré's Packages application, which you can get here:
http://s.sudre.free.fr/Software/Packages/about.html
Don't worry that it isn't signed - it's perfectly safe.

How do I set up OpenCV for MinGW project?

I regularly use Code::Blocks and MinGW for my C/C++ projects. I would like to be able to use OpenCV, since it has a nice library for computer vision projects. They have dropped support for MinGW. I have heard you can build it on your own somehow, but I have no experience doing this with 3rd party libraries. Can someone explain how to build it in a simple way for MinGW?
There is, or at least there was at least until 2.4.6, precompiled version of opencv that works out of the box with mingw as long as you use the dw2(standard) version of mingw.
since i needed sjlj support i had to build my own version of openCV 2.4.6
I did he following - i am pretty sure it will work for the current openCV version as well
Setup your preferred Mingw Environment - i would strongly recommend to use gcc 4.5 or newer
Intstall Msys
Intall Cmake - you can get a binary package
Start the Cmake GUI
Select the openCV source folder
Click Configure and select MSYS-Makfiles
Errors in the first run of Configure might be resolved if you run Configure again
Click Generate
use MSYS make to run the generated makefile
Copy all desired libraries and include files to your mingw-installation or your project

C++ Programming on a Mac

I have installed Xcode 4.0 (XCode Toolset, System Tools and Documentation components only), but have Netbeans with the C/C++ plugin. However when I try to create a new C++ project in Netbeans it tells me that no compiler was found on my system. The recommended course of action is to install Xcode, which I have done so.
How do I get Netbeans to recognize that I already have Xcode?
Most likely, you reinstall Xcode and this time don't uncheck the option that installs the compiler, etc. under /usr/bin for command line use. What's wrong with just having a full installation of Xcode?
If that doesn't work, it may be an incompatibility due to Xcode 4 installing to /Xcode4 instead of /Developer. You can fix that with a symlink or by installing Xcode 3.

Where does xcode keep its default paths to librarys and headers?

I have a C++ app/project under Linux Eclipse. I started porting to Mac OS X. I use 4 cross-platform C/C++ libraries such as OpenCV, OpenAL Boost etc.
First I installed C++ and Eclipse for Mac. When I opened the project in eclipse it did not find any of my Linux includes. When I opened the code in xcode it solved some - for example OpenAL.
Where does Xcode look for libraries and headers?
Off the top of my head I'd say try the following locations:
/System/Library/Frameworks
/System/Library/CoreServices
/Developer/SDKs
Probably in the first option.
For Xcode 6.4 and the OSX 10.10 SDK, look here:
/Applications/Xcode/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks
Then expand the OpenAL.framework and double click on the Headers folder.

Eclipse Ganymede and MinGW in Windows

I'm trying to get eclipse to work with MinGW.
I've done the following:
Downloaded CDT for eclipse.
Installed MinGW.
Added C:\MinGW\bin to my path.
Opening a command prompt (CMD) and typing g++ or alike works fine.
I run eclipse, create a "New C++ Project", and only get the option saying "other toolchains".
There's a MILLION tutorials out there saying eclipse should identify MinGW on its own. It doesn't, and I don't know what to do. I've tried reinstalling everying in just about every order posible. Still no luck.
I've also noted some tutorials say something about creating a "Managed C++ Project". I've no such option, all I get is "C++ Project" and "C Project"
edit:
I have eclipse ganymede, windows x86_64, version 3.4.2
http://download.eclipse.org/eclipse/downloads/drops/R-3.4.2-200902111700/index.php
Running the "Eclipse IDE for C/C++ developers" fails, since there's no x64 version for windows. The x86 version requires x86 JAVA installed as well, and installing two versions of java, gave nothing but trouble in the past.
The instructions for setting up MinGW in Ganymede are located here.
The following are instructions and
links on how to install the current
version of MinGW. Note that these
links may become inaccurate over time
as new versions of MinGW components
are introduced. Please check the MinGW
File Release section for the latest
versions.
Download and run the MinGW setup program, MinGW-5.1.3.exe.
Select download and install the MinGW base tools and the g++ compiler.
You may select the Current or
Candidate version of these tools. You
may also install any of the other
available compilers as well.
Do not install the MinGW Make feature as the MSYS version of make
from step 5 is a more complete
implementation of make.
The MinGW setup program currently does not install the gdb
debugger. To install the debugger,
download the file from the following
location: gdb-6.6.tar.bz2
Extract the contents of the file gdb-6.6.tar.bz2 to the same location
where you installed MinGW.
If you want to use Makefile projects, download and run the setup
program from the following location:
MSYS-1.0.10.exe. MSYS provides an
implementation of make and related
command line tools. This is not
required for other types of projects
with the MinGW toolchain, which use
CDT's internal build tools to perform
the build.
Following this process resolved any problems I had.
I had the same exact problem with Eclipse Galileo and CDT 6.0.1. It turns out that CDT only recognized MinGW when it's located under c:\mingw. I had it in c:\msys\mingw so that was the problem. After I changed that everything worked fine.
The distinction between managed make projects and makefile project was removed in CDT 4.x, I think. Now there is only one type of project, but you can select different builders. CDT includes an internal builder which does not use makefiles and another one which does.
First, save yourself the effort of "reinstalling in every order possible". That is also known as trial-and-error, and will only make you more frustrated. Apply the normal problem-solving skills you have as a programmer.
Given that you have MinGW installed, what happens if you download "Eclipse IDE for C/C++ developers", start eclipse.exe, and try to create a C++-project with a MinGW toolchain?
EDIT: remember: the key in getting help with problems like these is to produce a minimal example which fails. Also, it would help if you provided URLs to the packages you installed (MinGW, Eclipse, etc.).
EDIT: I just installed CDT using the Ganymede update site, downloaded and installed MinGW from here, and restarted Eclipse, and everything worked fine. I know that doesn't help you, but it does prove that the toolchain detection isn't completely broken. Something is weird on your side.
You could try Wascana Desktop Developer. Its a distribution of Eclipse CDT configured specifically for developing on Windows.
I had the same problem (i.e. Eclipse not finding MinGW on the PATH) after I removed some of the unused files/folders from MinGW. It was ~600 MB and I was tasked to trim it down before adding to source control. I got it down to a workable ~200 MB. When I tried to re-create an Eclipse workspace afterwards, MinGW disappeared from available toolchains. It reappeared after I put the original MinGW install on the path.
HTH