What means: libtool: -dynamic not specified the following flags are invalid: -ObjC - iphone

I inherited a project (lucky me!) which relies on a static library. Trying to build the static lib, I get this error:
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: -dynamic not specified the following flags are invalid: -ObjC
It is followed by these two lines, which I do understand, but this appears to be a separate problem (missing file.)
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: can't locate file for: -lFlurryWithLocation
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: file: -lFlurryWithLocation is not an object file (not allowed in a library)
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool failed with exit code 1
Am I wrong, and it's all related? Will the 1st line error go away if I fix the missing file part?
Either way, what does the -dynamic not specified part of message mean?
Thanks!

Olie, your original hunch was correct. There is no relationship between the two messages. The first message '-dynamic not specified the following flags are invalid: -ObjC' is just a warning. The -objC option is not needed for building a static library.

Related

How to generate a map file wth platformio

How do I generate a Map file from platformio ?
Framework is mbed for stm32
I've tried passing linker flags in various ways but I get various errors
1. build_flags= -Wl, -Map=mapfile.map
2. build_flags= -Wl, Map=mapfile.map
For 1. I get the error message arm-none-eabi-gcc: error: unrecognized command line option '-Map=mapfile.map'
For 2. I get the linker error message ld.exe: error: 'Map=mapfile.map' not found
Your syntax of passing the build flags is not correct. Here is how to do it:
build_flags = -Wl,-Map,output.map
Reference: https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html

Recompile with -fPIC

I write this command:
gcc drr.c -o drr -pthread -lcdsl -L./../synch_implementations -I./../synch_implementations
And I can't understand why I get this response:
usr/bin/ld: ./../synch_implementations/libcdsl.a(cdsl_queue_list.o): relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
usr/bin/ld: ./../synch_implementations/libcdsl.a(cdsl_deque_list.o): relocation R_X86_64_32S against symbol `cdsl_deque_list_lock_based_pthread_push_tail' can not be used when making a PIE object; recompile with -fPIC
usr/bin/ld: ./../synch_implementations/libcdsl.a(cdsl_lock.o): relocation R_X86_64_32S against symbol `cdsl_pthread_lock_request' can not be used when making a PIE object; recompile with -fPIC
usr/bin/ld: final link failed: Nonrepresentable section on output
ollect2: error: ld returned 1 exit status
Can anyone help me understand what is wrong?
Notes:
1)I use ubuntu (via VirtualBox).
2)I am very inexperienced, so probably this is not a very bright question.
Solution:
When you compile ./../synch_implementations/libcdsl.a you need to add an extra "-fPIC" flag to produce position-independent-code (see comments above).
Note:
The PIC flag is in general needed when producing library object code since it creates objects relative to a global offset table (GOT) which subsequently allows to link library objects with your code.

Xcode - Swift Compiler Error For Bridging header

I'm attempting to use a Bridging header but when I try to run my application I get a swift compiler error, when I remove the bridging header and the header file the app runs.
This is the error message I get:
<unknown>:0: error: generate-pch command failed with exit code 1 (use -v to see invocation)
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
My app has spaces in it's name and I'm denoting that by adding hyphens instead of spaces. I attempted to remove the space by using a backslash and a space like "${SRCROOT}/Project\ Name/headerFile.h" but I got this error message:
<unknown>:0: error: error opening input file '/Users/apple/Documents/Folder/Project Name/Project\ Name/HeaderFile.h' (No such file or directory)
Any advice or pointers would be greatly appreciated.
I just fixed this by using just spaces instead of hyphens or backslash and spaces. Simple enough.

Unexpected EOF when linking Arduino project in Eclipse on OS X

I have been trying to link Arduino and Eclipse, and I feel like I'm close.
Where should I start looking for this?
Similar errors have been caused by extra/incomplete quote blocks (according to google searches). I have already dug through my AVR linker settings looking for quotes, but haven't had much luck.
Am I looking in the right place?
Which files should I check?
I have already looked in the file I have written myself (in this case, the basic Arduino blink program).
**** Build of configuration Release for project C64_Arduino1 ****
make all
Building target: C64_Arduino1.elf
Invoking: AVR C++ Linker
avr-gcc --cref -s -Os -o"C64_Arduino1.elf" ./C64_Arduino1.o ./CDC.o ./HID.o
./HardwareSerial.o ./Print.o ./Stream.o ./Tone.o ./USBCore.o ./WInterrupts.o ./WMath.o ./WString.o ./malloc.o ./wiring.o ./wiring_analog.o ./wiring_digital.o ./wiring_pulse.o
./wiring_shift.o -l"Arduino_Mega_2560_or_Mega_ADK" -lm -L/Users/Chet/Desktop/Chet's Shit/Side Projects/Programming/C64_Arduino1/Release -L"/Users/Chet/Desktop/Chet's Shit/Side
Projects/Programming/C64_Arduino1" -mmcu=atmega2560
/bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [C64_Arduino1.elf] Error 2
**** Build Finished ****
EDIT:
I have commented out all of my code (including #include's) except the main (which is empty) and I still get the error. I have set up my IDE as specified Here and also Here. Still nothing.
Looking at the actual error message:
/bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
/bin/sh: -c: line 1: syntax error: unexpected end of file
I can see that the problem is most likely due to some kind of Makefile syntax error.
When you write a make rule such like:
foo:
touch foo
What make does, it first checkes whether file called foo exists already, if not, then it runs command /bin/sh -c 'touch foo'. So the line where we said touch foo should have valid shell script syntax.
Looking at the command that you ended up running:
avr-gcc --cref -s -Os -o"C64_Arduino1.elf" ./C64_Arduino1.o ./CDC.o ./HID.o
./HardwareSerial.o ./Print.o ./Stream.o ./Tone.o ./USBCore.o ./WInterrupts.o ./WMath.o ./WString.o ./malloc.o ./wiring.o ./wiring_analog.o ./wiring_digital.o ./wiring_pulse.o
./wiring_shift.o -l"Arduino_Mega_2560_or_Mega_ADK" -lm -L/Users/Chet/Desktop/Chet's Shit/Side Projects/Programming/C64_Arduino1/Release -L"/Users/Chet/Desktop/Chet's Shit/Side
Projects/Programming/C64_Arduino1" -mmcu=atmega2560
I can see that the issue is with the ' character in some of the directory paths. You should either escape it (as in "/Users/Chet/Desktop/Chet\'s Shit") or, as a quick work-around symlink or move the directory.
As a general methodology tip, you should first check whether everything works in CLI, and then move on to teaching Eclipse what commands it should run.
Also, I would consider using the tool called ino instead of make, it might just work with minimum configuration. I have had some experience replacing Arduino IDE with just a Makefile, but it gets hairy when you need to use different boards and perhaps several connected at the same time. Give ino a try, it looks quite promising.

Perl Cross Compilation: MAKE

I've been trying to Cross Compile Perl-5.14.2 for NetBSD target from Linux machine.
Configure script successfully invoked with following options,
./Configure -des -Dusecrosscompile
-Dtargetarch=netbsd
-Dosvers=3.0.0
-Dtargethost=10.184.22.48
-Dtargetuser=username
-Dusrinc=.../sb1-mips/usr/include
-Dlibpth=.../xc-sb1-mips/netbsd/Lib/lib
-Dcc=.../mips64-netbsdelf-gcc
Once after Configured, make wasn't successful.
It breaks at different places right from creating miniperlmain.o file.
For example following error occurred while generating gv.o file:
gv.c: In function `Perl_try_amagic_un':
gv.c:2018: error: void value not ignored as it ought to be
gv.c:2029: error: void value not ignored as it ought to be
gv.c:2029: warning: cast from pointer to integer of different size
gv.c: In function `Perl_try_amagic_bin':
gv.c:2061: error: void value not ignored as it ought to be
gv.c:2063: error: void value not ignored as it ought to be
make: *** [gv.o] Error 1
Now to get rid of these errors I've passed two flags namely -DPERL_IMPLICIT_CONTEXT and -DPERL_GCC_BRACE_GROUPS_FORBIDDEN to C Compiler CCFLAGS which solved the problem.
Since it is a custom build, want to know about all of the CCFLAGS that have to be passed in order to achieve a successful build?
What does each flag mean?
Is their any documentation available?
Use vagrant. It has some OpenBSD and FreeBSD images. Hopefuly those will be compatible with NetBSD.
You can get a build environment very fast with that. Then you can transfer and build your code happily :)