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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:18:05+00:00 2026-05-31T01:18:05+00:00

I need to use the STXXL library for a software project I am working

  • 0

I need to use the STXXL library for a software project I am working on, but for some reason, I am having trouble compiling a test file. I am not very familiar with makefiles, so I might have mixed up in linking some of the libraries together.

The dummy files I am using are Draw.h, Draw.cpp, and driver.cpp. As you can imagine, Draw.h declares a method draw() that is implemented in Draw.cpp, and driver.cpp contains the main function, and includes Draw.h and calls draw().

The makefile I am using is:

STXXL_ROOT      ?= /Users/name/stxxl-1.3.1
STXXL_CONFIG    ?= stxxl.mk
include $(STXXL_ROOT)/$(STXXL_CONFIG)

# use the variables from stxxl.mk
CXX              = $(STXXL_CXX)
CPPFLAGS        += $(STXXL_CPPFLAGS)
LDLIBS          += $(STXXL_LDLIBS)

# add your own optimization, warning, debug, ... flags
# (these are *not* set in stxxl.mk)
CPPFLAGS        += -O3 -Wall -g -DFOO=BAR

# build your application
# (my_example.o is generated from my_example.cpp automatically)
my_example.bin: driver.o Draw.o
    $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) driver.o -o $@ $(LDLIBS)

driver.o: driver.cpp Draw.h
    $(CXX) $(CXXFLAGS) -c driver.cpp

Draw.o: Draw.cpp Draw.h
    $(CXX) $(CXXFLAGS) -c Draw.cpp

The error I am getting is

g++  -I/Users/name/stxxl-1.3.1/include -include stxxl/bits/defines.h -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE  -O3 -Wall -g -DFOO=BAR  driver.o -o my_example.bin -L/Users/name/stxxl-1.3.1/lib -lstxxl
Undefined symbols for architecture x86_64:
  "draw(int)", referenced from:
      _main in driver.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [my_example.bin] Error 1

Any ideas?

  • 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-31T01:18:06+00:00Added an answer on May 31, 2026 at 1:18 am

    In this rule:

    my_example.bin: driver.o Draw.o
        $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) driver.o -o $@ $(LDLIBS)
    

    you require that Draw.o exist, but you’re not linking it in. Try this:

    my_example.bin: driver.o Draw.o
        $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) driver.o Draw.o -o $@ $(LDLIBS)
    

    or more concisely:

    my_example.bin: driver.o Draw.o
        $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $^ -o $@ $(LDLIBS)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a project that have the following need: use source ip address
I need to use an alias in the WHERE clause, but It keeps telling
I need to use a many to many relationship in my project and since
I need to use a datetime.strptime on the text which looks like follows. Some
I need to use the ReSharper Unit Test Runner to run my MSTest Unit
What is the need/use of 'symbols' in the Microsoft debugger ? I spent some
foo declaration in h. file I do [foo release] operation Next i need use
I use legacy library and need use cast Object to Collection. For avoid exceptions
I want to use apachebench (ab) to test file upload performance. I have read
We are using JBoss 4.2 GA, and need use a newest version in some

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.