where to find CMAKE_OSX_SYSROOT in IOS - ios

i am trying to install opencv on my Mac IOS and there is this step of Adding an SDK path to CMAKE_OSX_SYSROOT, it will look something like this /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk.
and Add x86_64 to CMAKE_OSX_ARCHITECTURES, but don't know how to do it

I'm assuming you're already in the CMAKE application and you're following either one of these sets of directions.
Possible Instructions:
http://blogs.wcode.org/2014/10/howto-install-build-and-use-opencv-macosx-10-10/
http://outofbedlam.github.io/opencv/2015/07/15/Build-OpenCV-MacOSX/
Given which steps you isolated, I'm assuming you also know how to check and uncheck boxes in the CMAKE window. To enter text, you just right click in the empty space ("value" section) to the right of the variable of interest. When I came across this step, the thing which tripped me up was confirming the path/determining the right thing to enter in the window.* TLDR: it turned out to be almost the same thing (for me at least) "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk."
To find your path you need to navigate to that folder WITHIN THE TERMINAL! (Using Apple's Spotlight Search (command + space bar) or using finder windows just won't work. Because they don't see "inside" the Xcode application within the Applications folder. Assuming your home directory is't at the root, you need to keep entering cd .. until you get to the section that outputs the following:
>>>/ $ls -1
Applications
Library
Network
System
User Information
Users
Volumes
anaconda
...
Then you change directories ..., and see what's inside...
>>> $cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
>>> SDKs $ls
MacOSX10.11.sdk
Combine the path with whatever you find in your SDKs folder and you're done (see caveat below)!
Additional Caveat: Those instructions don't say explicitely, but at the end of the whole CMake process, you have to copy the ...opencv/SharedLibs/lib/cv2.so file to your directory of python packages: home/usr/.../lib/python2.7/dist-packages/cv2.so. Based on the advice found here, I installed the cv2.so file from the SharedLibs folder instead of the StaticLibs folder and it worked.
*I tried doing a spotlight serach for the "Developer" folder or "Xcode.app" and nothing was coming up! I thought that folder/path didn't exist and googling around for "CMAKE_OSX_SYSROOT" with "Python" or with "opencv" and a whole bunch of other things made me think the problem was every more of a jumbled mess and problematic.

Related

Unable to locate sdkmanager.bat. Did you run Android Studio and install cmdline-tools after installing?

i was trying to make use of unreal engine 4 template for AR but i got this error. This step kinda connect android studio with unreal but i just don't work.
Ran into the same issue and fixed it by editing the SetupAndroid.bat file.
Example of adjusted code
Not sure why it doesnt set the location of the SDKManager after it fails the first one. But manually replacing the first location works.
if you encountered this issue when running "SetupAndroid.bat", the reason might be simple. If you check the "SetupAndroid.bat"(right click, edit. Or turn it into a txt), the default sdkmanager path might be different from the actual location.
You might need to search "sdkmanager" from the Android Studio SDK root folder manually(it suppose to display on the cmd interface), find the actual directory and correct the "SetupAndroid.bat", then try it again.
the same here, i tried to search "sdkmanager" at both of my Drive and couldn't find any.
couldn't find any cmdline-tools drive as well.
Try next:
Go to your AppData\Local\Android\Sdk folder
Search for sdkmanager.bat
Navigate to its location and copy it
Open SetupAndroid.bat with Notepad (or other editor of your choice)
Find the line(s) which contains sdkmanager.bat
Paste the copied location (for example \cmdline-tools\latest\bin\sdkmanager.bat)
Save, exit, and run the edited file
This worked for me.
I spent 2 hours to figure out what's wrong with it.
So, provided earlier solutions should fix it:
Simply just replace incorrect path to correct one or, just DELETE most outer IF block and first line where %SDKMANAGER% var first set to invalid (I suppose, outdated path) value.
This is a part of the source code of SetupAndroid.bat from Epic Games. I've checked version 4.27 and 5.1. These lines are kind of identical in both versions (however version 5.1 still has the same exact error, but it works due to changing the order of which path is tried first):
set SDKMANAGER=%STUDIO_SDK_PATH%\tools\bin\sdkmanager.bat
IF EXIST "%SDKMANAGER%" (
echo Using sdkmanager: %SDKMANAGER%
) ELSE (
set SDKMANAGER=%STUDIO_SDK_PATH%\cmdline-tools\latest\bin\sdkmanager.bat
IF EXIST "%SDKMANAGER%" (
echo Using sdkmanager: %SDKMANAGER%
) ELSE (
echo Unable to locate sdkmanager.bat. Did you run Android Studio and install cmdline-tools after installing?
pause
exit /b 1
)
)
And this specific part does not work! I don't know why those who developed that did not check it or they simply don't know how batch file variables work.
The thing here is that on recent Android SDK installations there's no folder tools at the path %STUDIO_SDK_PATH%. So the first condition check fails and then they try to overwrite variable value to correct one with path %STUDIO_SDK_PATH%\cmdline-tools\latest\bin. But this overwrite DOES NOT WORK. You can't just do that in a batch file (which is kind of stupid, but it is). More on that issue with batch vars here: How to overwrite an existing variable using another variable in batch files?
"Good" job! Epic Games

How to compile srlua?

I made a program today, and I was wondering on how exactly to make it an executable. I've researched and I've came up with using srlua. I've asked this previously, but I usually mess up on the same instruction. I was told to 'compile srlua' While I know exactly what to do right after I compile srlua, I don't know how to compile them right now.
I've gone through a few YouTube tutorials, and I managed to find one but only in Spanish. I was able to slightly follow along until he downloaded a precompiled version of srlua, where the download link is no longer there at the same page he was at.
Would anyone be able to explain what they're trying to say?
You need to tell CMake where the Lua files it needs are.
For me, the Lua includes are in /usr/include/luaX.X, where X.X is your version number, e.g. 5.3. The Lua libraries may be in /usr/lib (with filenames like libluaX.X.so).
If the locations differ for you, you can try find / | grep "lua.h" and find / | grep "liblua".
Once you've located the folder which lua.h is in, and the appropriate library file like liblua5.3.so, you need to add these to the CMakeLists.txt file in the srlua folder.
For example, using lua5.3, you might replace this line:
include_directories(${LUA_INCLUDE_DIR})
with this one:
include_directories(/usr/include/lua5.3)
And for the libraries, you might replace this:
target_link_libraries(glue ${LUA_LIBRARIES})
target_link_libraries(srlua ${LUA_LIBRARIES})
with this:
target_link_libraries(glue /usr/lib/liblua5.3.so)
target_link_libraries(srlua /usr/lib/liblua5.3.so)
After this, run cmake ./ in the srlua folder, then run make. srlua should be built.
Note: you may also have to remove the line find_package ( Lua REQUIRED ), it was a false error for me (it only built when I removed that line).

iOS - missing Platform Libraries

First of all, I've never worked on iOS, so this may or may not be a stupid question, I don't know :)
I have an iOS App, and I need to run it.
In the 'Project Navigator' I have a folder/package called 'Reuse and Platform Libraries'. Inside, I have another four folders but 3 of them seem like missing.
I am not sure if this is the case. I've tried googling their name but without results so I assume they are not some open source libraries.
Can someone clear this up for me? Do I need to install some XCode packages?
Thanks!
I suggest you search the folder of the project for those files, sometimes when copying a project the paths get screwed up because they were set as absolute paths and not relative paths.
If you can't find the files, it's most likely that the library is a private one used by the previous developers, and usually kept out of the project folder so they probably forgot to send it along. I'd suggest simply asking them to send the files over :).
There is also a slight chance they are not needed to run the file, in which case, just deleting them from the sidebar should make the project run.

Opencv dll issues

I was following a tutorial for object detection using opencv, I did it step by step but when I run it, I got this error -
The program can't start because opencv_244d.dll is missing from your computer.
Try reinstalling the program to fix this problem.
I don't know what is the problem because I can see this dll in opencv libraries, I have added the following to the input dependencies:
opencv_core244d.lib
opencv_imgproc244d.lib
opencv_highgui244d.lib
opencv_ml244d.lib
opencv_video244d.lib
opencv_features2d244d.lib
opencv_calib3d244d.lib
opencv_objdetect244d.lib
opencv_contrib244d.lib
opencv_legacy244d.lib
opencv_flann244d.lib
This is still not working, what can I do?
You can find the required dll files into the bin folder (that is next to lib folder where the .lib files are located), and you have two options:
1) copy the required dlls into the same folder with your application //this is a little better because it kind of prepares you for when you'll need to deploy your application on systems that don't have opencv installed (for then don't forget to build the release version of your application)
or
2) add to the Path in the Environment Variables your path to that bin folder (be carefull that the path in there are separated by ; )
I would advise you to build the OpenCV libraries from source so that you can have a custom installation specific for your system (this is always better since it gives you the option of using what you want/need and also the performance is better since the libs are custom-made for your system).
OpenCV does not contain a library file called "opencv_244d.dll".
Check all your dependencies and their names so you don't have any misspelled names. All the names are something like "opencv_name244d.dll" such as "opencv_photo244d.dll".

BlackBerry Screen Shot Utility ... Torch 9850 ... a how to guide on creating your own capture script/tool

I am providing this for everyone to hopefully save you some brain damage in finding this yourself.
As I'm working on a BlackBerry project that will run on various devices I ran into an issue grabbing screenshots from the handset (including the Torch 9850 ... not quite as good as my iPhones or my Android EVO or Infuse, but much better than the Storm and finally starting to look like a real smartphone - great performance and battery life too).
Normally I'd use my trusty BBScreenShooter and everything would be fine, but it kept crashing when attempting to capture images on the 9850. I posted a couple of requests for help on this site, but nobody could tell me why my BBScreenShooter was crashing or why I'd get "Retrieving screen <active> data ... Error: buffer too small" when using RIM's JavaLoader utility directly.
For those who didn't know BBScreenShooter delegates the "heavy lifting" to JavaLoader to grab the images.
With the help of Mark Sohm (easily one of the most knowledgable BB guys I know walking the planet) he asked me to verify I was using JavaLoader that is included in the v7 SDK. Turns out I wasn't. Good catch Mark, and thanks!
From the looks of things it appears the earlier versions of the JavaLoader utility have byte[] buffers they use for image capture that are hardcoded ... and too small.
So, for all those who need to capture screen shots from RIM's new 480 x 800 based handsets I have included a quick "how to" guide to help you get productive ASAP.
Step 1 - Make sure you have the v7.0 SDK downloaded (doesn't have to be installed, though I cannot think of a good reason not to). For Eclipse users:
Step 1a) Go to the Help menu
Step 1b) Install New Software menu choice
Step 1c) Add the "BlackBerry - http://www.blackberry.com/go/eclipseUpdate/3.6/java" items in your "work with" field.
Step 1d) Under the "BlackBerry Java Plug-in Category", look for the "BlackBerry Java SDK v7.0.0.X" checkbox and click NEXT.
Step 1e) Accept the license agreements and continue the download and installation process.
Step 2 - Go to the installation directory for your newly added SDK. We're going to grab a copy of the path to the JavaLoader utility and use it within a BAT file that will automate the capture and naming of screen shots. This will be found at /plugins/net.rim.ejde.componentpack7.0.0_7.0.0.28/components/bin/JavaLoader.exe
Step 3 - Create a folder you'd like to use to save screen captures. This will also hold your BAT file as the BAT file is specific to this particular project.
Step 4 - Create the BAT file. In my example here I keep all my IDEs, SDK, ... effectively all development environments on a different hard drive than my OS. I keep these on drive D, but modify your BAT to reflect the location and needs of your configuration.
Step 4a) It's important to turn the echo off, otherwise you will probably be unable to use the icon on the desktop to launch this script/utility.
Step 4b) If your BAT file is running locally (same folder) as JavaLoader then this step will be unnecessary. On the other hand if your JavaLoader is on a different hard drive and tucked away deep in folders then you'll have to "change directory" to get to it. Notice the "/D" switch that is used with the "change directory - cd" command so that we can change drives and paths in the same step.
Step 4c) As I like to use timestamps for part of my file names ... set local variables to represent the current date and time.
step 4d) The following "for" statements parse out the current date and time from my Windows 7 computer into a format that I want to include as the file names for my screen captures ... file name == BlackBerry_<date image was taken>_<time image was taken>.bmp.
Step 4e) Copy the newly created device screen shot that JavaLoader captured to your target folder and use the file name we've just created.
Step 4f) Now that we've successfully got a copy of the screenshot saved in our desired target folder we can delete the temporary image that JavaLoader created.
Step 4g) I echo a little statement that lets me know it all worked.
Example BAT file:
#echo off
cd /D D:\Program Files (x86)\EclipseBlackBerry\plugins\net.rim.ejde.componentpack7.0.0_7.0.0.28\components\bin
JavaLoader screenshot tempImage.bmp
set timestampdate=%date%
set timestamptime=%time%
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set timestampdate=%%c-%%a-%%b)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set timestamptime=%%a%%b)
copy tempImage.bmp "C:\Users\CirrusFlyer\Desktop\<project name>\Testing\Screenshots\BlackBerry_%timestampdate%_%timestamptime%.bmp"
DEL tempImage.bmp
echo Completed "...\<project name>\Testing\Screenshots\BlackBerry_%timestampdate%_%timestamptime%.bmp"
Step 5 - Close and save your BAT file. I kept the BAT in my actual project folder, then created a shortcut and placed it on my desktop. This way I can have my Eclipse up and running and be debugging the application on my handset, and when I want to grab a screen shot simply double-click the shortcut to execute the capture.
This will create screen shots and place them in the target directory: BlackBerry_2011-10-07_1015 PM.bmp, for example.
Step 6 - Your done. Happy coding. Hope this helps.
My next project: extending Eclipse so that I can do screen captures directly from within the IDE the same way I can when doing Android based programming.

Resources