LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-15-2016, 09:42 AM   #1
random110
LQ Newbie
 
Registered: Jan 2014
Posts: 20

Rep: Reputation: Disabled
configure, make, install ... linkage?


I don't know if this is a Windows DLL problem or a Configure problem.

I have successfully installed g++ and SDL (for making games, interfaces, etc) in Windows using MinGW, and some help with CygWin. But a lot of work has to be done manually for SDL C++ packages, such as manually putting include and lib files where they belong... OK, no problem, but for a certain SDL addition called SDL_gfx I had to build the source with configure and make, and here is where problems BEYOND ME arise.

So I successfully configured and made, and the C++ includes to "SDL2_gfx.h" stop calling errors, WOOHOO! But now when I try to compile some code with actual SDL2_gfx I get all of these linking errors, so what am I doing wrong? The linking errors are showing paths to the directories WHERE I BUILT THE SOURCE, but I am not in that directory...! Nor is the project!

So did I put the wrong lib files in the link directory? In the build directory there are 2 sets of lib files. There are *.a and *.o files in the root of the build directory and there is also a .lib directory which was created. I tried copying BOTH of these and compiling the app again, but they both give the same linking errors and pointing back to the build directory.

Ah ha! So then I realize that for the other libraries there was also a DLL file that came with them and I needed to include that in the application project directory. But... The source I built for SDL_gfx did not make a DLL !!!

So now I am completely lost.

1) Am I copying the wrong files from the source build?

2) Was I supposed to include a destination path in the build? Because now everything seems to be linking to the original source build directory which is certainly not right.

3) Do I need to make my own DLL? How?

Of course I tried "make install" after I built, but that failed, obviously, because this is not linux and so it couldn't find /usr/lib or /usr/include etc...

Any advice?

I really want to understand this, I feel like I am starting to understand all of this "make" stuff with libs and includes a lot better for C/C++. If I can get this I can install a lot of stuff from source much better.

Last edited by random110; 04-15-2016 at 09:43 AM.
 
Old 04-15-2016, 10:21 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
you can not mix mingw and cygwin headers
just the same as you can not mix the MS Visual studio and mingw or cygwin headers

when i was using Visualstudio i would rename the msys install location
c://GnuWin32/mingw/?
to
c://123GnuWin32/mingw/?

to remove it from the windows system $PATH

all the SDL-???? packages are in mingw
just use the gui installer for msys
or the gnuwin32 project files

make the mingw *.la files then use dlltool to convert them into windows dll's

Last edited by John VV; 04-15-2016 at 10:23 PM.
 
Old 04-16-2016, 12:49 AM   #3
random110
LQ Newbie
 
Registered: Jan 2014
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by John VV View Post
you can not mix mingw and cygwin headers
just the same as you can not mix the MS Visual studio and mingw or cygwin headers

when i was using Visualstudio i would rename the msys install location
c://GnuWin32/mingw/?
to
c://123GnuWin32/mingw/?

to remove it from the windows system $PATH

all the SDL-???? packages are in mingw
just use the gui installer for msys
or the gnuwin32 project files

make the mingw *.la files then use dlltool to convert them into windows dll's
Thanks for the response!

When it comes to Windows, I guess I will have to reverse what I've heard for years and say "I am a total n00b!". I'm used to Linux where this wouldn't be a problem. I am trying to install the SDL_gfx libraries to no avail. Everything else with SDL has worked smoothly via cygwin, mingw, and even codeblocks (tried them all!)

I really don't understand DLL's, I have read up about them, but my experience is telling me that a DLL is required in addition to lib's and include's for C++ linked library based compiles - such are the other SDL libraries I installed: SDL_image, SDL_ttf, etc. But I hit the brick wall when I got to SDL_gfx! If only the maintainer provided Win binaries I wouldn't have wasted a weekend already(!) (with huge respect to the developer of course, I know it's work)

So now my system is bit "bjorked", you are right, I have a cygwin/mingw combo going on, but the systems are still separate and I "do know" where my paths are. I could clean that up, but a fresh install of SDL on cygwin also didn't go so smooth.

I know for a fact that SDL_gfx was a part of the problem because all other sources included "SDL/SDL.h" for example where the source for SDL_gfx goes direct to "SDL.h", I had to rewrite that to compile, and then of course the dog chasing its own tail - began. It did compile, but I'm not sure if I created extra problems.

I don't know VisualStudio. I am comfy with cygwin because I am a cli + vim kinda coder, but still having problems, and somewhere in my ConEmu+MinGW reading I came to find them reporting "We don't plan to support POSIX" and therefor... I gave up and tried cygwin.

This might sound harsh, but really everything worked, up to trying to install SDL_gfx for SDL1.2, then I said "OK let me try SDL2!" and that didn't work either.

I will look, but I doubt that SDL_gfx is in MinGW as I am reading all over about problems compiling it for Win, whether it be SDL1.2 or SDL2. My problem is not with installing SDL at all, it is simply this library for SDL_gfx. That's what leads me to wanting to understand how to compile a library and install it correctly in cygwin or mingw. But I might just give up at this point.

So does simply using dlltool to convert *.la work to make DLL's? I don't understand DLL's but would be willing to try. Right now I am systematically copying SDL_gfx functions out of the source and putting them into my code hahaha. Madman! But it is working! (and developer will get credit as requested via license).

Sorry if I'm ranting, I've been doing this for 2 days straight...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem after make install in OTCL and C++ linkage program chenil Linux - Newbie 8 04-06-2013 07:05 AM
How to check a program that was installed via configure, make and make install linuxandtsm Linux - Newbie 1 04-06-2012 02:41 PM
these commands are not working on my server (./configure, make, make install) Anil Kumar K Linux - Software 3 07-02-2007 07:23 AM
configure, make and make install commands don't work for me Fenster Fedora 8 08-18-2004 10:58 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration