HLA (Higher Level Assembly) Installation and Linker - hla

I am trying to install the executalbles to compile programs in HLA on a Mac OS 10.8. Although the tools seem to be in the right place and working I am getting the following error when trying to compile the first program
ld: warning: -macosx_version_min not specified, assuming 10.8
Undefined symbols for architecture i386:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture i386
Error returned by ld = 256
The hla executalbe seems to output the object file but something in the linker seems to not be working. I have previously managed to install it on other machines but in most cases I get this error.
Any ideas?

You can tell HLA to use "_main" as the entry point by using "-main:_main". You may also need to link with libSystem.dylib and get rid of some linker warnings, so that the whole command would be
hla -main:_main -l"macosx_version_min 10.9" -l"lSystem" -l"no_pie" source.hla

Related

Xcode 6.4 Framework

I cannot seem to find the solution to this problem. I created a new custom framework in Objective-C and when I included it in a sample project, I am getting the following messages/errors on compilation:
ld: warning: ignoring file /Users/location/CustomFrameworkAPI.framework/CustomFrameworkAPI, missing required architecture x86_64 in file /Users/location/CustomFrameworkAPI.framework/CustomFrameworkAPI (2 slices)
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_CustomFrameworkAPI", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
When I checked the architecture of the framework, I'm seeing that x86_64 is part of the custom framework that I have built. Can someone tell me what the problem is?
MacBook-Pro:CustomFrameworkAPI.framework user$ file CustomFrameworkAPI
CustomFrameworkAPI: Mach-O universal binary with 2 architectures
CustomFrameworkAPI (for architecture armv7): Mach-O dynamically linked shared library arm
CustomFrameworkAPI (for architecture arm64): Mach-O 64-bit dynamically linked shared library
I believe the error that you posted says that the framework you are using CustomFrameworkAPI referred in ViewController is not built in such a way that it supports 64-bit environment.
Kindly check your framework's architecture on which it is built upon.
Use lipo command to check the architecture of the framework.
This might not be the exact solution or answer to your problem.
Thanks.

"_OBJC_CLASS_$_",referenced from:

Hello i am getting the following errors and warnings if i build the program on simulator,but if i run it on the real device these things disappears?why do i get this?any idea?
ld: warning: ignoring file /Users/interaxisnetworks/Desktop/Test/TestProg/audiocall/PortSIPLib.framework/PortSIPLib, missing required architecture x86_64 in file /Users/interaxisnetworks/Desktop/Test/TestProg/audiocall/PortSIPLib.framework/PortSIPLib (3 slices)
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_PortSIPSDK", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Once i run the app on phone,i am not getting these warnings at all.But sometimes when i open the program and do build on simulator i get these errors and warnings.
i have gone through answers for similar problems,added app delegate.m in build settings,still these errors are coming.
The PortSIPLib.framework you tried to link your app with seems to be iOS only. You should ask the provider of the framework for a binary that is suitable for the simulator. If he can't or won't provide one, then there is nothing much you can do, I'm afraid.

Undefined symbols for architecture x86_64 when trying to unit test the application

I'm getting an error in XCode when trying to run unit tests. Any ideas?
I have tried changing the Framework search paths in Build Settings to $(SDKROOT)/Developer/Library/Frameworks
$(DEVELOPER_LIBRARY_DIR)/Frameworks
But that did not change anything.
ld: warning: directory not found for option '-F/Applications/Xcode'
ld: warning: directory not found for option '-
F4.3.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/Developer/Library/Frameworks'
ld: warning: directory not found for option '-F/Applications/Xcode'
ld: warning: directory not found for option '-F4.3.2.app/Contents/Developer/Library/Frameworks'
ld: warning: ignoring file /Applications/Xcode 4.3.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/Library/Frameworks//SenTestingKit.framework/SenTestingKit, file was built for unsupported file format which is not the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
"_STComposeString", referenced from:
-[AddressBookFrameworkSyncHelperTest testAddingAPersonToGroupsFromAVcard] in AddressBookFrameworkSyncHelperTest.o
-[SyncTesting testExample] in SyncTesting.o
"_OBJC_CLASS_$_SenTestCase", referenced from:
_OBJC_CLASS_$_AddressBookFrameworkSyncHelperTest in AddressBookFrameworkSyncHelperTest.o
_OBJC_CLASS_$_SyncTesting in SyncTesting.o
"_OBJC_CLASS_$_AddressBookFrameworkSyncHelper", referenced from:
objc-class-ref in AddressBookFrameworkSyncHelperTest.o
(maybe you meant: _OBJC_CLASS_$_AddressBookFrameworkSyncHelperTest)
"_OBJC_METACLASS_$_SenTestCase", referenced from:
_OBJC_METACLASS_$_AddressBookFrameworkSyncHelperTest in AddressBookFrameworkSyncHelperTest.o
_OBJC_METACLASS_$_SyncTesting in SyncTesting.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
These error messages show the problem:
ld: warning: directory not found for option '-F/Applications/Xcode'
ld: warning: directory not found for option '-F4.3.2.app/Contents/Developer/Library/Frameworks'
Clearly you've got "/Applications/Xcode" and "4.3.2.app/Contents/Developer/Library/Frameworks" on your frameworks paths separately, instead of "/Applications/Xcode 4.3.2.app/Contents/Developer/Library/Frameworks".
If this is something you did, you're probably missing quotes somewhere. Maybe just doing the exact same thing you tried, but with quotes around it, will work?
If it's something that Xcode is doing automatically, Apple's missing quotes somewhere, and the workaround is probably to rename your "Xcode 4.3.2.app" to something without spaces in it.
But there may be a second problem here as well:
ld: warning: ignoring file /Applications/Xcode 4.3.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/Library/Frameworks//SenTestingKit.framework/SenTestingKit, file was built for unsupported file format which is not the architecture being linked (x86_64)
In this case, the quotes are right, and it's finding the framework… but apparently you've only got the 32-bit (i386) build installed, not the 64-bit (x86_64) one that you need.
I'm also a bit curious where this came from in the first place, as when I look at the 10.6 SDK in my Xcode 4.3.2, there's no framework called SenTestingKit.framework. Which implies that you may have hacked up your Xcode install in various ways, and the right solution might be to uninstall, reinstall, and do things properly. But it's possible this is some additional install from within Xcode (or from developer.apple.com) that you've installed and I haven't.

TouchJSON Fails on Compile (link error)

Undefined symbols for architecture x86_64:
"_objc_unretainedPointer", referenced from:
-[CJSONScanner scanJSONStringConstant:error:] in CJSONScanner.o
-[CJSONSerializer serializeNumber:error:] in CJSONSerializer.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Hey all. Trying to use TouchJSON to do some JSON-y stuff. I followed the read me for the library to the meter I think, but every time I try to compile I get this error. I don't know much about Xcode (I've only been learning Obj-C recently) so I'm clueless about this. Any ideas?
Try to remove "Experimental" folder (and files inside, of course).
README
Be aware that the code in the Experimental subdirectory of Source is
just that and may not have been extensively tested and/or have extra
dependencies
So it could be a problem about extra dependencies (but always make sure if your project already have linked all dependency libraries/framework)

_CC_RADIANS_TO_DEGREES error with architecture i386

I am working to rotate a sprite that is attached to a CPbody.
I am using this code
[shape->data setRotation:(float) CC_RADIANS_TO_DEGREES( -body->a )];
When I run this code I get this error
Undefined symbols for architecture i386:
"_CC_RADIANS_TO_DEGREES", referenced from:
_updateShape in GamePlay.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
Any ideas on why this is happening, Iv worked for a while trying to get around this and can't
thanks for any help
You are not linking in Cocos2d for the i386 architecture. You could check which frameworks you are linking within your project.
Have you used the cocos2d template to create the project in the first place?
Can your app run on the device instead of the simulator?