Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > How to Manually Link A C++ Program?

How to Manually Link A C++ Program?
Thread Tools
Thinine
Mac Elite
Join Date: Jul 2002
Status: Offline
Reply With Quote
Jul 29, 2004, 04:33 PM
 
Due to a know problem with the developer tools on the lab G5s I'm working on (documented here. Search for .o) I cannot use g++ to compile the program without resulting in linking errors. Also, I don't have admin access, so I can't move the needed files to the correct directories. Therefore, I need to manually link my program with it's needed files. So far, I've gotten this:
Code:
ld crt1.o dylib1.o gcrt1.o bundle1.o /usr/lib/libstdc++.a program.o
Which results in various errors referencing dyld and other things. So what do I need to link against for a C++ program? Here are the #includes for my program, just in case:
Code:
#include <iostream> #include <time.h> #include <stdlib.h> #include <vector> #include <algorithm>
     
Thinine  (op)
Mac Elite
Join Date: Jul 2002
Status: Offline
Reply With Quote
Jul 29, 2004, 05:11 PM
 
Never mind, I was able to use the verbose output from gcc to modify the linking statement. Worked well.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 06:47 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,