Compiler Error

Discussion in 'iOS Development' started by dudemanbra123, Jul 2, 2008.

  1. dudemanbra123

    dudemanbra123 New Member

    Joined:
    Feb 3, 2008
    Messages:
    81
    Likes Received:
    1
    Device:
    iPod touch
    While trying skylars programming tutorial I got an error while compiling. It does it for all applications i've tried (HelloWorld, Empty and skylars). Here's the error.

    Code:
    arm-apple-darwin-gcc -lobjc -framework CoreFoundation -framework Foundation -framework UIKit -o NewApp main.o NewApp.o
    /usr/local/bin/arm-apple-darwin-ld: can't locate file for: -lcrt1.o
    collect2: Id returned 1 exit status
    make: *** [NewApp] Error 1
    
  2. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    please search before you post. this problem has been solved.


    every time you open cygwin you must enter these two things:

    Code:
    LD_LIBRARY_PATH=/usr/local/arm-apple-darwin/lib
    Code:
    export LD_LIBRARY_PATH
  3. dudemanbra123

    dudemanbra123 New Member

    Joined:
    Feb 3, 2008
    Messages:
    81
    Likes Received:
    1
    Device:
    iPod touch
    Is there anyway to make it so I don't have to enter that everytime I open it?
    Also I tried it and it worked. But i just put the toolchain on my laptop and when I go to make a file I get this error.

    Code:
    /usr/local/bin/arm-apple-darwin-ld: -syslibroot: multiply specified
    collect2: Id returned 1 exit status
    make: *** [UITable] Error 1
    
    I Tried the code you gave me on my laptop and it did nothing.

    Here's the make file, it's from the Slide to Delete UITable from IphoneDocDevs, just edited slightly to work for me but I'm lost now.

    Code:
    
    CC = arm-apple-darwin-gcc
    LD = $(CC)
    LDFLAGS = -Wl,-syslibroot,/usr/local/arm-apple-darwin/heavenly -ObjC \
    	-framework CoreFoundation -framework Foundation \
    	-framework UIKit -framework LayerKit -framework Coregraphics \
    	-framework WebCore -framework WebKit -framework GraphicsServices -lobjc
    CFLAGS = -Wall -std=gnu99
    
    TARGET = UITable
    
    all:	$(TARGET)
    
    $(TARGET): main.o UITableApplication.o  
    	$(LD) $(LDFLAGS) -o $@ $^
    
    %.o:	%.m
    	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
    
    clean:	
    	rm -fr *.o $(TARGET)
    
    package: $(TARGET)
    	rm -fr $(TARGET).app
    	mkdir -p $(TARGET).app
    	cp $(TARGET) $(TARGET).app
    	cp Info.plist $(TARGET).app
    	cp icon.png $(TARGET).app
    		
    install: $(TARGET)
    	scp -r $(TARGET).app root@${192.168.1.101}:/Applications
    
  4. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    you tried a makefile probably used for a mactintosh. try this makefile:

    Code:
    CC = arm-apple-darwin-gcc
    LD = $(CC)
    LDFLAGS =  -framework CoreFoundation -framework Foundation \
    	-framework UIKit -framework LayerKit -framework Coregraphics \
    	-framework WebCore -framework WebKit -framework GraphicsServices -lobjc
    CFLAGS = -Wall -std=gnu99
    
    TARGET = UITable
    
    all:	$(TARGET)
    
    $(TARGET): main.o UITableApplication.o  
    	$(LD) $(LDFLAGS) -o $@ $^
    
    %.o:	%.m
    	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
    
    clean:	
    	rm -fr *.o $(TARGET)
    
    package: $(TARGET)
    	rm -fr $(TARGET).app
    	mkdir -p $(TARGET).app
    	cp $(TARGET) $(TARGET).app
    	cp Info.plist $(TARGET).app
    	cp icon.png $(TARGET).app
    		
    install: $(TARGET)
    	scp -r $(TARGET).app root@${192.168.1.101}:/Applications
  5. dudemanbra123

    dudemanbra123 New Member

    Joined:
    Feb 3, 2008
    Messages:
    81
    Likes Received:
    1
    Device:
    iPod touch
    Thanks it worked for my desktop, I think my laptop had a messed up toolchain install. It installed my user in C:\Users\Owner\ instead of C:\cygwin\home\Owner\.
    Also is there anyway I can just make a thing that automatically runs the script on my user login, or a fix so I don't have to enter it everytime I open it.
  6. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    you can edit c:/cygwin/home/users/username/.bash_login

    edit it with notepad or wordpad or something. have it automatically enter those commands on login
  7. dudemanbra123

    dudemanbra123 New Member

    Joined:
    Feb 3, 2008
    Messages:
    81
    Likes Received:
    1
    Device:
    iPod touch
    I get this error on my laptop. The makefile is fine, I took it straight from my desktop which it worked on onto my laptop and I got this error. How can I fix?

    Code:
    rm -fr *.o SavePrefs
    arm-apple-darwin-gcc -c -Wall -std=gnu99  main.m -o main.o
    arm-apple-darwin-gcc -c -Wall -std=gnu99  UISavePrefsApplication.m -o UISavePref
    sApplication.o
    arm-apple-darwin-gcc -c -Wall -std=gnu99  PrefsView.m -o PrefsView.o
    arm-apple-darwin-gcc -framework CoreFoundation -framework Foundation -framework
    UIKit -framework LayerKit -framework Coregraphics -framework WebCore -framework
    WebKit  -lobjc -o SavePrefs main.o UISavePrefsApplication.o PrefsView.o
    /usr/local/bin/arm-apple-darwin-ld: warning /usr/local/arm-apple-darwin/filesyst
    em/usr/lib/libxml2.2.dylib cpusubtype (0, architecture cputype 12 cpusubtype 0)
    does not combine with cpusubtype (6) for specified -arch flag: arm and -force_cp
    usubtype_ALL not specified (file not loaded)
    /usr/local/bin/arm-apple-darwin-ld: warning /usr/local/arm-apple-darwin/filesyst
    em/usr/lib/libsqlite3.0.dylib cpusubtype (0, architecture cputype 12 cpusubtype
    0) does not combine with cpusubtype (6) for specified -arch flag: arm and -force
    _cpusubtype_ALL not specified (file not loaded)
    /usr/local/bin/arm-apple-darwin-ld: warning /usr/local/arm-apple-darwin/filesyst
    em/usr/lib/libsqlite3.0.dylib cpusubtype (0, architecture cputype 12 cpusubtype
    0) does not combine with cpusubtype (6) for specified -arch flag: arm and -force
    _cpusubtype_ALL not specified (file not loaded)
    /usr/local/bin/arm-apple-darwin-ld: Undefined symbols:
    _sqlite3_close referenced from WebCore expected to be defined in /usr/lib/libsql
    ite3.0.dylib
    _sqlite3_last_insert_rowid referenced from WebCore expected to be defined in /us
    r/lib/libsqlite3.0.dylib
    _sqlite3_open16 referenced from WebCore expected to be defined in /usr/lib/libsq
    lite3.0.dylib
    _sqlite3_bind_blob referenced from WebCore expected to be defined in /usr/lib/li
    bsqlite3.0.dylib
    _sqlite3_bind_int64 referenced from WebCore expected to be defined in /usr/lib/l
    ibsqlite3.0.dylib
    _sqlite3_column_blob referenced from WebCore expected to be defined in /usr/lib/
    libsqlite3.0.dylib
    _sqlite3_column_bytes referenced from WebCore expected to be defined in /usr/lib
    /libsqlite3.0.dylib
    _sqlite3_column_int referenced from WebCore expected to be defined in /usr/lib/l
    ibsqlite3.0.dylib
    _sqlite3_column_int64 referenced from WebCore expected to be defined in /usr/lib
    /libsqlite3.0.dylib
    _sqlite3_column_text16 referenced from WebCore expected to be defined in /usr/li
    b/libsqlite3.0.dylib
    _sqlite3_data_count referenced from WebCore expected to be defined in /usr/lib/l
    ibsqlite3.0.dylib
    _sqlite3_errcode referenced from WebCore expected to be defined in /usr/lib/libs
    qlite3.0.dylib
    _sqlite3_finalize referenced from WebCore expected to be defined in /usr/lib/lib
    sqlite3.0.dylib
    _sqlite3_prepare16 referenced from WebCore expected to be defined in /usr/lib/li
    bsqlite3.0.dylib
    _sqlite3_step referenced from WebCore expected to be defined in /usr/lib/libsqli
    te3.0.dylib
    _xmlCreatePushParserCtxt referenced from WebCore expected to be defined in /usr/
    lib/libxml2.2.dylib
    _xmlFree referenced from WebCore expected to be defined in /usr/lib/libxml2.2.dy
    lib
    _xmlFreeDoc referenced from WebCore expected to be defined in /usr/lib/libxml2.2
    .dylib
    _xmlFreeParserCtxt referenced from WebCore expected to be defined in /usr/lib/li
    bxml2.2.dylib
    _xmlGetDocEntity referenced from WebCore expected to be defined in /usr/lib/libx
    ml2.2.dylib
    _xmlGetPredefinedEntity referenced from WebCore expected to be defined in /usr/l
    ib/libxml2.2.dylib
    _xmlInitParser referenced from WebCore expected to be defined in /usr/lib/libxml
    2.2.dylib
    _xmlMalloc referenced from WebCore expected to be defined in /usr/lib/libxml2.2.
    dylib
    _xmlParseBalancedChunkMemory referenced from WebCore expected to be defined in /
    usr/lib/libxml2.2.dylib
    _xmlParseChunk referenced from WebCore expected to be defined in /usr/lib/libxml
    2.2.dylib
    _xmlRegisterInputCallbacks referenced from WebCore expected to be defined in /us
    r/lib/libxml2.2.dylib
    _xmlRegisterOutputCallbacks referenced from WebCore expected to be defined in /u
    sr/lib/libxml2.2.dylib
    _xmlSAX2EntityDecl referenced from WebCore expected to be defined in /usr/lib/li
    bxml2.2.dylib
    _xmlSAX2InternalSubset referenced from WebCore expected to be defined in /usr/li
    b/libxml2.2.dylib
    _xmlSAX2StartDocument referenced from WebCore expected to be defined in /usr/lib
    /libxml2.2.dylib
    _xmlStopParser referenced from WebCore expected to be defined in /usr/lib/libxml
    2.2.dylib
    _xmlStrdup referenced from WebCore expected to be defined in /usr/lib/libxml2.2.
    dylib
    _xmlStrndup referenced from WebCore expected to be defined in /usr/lib/libxml2.2
    .dylib
    _xmlSwitchEncoding referenced from WebCore expected to be defined in /usr/lib/li
    bxml2.2.dylib
    collect2: ld returned 1 exit status
    make: *** [SavePrefs] Error 1
    
  8. hitman2992

    hitman2992 New Member

    Joined:
    Dec 10, 2007
    Messages:
    123
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    reinstall your toolchain on your laptop if it works on your desktop and it doesnt work on the laptop then something is messed up with the toolchain.
  9. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    also make sure your ipod's Filesystem don't have any broken symlinks and such in it
  10. dudemanbra123

    dudemanbra123 New Member

    Joined:
    Feb 3, 2008
    Messages:
    81
    Likes Received:
    1
    Device:
    iPod touch
    Is there a way to take the filesystem from my desktop toolchain and use that, because I'm sure that one works and has no broken symlinks. I also know that in my user folder the filesystem is ziped up right there.

Share This Page