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 7751919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:40:18+00:00 2026-06-01T11:40:18+00:00

I believe something very odd is happening with my compiler options. When I compile

  • 0

I believe something very odd is happening with my compiler options. When I compile class.c it compiles without error. However, when I try to create the .dll I get many errors:

undefined reference to '_method' 

_method is any number of methods in class.c

I compile my code with the following:

gcc -c -g -w -I/path to include dir/include -MMD -MP -MF .../class.o.d -o class.o class.c

My link syntax is as follows:

gcc -Wl,--add-stdcall-alias -m32 -shared -o dist/libdt.dll class.o

To give an example, one of the undefined references is undefined refence to '_min_size' In class.c, however, it looks like:

if(min_size){ dsize=min_size; }

There is no underscore before the min_size in class.c. I’m sure this has something to do with my compile/link syntax but I just don’t see it. Any help is appreciated! Thanks!

PS: I’m using Netbeans and Cygwin.

  • 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-06-01T11:40:19+00:00Added an answer on June 1, 2026 at 11:40 am

    The _ is just a prefix that the stdcall calling convention on windows requires, that the compiler adds.

    If you have extern size_t min_size; , you’ve only declared the min_size. i.e. you’ve told the compiler that somewhere there will be a size_t min_size; defined. You have to actually define that variable somewhere (e.g. in your class.c, put size_t min_size; there.)

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

Sidebar

Related Questions

I am not very skilled in php, but I believe something in this section
I need a help with what I believe is very trivial stuff. class User
I believe I have a very interesting problem to solve. I've a XML something
Perhaps I'm missing something simple, as I believe that this is a common scenario...
I'm having a very odd issue where I am trying to use a text
While doing a lot of benchmarking stuff these days, I stumbled upon something very
I'm new to jQueryUI and I think I am overlooking something very basic... Quick
I believe V8 underlying Node.js supports strict mode or ES5 by default. Can we
I believe the application has some parts that target .NET, and some that don't.
I believe any programmer who has been dealing with database requests in a gui

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.