Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6245731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:33:32+00:00 2026-05-24T12:33:32+00:00

I installed proj.4 library with homebrew on my Mac 10.7 (using gcc-4.2). When trying

  • 0

I installed proj.4 library with homebrew on my Mac 10.7 (using gcc-4.2). When trying to compile the following code:

#include <proj_api.h>


int main(void) {
    projPJ pj_merc;
    pj_merc = pj_init_plus("+proj=merc");
    pj_free(pj_merc);
    return 0;
}

I’m getting this error:

$ gcc-4.2 test.c 
Undefined symbols for architecture x86_64:
  "_pj_init_plus", referenced from:
      _main in cccf4vey.o
  "_pj_free", referenced from:
      _main in cccf4vey.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

EDIT:
The library file is 64bit (gcc-4.2 -m32 test.c lead to the same error):

$ file /usr/local/lib/libproj.dylib 
/usr/local/lib/libproj.dylib: Mach-O 64-bit dynamically linked shared library x86_64

Any ideas what’s wrong?

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:33:33+00:00Added an answer on May 24, 2026 at 12:33 pm

    You should link against the library.

    gcc-4.2 test.c -L/usr/local/lib -lproj
    

    This is what the error is complaining about

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I installed the wxWidgets source code, compiled it and am linking the libraries thus
I am using rvm, doing the following: rvm install ree <--- (Ruby Enterprise Edition),
I installed VS10 side-by-side with VS9 and created a very simple application using it:
I installed the wrong version of pysvn in my system using the .dmg. I
I installed the plugin for python and it detects the python code, but how
Please guide whats wrong with the following code that its not creating proper list
installed ejabberd using synaptic package manager on Ubuntu 10.04 without any error. sudo dpkg-reconfigure
I installed Netbeans and tryed to access the server's manager using: (id/pass)manager/manager, admin/admin, system/password...
I have the following dir structure: parent-proj - child proj1 - pom.xml -child proj2
I installed virtualmin and phpmyadmin separately using the apt-get command. phpMyAdmin didn't work because

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.