Thx for the reply. I'm sure the issue is on my end. I have Allegro443-minGW71v3.7z. So version 3 right.

On a side note can a person static link a DLL file or does it have to be lib files only? Just curious.

I appreciate any insight you might have.

Ace

]]>
no-reply@allegro.cc (AceBlkwell)Tue, 22 Aug 2017 18:46:35 +0000

If you didn't static link to the c and c++ runtime libraries, then it will link to the dynamic ones. You need -static-libstdc++ and -static-libgcc at the end of your link line.

If it still fails, I may not have done the same thing on my end.

As a workaround, those two dlls should be in the bin/dlls folder. If not then I definitely need to update the package.

Thanks for testing ')

Edit for your question.MinGW and GCC use .a archives to link libraries. They can be static or dynamic depending on how they were built. MSVC uses a .lib file for static libraries, and a .dll file for dynamic libraries. They do things differently.

Well I found the DLL file if that is an indication to you this is the latest files Also here is the verbiage from the IDE. (below) I see the -static command prefixes the libgcc. Do I add libstdc++ at this location. The file is in the list at the bottom. I assumed the -static command covered everything after it, given it's the first word after the path locations.

Again, I don't think there is an issue with the Allegro files but rather my IDE set up.

Link allegrogl, loadpng, jpgalleg, and logg BEFORE allegro, and link "-static-libgcc" and "-static-libstdc++" at the END of the link command. They are different from the "-static" command which instructs gcc to link to the static versions of the libraries that come after it in the linker command.

I'm going to keep plugging away. Not to question someone who knows a whole lot more about linking than I do, but have you compiled anything with the Allegro 4.4.3 v3 to see that the static aspect works? I can't seem to get my programming run though it compiles and links with no critical errors.

Thanks Ace

]]>
no-reply@allegro.cc (AceBlkwell)Mon, 28 Aug 2017 23:20:07 +0000

Like I said, I may have forgotten to link the crt statically. It may be my fault. Let me test them and see if they produce any dependency. BRB.

EDITI tried compiling a simple allegro program with my binaries and static linking works just fine.

Go to the allegro folder of the distro and run RunA443Examples.bat. That will setup some environment variables for you to compile allegro with.

Add mingw\bin to your %PATH%.

set path=c;\mingw\bin;%PATH%

Now compile your program using the environment I provided. Pass this as the command line and replace test.cpp with your source file.

No luck. I guess I'm just missing the big picture. I can't get the test program to run. I can't get my program to link. Now that I've reinstalled everything I can't get mine to even compile. I get the reference to imp_screen error.

I didn't have any issue with eclipse in Linux. I compiled Allegro 4.4.2 with static option and included the lalleg_s.a file. No issues.

In any case, just for fun and if you have time, wont you see if you can compile and link to static. I'm uploading a 7Z file of my source files and DAT file. If you don't want to mess with it, then don't worry about it. I'm just curious if it's me or the source.

Oh and when I ran the line commands from cmd prompt, gcc could no longer find my include files. See the bat file I created (lot to type each trial)

This is because you didn't "#define ALLEGRO_STATICLINK" in your source files. The easier way to do it is to pass -DALLEGRO_STATICLINK on your command line.

I tried to compile your code but its missing d_array.h and allcolor.h.

EditThey're not missing, you're #include'ing them wrong. Use "allcolor.h" not <allcolor.h>. Quotation marks indicate a user include, and brackets indicate a system include. Always use quotes.

Your command line is still somewhat wrong. I had to change it to include map.cpp and I had to export the 'map' function from map.cpp. I cheated and used 'extern' on the declaration in board.cpp but you should really make a separate header for map.hpp.