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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:50:48+00:00 2026-06-13T13:50:48+00:00

Hi I have a program in c built on a non Windows machine(ubuntu machine

  • 0

Hi I have a program in c built on a non Windows machine(ubuntu machine I think but could be mac os as well).

I did a quick look around and tried cygwin (installed cygwin, used the terminal to goto the directory containing the c program and called make.)

This yields:

$ make
g++ -lz -Wextra -O3 -o bin/lda src/lda_main.o src/data.o src/lda.o c/lda_init.o
   src/lda_io.o src/lda_sampler.o src/opts.o

src/data.o:data.cpp:(.text+0x5d): undefined reference to `_gzopen'
src/data.o:data.cpp:(.text+0x9e): undefined reference to `_gzgets'
src/data.o:data.cpp:(.text+0x138): undefined reference to `_gzgets'
src/data.o:data.cpp:(.text+0x1f0): undefined reference to `_gzgets'
src/data.o:data.cpp:(.text+0x257): undefined reference to `_gzclose'
src/data.o:data.cpp:(.text+0x3cb): undefined reference to `_gzopen'
src/data.o:data.cpp:(.text+0x498): undefined reference to `_gzgets'
src/data.o:data.cpp:(.text+0x4b4): undefined reference to `_gzclose'

/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: src/data.o:
   bad reloc address 0x1c in section `.eh_frame'
collect2: ld returned 1 exit status
Makefile:16: recipe for target `lda' failed
make: *** [lda] Error 1

I do have gcc g++ installed as well as zlib.

I then tried mingw32 using mingw32-make in the right directory.
returns an error faster than eye can see:
ld.exe: cannot find -lz

Any suggestions? Please keep in mind that I am an economist by training and we know how useful that is :-). Simple will go far with me.

  • 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-13T13:50:49+00:00Added an answer on June 13, 2026 at 1:50 pm

    Change the makefile so that -lz comes after the list of object files.

    With the command line:

    g++ -lz -Wextra -O3 -o bin/lda src/lda_main.o src/data.o src/lda.o src/lda_init.o
       src/lda_io.o src/lda_sampler.o src/opts.o
    

    The library will not be searched for external references that the various object files need. If you arrange it so the command looks like:

    g++ -Wextra -O3 -o bin/lda src/lda_main.o src/data.o src/lda.o src/lda_init.o
       src/lda_io.o src/lda_sampler.o src/opts.o -lz
    

    Then libz will be searched for any external references that the object files need.

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

Sidebar

Related Questions

I have program that requires Python 3, but I develop Django and it uses
We have a custom built program that needs authenticated/encrypted communication between a client and
I have built a program in Microsoft Visual Studio 2005 and it works fine.
I have build C# program that work with RAPI (communication to PPC or WinCE)
I am currently trying to build a program where I have a recursive function
I have to build a C# program that makes CSV files and puts long
I have a Solaris sparc machine and when i build my programs, it generates
I have program written in C. It takes 2 arguments username/password and try to
I have program that has a variable that should never change. However, somehow, it
I have program, that must interact with a console program before my program can

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.