I am new to iOS/Objective C and I am currently trying to set up an environment on my Windows PC to compile and execute Objective C codes.
I googled it and I found that I have to use GNUstep. I already installed it and I created a .mak file and a main.m file in the folder where I work.
Then I opened the shell from GNUstep and change directory to the folder where my files are locate. When I type make, it says: make: *** No targets specified and no make file found. Stop.
I have googled for the error and it says that this error shows that there is no make file. But I have created a make file called GNUmakefile.mak in the directory where the main file is located.
Can someone please help me?
It is not possible. You need Xcode on OS X to develop apps for iOS and OS X
Related
I have a very basic question, I installed Oracle VirtualBox, and I imported and run a virtual machine image (OVF file format) which contains a .C code example which I can compile and run without any problem.
See this print screens:
https://i.ibb.co/gmZds9B/Img1.jpg
https://i.ibb.co/gFzFbRK/Img2.jpg
But what if I want to upload and compile My Own .C code (for example: "myCode.c") from one of the folders in my computer?
I don't see any menu for opening or uploading a file from my PC.
Please advice,
Thanks!
I'm trying to compile a python program using Pyinstaller that will run PyQt5 QtWebEngineWidgets. Unfortunately there seems to be an issue with the relative path to QtWebEngineProcess.exe within the pyinstaller build.
I installed pyqt5 to be used with Python 2.7 following this method:
https://www.riverbankcomputing.com/pipermail/pyqt/2016-December/038450.html
When I compile this the executable runs fine on my machine but if I move the executable to a computer that does not have Qt installed then it gives me the error 'Could not find QtWebEngineProcess.exe'
Within the dist folder of the pyinstaller build there is a 'PyQt5/Qt/bin' directory that contains QtWebEngineProcess.exe. However I'm not entirely sure why it's not linking to this and still linking to the one in C:\Qt.
I'm certain it's still using the QtWebEngineProcess.exe installed at C:\Qt because if I change that directory name, the built program will fail on the machine I built it on.
At this point I'm trying to edit the paths within the qt.conf file contained in the bin file within the pyinstaller dist directory but I'm not entirely certain that's the answer to this. Ultimately I want a single file executable and by that point I can't edit the contents of the executable.
Thanks!
-Mark
I have installed SenchaSDKTools-2.0.0-beta3-windows on my windows Xp 32-bit.
following is the command I am running on command prompt.
C:\Program Files\SenchaSDKTools-2.0.0-beta3>sencha app create MyApp c:\xampp\htdocs\sencha\myapp\
Giving following error
[ERROR] the current workind directory (C:\Program
Files\SenchaSDKTools-2.0.0-beta3>) is not valid SDK directory. Please
'cd' in to a SDK directory before executing this command.
environment variable has been set following way.
Variable name : Path
Value : C:\Program Files\SenchaSDKTools-2.0.0-beta3
can anyone figure out what exactly wrong in this process ?
*****Sencha Touch setup Guide steps(in Window)******
Download Sencha Touch SDK Tool. (http://www.sencha.com/products/touch/download/ -->SDK Tools Beta for Developers). Run .exe file. It will install tool to default path. (i.e. C:\Program Files\SenchaSDKTools-2.0.0-beta3)
Download Sencha Touch SDK. (Download openSource version file licensed under GPL.).
Extract SDK you just download in step 2.
Open Command line terminal (start->Run->type cmd). Change directory path to SDK path as you just extracted in step3.
Verify that Sencha Command is working properly on your machine. So Type Sencha.
E.g. sdkPath>sencha
you will see "Sencha Command v2.0.2" message with other sencha command detail.
Create app in your web directory by typing following.
E.g. sdkpath> sencha app create firstSenchaApp "path/ to/ www"
(If you have tomcat 7 installed in your computer, give path to \apache-tomcat-7.0.30-windows-x86\apache-tomcat-7.0.30\webapps)
Note: There must not be space in directory path name. _(underscore),- (desk) are allowed.
If app is not generated in step 6. There might be an error. There are as follow:
If error message appear is "sencha' is not recognized as an internal or external command, operable program or batch file.”, follow these steps to troubleshoot:
The path to SDK Tools directory is prepended to your system's PATH environment variable.
From the terminal, run
echo $PATH or echo %PATH% .
The SDK Tools directory should be displayed in part of the output. If this is not the case, add it to your PATH manually.
The environment variable SENCHA_SDK_TOOLS_{version} is set, with the value being the absolute path to the installation directory mentioned above.
For example: If the installed version is '2.0.0-beta2', a SENCHA_SDK_TOOLS_2_0_0_BETA2 must be set.
From the terminal, run
echo $SENCHA_SDK_TOOLS_2_0_0_BETA2 or echo %SENCHA_SDK_TOOLS_2_0_0_BETA2% on Windows.
If the output is empty, set the environment variable manually.
Wrong Current Working Directory
A common mistake is not running Sencha Command within either a valid SDK directory or an application directory. If the current directory is not a SDK or application directory, "sencha" command will fallback to backwards-compatible mode. As of SDK Tools release "2.0.0-beta2", you should see a clear warning in such case:
"The current working directory (...) is not a recognized Sencha SDK or application folder. Running in backwards compatible mode." So in this case follow proper step as mentioned above.
Reference:
http://www.sencha.com/forum/showthread.php?192169-Important-SDK-Tools-Sencha-Command-Update
There is an invisible file that you need to copy, called .senchasdk. Make sure it is in the folder.
I think you're having the same problem I had; I had attempted to run 'sencha app create...' from the folder containing sencha.bat. Instead, you need to run 'sencha app create...' from the sencha-touch-2.0.1.1 folder (which contains the .senchasdk file).
See this previous SO question!
Save my days.
By the way, if you can't extract the sencha-cmd to sdk tools, try to extract on other location and copy the folder [3.0.0.250] to your sdk tools > [bin] folder.
hope this helps.
Suppose you create a new Mac OS Command Line Application using Xcode, which prints something. How do you actually find and run it using your command line or Finder?
Application was "built", but project directory structure does not seem to contain an executable file. For what matter in what format will this file be?
Please advise
This should help out:
Choose to build your project for archiving (Product->Build
For->Archiving).
The executable will be created and placed in the project build
folder. This will typically be something like
/Users//Library/Developer/XCode/DerivedData//Build/Products/Release.
If you wish, copy the executable to a more convenient location.
To run it, open up a shell window, browse to the executable
directory, and type in your command name.
EDIT
I see you mentioned iOS in your question and tagged it as such. This answer is NOT relevant to iOS, infact I see no option to build a command line application for that system and it doesn't really make much sense to have one.
I am trying to load an extension to sqlite3 for use within iPhone application objective-c code. I successfully compiled the c file of new functions into a dylib named libsqlitefunctions.dylib. Here is where I am a bit lost. I call sqlite3_load_extension as follows:
char *error = sqlite3_malloc(MAX_SQLITE_ERROR_MESSAGE_SIZE);
const char *library = [#"libsqlitefunctions.dylib" UTF8String];
if (sqlite3_load_extension(database, library, 0, &error) != SQLITE_OK) {
message = [NSString stringWithFormat:#"%s", error];
}
sqlite3_free(error);
No matter what I do, I get the error: dlopen(libsqlitefunctions.dylib, 10): image not found
I tried:
indicating the fully qualified path to the dylib
indicating a relative path
not indicating a path (as shown above)
adding the dylib as a framework
adding the .c file to my project and compiling it into a .o file and then trying to load it
Please note that this is not an entry point problem, since I pass 0 as that arg. This will force the dylib to load by calling an init function defined in the dylib. I do not even get to that point.
I am pretty much a newbie compared to the rest of you guys and feel that I am probably lacking an understanding of how libraries are loaded.
I would really appreciate any ideas since the ability to make use of the functions in this library is important to the functionality of my app. Thank you all in advance.
OK, I took your advice and simply added my new functionality to the sqlite3.c file I had in my project. It compiled and linked statically and works fine. Thank you for the idea. I still would like to know what was preventing me from loading an extension, but am pleased with having learned other things in solving the problem - PLUS I met my deadline. Thank you again.
After days of search I finally found a solution !
1) once your sqlite_extension.h and sqlite_extension.c files moved into your sqlite_extension folder
2) cd to that sqlite_extension folder
3) compile your code using :
gcc -g -fPIC -std=gnu99 -current_version 1.0 -compatibility_version 1.0 -dynamiclib -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk sqlite_extension.c -o sqlite_extension.dylib
You might need to change the SDK path for something like ../iPhoneOSN.M.sdk where N.M indicate the last available version of iOS, have a look to the folder "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/" to find an existing path
4) You can check the resulting file using :
file /path/to/your/sqlite_extension.dylib
which should return something like :
/./././sqlite_extension.dylib (for architecture armv7): Mach-O dynamically linked shared library arm
/./././sqlite_extension.dylib (for architecture arm64): Mach-O 64-bit dynamically linked shared library
or using the more detailed :
otool -l sqlite_extension.dylib
5) Now your library needs to be code-signed with the same identity as your embedding app you can do this using :
codesign -fs "your_apple_identity" sqlite_extension.dylib
your_apple_identity can be in the form "your_name: your_apple_login_email#address.xxx"
The best way to make sure is to copy the one from your embedded app executable compiled and running on your device with Xcode or the archive on your computer using :
codesign --display --verbose=4 ~/Library/Developer/Xcode/Archives/2016-09-25/YourApp\ 25-09-2016\ 12.00.xcarchive/Products/Applications/YourApp.app/YourApp
The string to use in place of "your_apple_identity" is the one found after the first occurence of Authority=
6) Once your library code-signed, you can check that you get similar signing information as your App using the same command :
codesign --display --verbose=4 sqlite_extension.dylib
7) Your Library is now ready to be embedded in your app, all you need is to make sure Xcode refreshes your library file if you had try a previous file with the same name. To do so you can remove the former file, compile and run on your device, put back the new file making sure it is in the "Copy Bundle ressources" not the "Link Binary With Librairies" of the Build Phases tab of your app
Your extension should then load without error when your app requests SQLite to use it
iOS 9.3.5
Xcode 8.0
SQLite 3.9.2
I'm not 100% sure this is explicitly disallowed, but another type of dynamic loading -- frameworks -- isn't supported on the iPhone. You may need to compile and link the library statically, rather than dynamically.
i know topic is old . but googling brought me here. and for anyone that has this problem and end up here :
you must first call
sqlite3_enable_load_extension(db, 1);
I know that I am answering late but I faced the same problem and found how to load an extension.
Once you have the source file X.c, compile a shared library(In Linux machine) using
gcc -g -fPIC -shared X.c -o X.so
Where X.c is the extension in use
Then enable loading extension in C interface to SQLite using
sqlite3_enable_load_extension(db,1);
Then load the extension using
sqlite3_load_extension(db,"/path/of/extension/X.so","sqlite3_X_init",0);
Thats it, extension will be loaded now.