Note that there are some explanatory texts on larger screens.

plurals
  1. POCompiling and Linking a C-Program for a 32-bit Architecture
    primarykey
    data
    text
    <p>So I'm working through an assignment for Stanford's CS107 course and I can't get past compiling the unfinished program (project files and the <strong>original makefile</strong> can be <a href="http://see.stanford.edu/see/materials/icsppcs107/assignments.aspx" rel="nofollow">found on the course page</a>, I'm working on assignment 4 RSS.) </p> <p>After much research, I <em>think</em> the problem is I'm using gcc on a 64-bit architecture (Mac OS 10.6) and the pre-compiled library code under <code>assn-4-rss-news-search-lib/linux</code> is for a 32-bit architecture. I tried setting gcc to use i386 and -m36, but nothings working and I'm kind of just guessing.</p> <p>So here's the output I get when I run <code>make</code>:</p> <pre><code>gcc -g -Wall -std=gnu99 -Wno-unused-function -c -o rss-news-search.o rss-news-search.c gcc rss-news-search.o -g -Wall -std=gnu99 -Wno-unused-function -g -lnsl -lrssnews -L/Users/derp/Documents/OCW/CS107/Work/programming4/assn-4-rss-news-search-lib/linux -o rss-news-search ld: library not found for -lnsl collect2: ld returned 1 exit status make: *** [rss-news-search] Error 1 </code></pre> <p>Here's the output I get when I remove <code>-lnsl</code> where architecture differences are mentioned:</p> <pre><code>gcc -g -Wall -std=gnu99 -Wno-unused-function -c -o rss-news-search.o rss-news-search.c gcc rss-news-search.o -g -Wall -std=gnu99 -Wno-unused-function -g -lrssnews -L/Users/derp/Documents/OCW/CS107/Work/programming4/assn-4-rss-news-search-lib/linux -o rss-news-search ld: warning: in /Users/derp/Documents/OCW/CS107/Work/programming4/assn-4-rss-news-search-lib/linux/librssnews.a, file was built for unsupported file format which is not the architecture being linked (x86_64) Undefined symbols: "_URLConnectionDispose", referenced from: _ProcessFeed in rss-news-search.o _ParseArticle in rss-news-search.o ... several more undefined symbols mentioned ... ld: symbol(s) not found collect2: ld returned 1 exit status make: *** [rss-news-search] Error 1 </code></pre> <p>So I'm asking for any ideas on what I could do to resolve this. I've been at it for hours tweaking settings and Google'ing around to no avail.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload