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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:25:33+00:00 2026-05-29T10:25:33+00:00

I’m trying to distribute a little software written on C++ on Linux that uses

  • 0

I’m trying to distribute a little software written on C++ on Linux that uses openGL and SFML. I’m trying to provide the sfml libraries and headers with my code in order to avoid the installation of sfml (people who will use it have no root access, but they will have all the openGL needed stuff installed).

My file hierarchy is as follows:

  • lib/ >> here goes all the sfml libraries (.so files)
  • Makefile >> later I show the code
  • src/ >> Here goes program and sfml sources
    • myfiles.h, myfiles.cpp >> all them compile and work allright with the sfml libraries installed at /usr/lib
    • SFML/ >> here goes all the sfml headers, has some subfolders

Here’s my Makefile:

EJECUTABLE = app

MODULOS = src/main.o src/Handbapp.o src/Camera.o src/Light.o src/Scene.o src/Graphics.o src/Window.o src/Model.o src/Court.o src/Player.o src/Primitives.o src/Path.o

CC = g++
LIBDIR = ./lib
INCDIR = ./src

LIBS = -lsfml-window -lsfml-system -lGLU

LDFLAGS = -L$(LIBDIR) -I$(INCDIR)
CFLAGS = -v -Wl,-rpath,$(LIBDIR)

$(EJECUTABLE): clean $(MODULOS)
    $(CC) $(CFLAGS) -o $(EJECUTABLE) $(LDFLAGS) $(MODULOS) $(LIBS)
    rm -f $(MODULOS) 

clean:
    rm -f $(MODULOS) $(EJECUTABLE)

When I run make in a PC (Ubuntu 11.10) with sfml installed in /usr/lib it all goes well, if I do in one that doesn’t have it installed it says:

...
g++    -c -o src/main.o src/main.cpp
In file included from src/main.h:18:0,
                 from src/main.cpp:10:
src/Handbapp.h:17:44: fatal error: SFML/Window.hpp: File or directory doesn't exist
Compilation finished.
make: *** [src/main.o] Error 1

Here’s a piece of code showing the include on Handbapp.h:

...
#ifndef HANDBAPP_H
#define HANDBAPP_H

// Espacio de nombres
using namespace std;

// Librerias
#include <GL/gl.h> // OpenGL
#include <GL/glu.h> // Utilidades OpenGL
#include <SFML/Window.hpp> // Ventanas SFML <- LINE 17
#include <SFML/System.hpp> // SFML

I’ve tried making #include “whatever/Window.hpp”,changing src/SFML folder name for whatever and not using the -I option on the linker, but src/SFML/Window.hpp (and other sfml headers) have include lines like that #include < SFML/Window/Whatever.hpp >, so I need them to search at the path I specify.

Am I missing something? I guess it’s an error with my Makefile, but I don’t have so much experience with it…

Thanks in advance!

  • 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-29T10:25:34+00:00Added an answer on May 29, 2026 at 10:25 am

    You need to put -I$(INCDIR) into CPPFLAGS, not LDFLAGS. Then it will be picked up by the built-in rule for compilation of individual object files.

    You should also rename CFLAGS to CXXFLAGS and CC to CXX. CC and CFLAGS are for C source files, not C++ source files.

    You should not have $(EJECUTABLE) depend on clean, and you should not execute rm -f $(MODULOS) after the link command. Those things defeat the purpose of a Makefile, which is to recompile only what is necessary, not the whole program every single time.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.