Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Combining Static Libraries  (Read 2187 times)

0 Members and 1 Guest are viewing this topic.

Red-XIII

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Advanced Protocol
    • Email
Combining Static Libraries
« on: April 07, 2015, 02:50:32 am »
It is as they title says, I wish to combine multiple static libraries into one so that people using my game engine only require to link to one. I'm using Visual Studio 2013 Express, I get very confused easily with C/C++ project properties as I suspect most do so having small details is needed. I did find that you can use the Developer Console for Visual Studio, but that didn't seem to work, i'm not sure if I just did it incorrectly or not, but any help is appreciated.

#include "SFML\Window.hpp"
#include "SFML\OpenGL.hpp"

sf::Window* window;
void Init();
void GameLoop();
void Update();
void Render();

1>------ Build started: Project: Apollo, Configuration: Release Win32 ------
1>  Source.cpp
1>C:\Users\Arron Nelson\Documents\Visual Studio 2013\Projects\Advanced Protocol Software\Lone Wolf Engine\Engine.h(1): fatal error C1083: Cannot open include file: 'SFML\Window.hpp': No such file or directory
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

I did add my engine as a reference to my game I want to develop, but it came with the error shown above. I did add the SFML libraries, and the includes to the engine, which is a static library as well. After that I combined the necessary SFML static library files to my engines static library file. Here are the following library files I included in the engine...

sfml-graphics-s.lib
sfml-window-s.lib
sfml-system-s.lib

I also added additional include, and library directories to the correct path to the SFML includes, and libraries.
« Last Edit: April 07, 2015, 03:07:19 am by Red-XIII »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10827
    • View Profile
    • development blog
    • Email
Re: Combining Static Libraries
« Reply #1 on: April 07, 2015, 09:35:14 am »
There's only an imaginary gain in combining libraries. If people don't know how to link against multiple libraries then they probably aren't ready to deal with SFML and/or your source.

Also if you can't figure out how to do it, it's probably best not to do it at all. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Red-XIII

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Advanced Protocol
    • Email
Re: Combining Static Libraries
« Reply #2 on: April 08, 2015, 01:19:50 am »
It's not imaginary, it saves time, and effort. If it's impossible then i'll go with dynamic libraries.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10827
    • View Profile
    • development blog
    • Email
Re: Combining Static Libraries
« Reply #3 on: April 08, 2015, 01:57:56 am »
Nothing is impossible, but it's not officially supported by SFML and as I said, if you can't figure it out on your own, it's better you just don't do it, plus I don't want to spend my time on something I don't advise at all, so you can just copy-paste the command without putting any effort into figuring out yourself. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Combining Static Libraries
« Reply #4 on: April 08, 2015, 03:11:30 am »
It's not imaginary, it saves time, and effort.
I'm curious, on what scale are we talking here? Seconds? Minutes? Hours perhaps? As a "semi-scientist" I am inclined to ask people strange questions at times in order to fully understand their thought process. Please don't take it personally.
If it's impossible then i'll go with dynamic libraries.
We are programmers, we make machines do our bidding by feeding them with instructions generated from code, and considering SFML is under zlib, nothing is impossible ;). If you are really hell-bent on achieving this, then you will eventually figure it out yourself. All eXpl0it3r and I can hope for is that once you discover how it is done, you will also realize why it is a bad idea to do it :).
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Combining Static Libraries
« Reply #5 on: April 08, 2015, 08:50:57 am »
Quote
All eXpl0it3r and I can hope for is that once you discover how it is done, you will also realize why it is a bad idea to do it :).
Why is it a bad idea, honestly?
Back to C++ gamedev with SFML in May 2023

Red-XIII

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Advanced Protocol
    • Email
Re: Combining Static Libraries
« Reply #6 on: April 10, 2015, 03:09:45 am »
It's not imaginary, it saves time, and effort.
I'm curious, on what scale are we talking here? Seconds? Minutes? Hours perhaps? As a "semi-scientist" I am inclined to ask people strange questions at times in order to fully understand their thought process. Please don't take it personally.
If it's impossible then i'll go with dynamic libraries.
We are programmers, we make machines do our bidding by feeding them with instructions generated from code, and considering SFML is under zlib, nothing is impossible ;). If you are really hell-bent on achieving this, then you will eventually figure it out yourself. All eXpl0it3r and I can hope for is that once you discover how it is done, you will also realize why it is a bad idea to do it :).

To be honest I couldn't say. Maybe a couple of minutes, it is kind of annoying to add libraries and includes. It's not only that, but I also wanted it to be static, so that my Engine could be static as well for security reasons, but i'm sure I must be wrong in some way.

Well when I do, I may or may not find it bad depending on the circumstances as always.

Thank you for not being abruptly rude about it though, I appreciate that.  :)
« Last Edit: April 10, 2015, 03:12:35 am by Red-XIII »