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

  • Home
  • SEARCH
  • 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 389127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:50:12+00:00 2026-05-12T15:50:12+00:00

I am trying to build libdecodeqr on a mac. My c++ building and linking

  • 0

I am trying to build libdecodeqr on a mac. My c++ building and linking history is all on windows, so it’s an exciting journey of discovery.

I have finally got to the point where I want to create the linked library. The command I am running is:

g++ -shared -o libdecodeqr.so.0.9.3 bitstream.o codedata.o container.o ecidecoder.o formatinfo.o galois.o imagereader.o libdecodeqr.o -L/opt/local/lib -arch i386 -lcxcore -lcv

The result is:

Undefined symbols:
    "_main", referenced from:
       start in crt1.10.5.o

I was under the impression that a creating a library using -shared flag meant I shouldn’t need a main function. There certainly isn’t one in the source code.

Just for kicks I added int main() {return 0;} to one of the cpp files and rebuilt. The whole thing compiled and linked, but when I tried to use the output as a library I got errors telling me that I can’t link to a main executable. That makes sense I guess.

Is there something else I need to pass to g++ to tell it to build a library?

  • 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-12T15:50:12+00:00Added an answer on May 12, 2026 at 3:50 pm

    -shared is not supported on OSX. Use either -dynamiclib or -bundle (depending on which type of shared library you want to create).

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

Sidebar

Related Questions

I´m trying to build a Game with DirectX 11 on Windows 7. I have
Trying to build Xuggler under Windows. Xuggler is core native code functions wrapped into
I have a std::vector< tr1::shared_ptr<mapObject> > that I'm trying build from data contained in
im trying to build a application or a method that goes through all of
I'm trying build a conditions array to be using in a prepared statement: Cars.find(:all,
I'm trying build a excel based input form, I have found something online and
I have a small problem when trying build an XML document with Nokogiri. I
Trying to build a user interface using PyQt4. Got a dialog window that pops
Trying to build a ajax comment system .I have a list populated from MYSQL
I am trying build a jQuery EasyUI datagrid or treegrid out of a large

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.