problem installing tools (SGDK, etc) for programming

SGDK only sub forum

Moderator: Stef

tama
Interested
Posts: 17
Joined: Wed Aug 12, 2015 9:13 am
Location: Lyon, France

problem installing tools (SGDK, etc) for programming

Post by tama » Wed Aug 12, 2015 9:46 am

Hello everyone,
I'm new here. As a quick presentation, I could say I'm found of the Megadrive/Genesis console and I'd like to program on it from now. Even basic things, just to get the pleasure to have someting displayed on my CRT TV (I've got a Mega Everdrive).
Appart from that, I collect games, especially Megadrive and Saturn :) Who said I love SEGA ? ! ahah

=======================================

So, here are my problems/questions detailed as much as I can.

So, I checked what I would need to program on the Megadrive.
And from this point, I don't understand much, I'm not familiar to compilers, tool kits, etc,

and I get hard time trying to set up the whole :) Even though I searched a lot.
In my defense, the further I got into programming was games on TI89 calculator with TI-BASIC, so no tools required :)

1.
I saw that we can program in Assembly, C or BASIC for Megadrive.
For each of those languages, how to set up the necessary tools ? No C++ programming ?

2.
With SGDK, can I choose the language I want to use ?

3.
I downloaded SGDK 1.12.
Then I followed step by step this : http://www.db-elec.com/home/tutorials/sgdk/1-setup-sgdk

BUT when I launch on the CMD the command "%GDK_WIN%\bin\make -f %GDK_WIN%\makelib.gen", I've got a very long error message about SYGWIN appearing on this console.
I can't copy this message now (I'm in office) but I found a page showing a similar one (perhaps the same) : https://www.cygwin.com/ml/cygwin/2014-12/msg00303.html

=> HELP <=

4.
Then, it is said to use for example Code Blocks or Eclipse to work on programming.
What for ? Can I work only with SGCK directly and how ?


I have difficulties for understanding how those tools work together and their function...
Someone can help me ?

Thank you,
TAMA

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Wed Aug 12, 2015 9:15 pm

Hello Tama,

Glad to see a new MD developer :D
Trying to reply your questions :

1.
Using C++ for Megadrive programming is possible but overkilling, C++ generally tend to generate many overhead in memory and performance which is something you want to avoid on a platform like that.

2.
With SGDK you can both use C or assembly. I recommend C as it's simpler and definitely enough for almost case.

3.
About your problem, you may have a cygwin installation conflicting with SGDK. SGDK uses mingw and don't require cygwin but if you have cygwin in your PATH environment then calling gcc may try to call some cygwin executables instead of the good mingw ones.

4.
You can use SGDK from command line indeed, you write code with whatever editors you like then compile you projects with a simple command line.
You can find the "official" wiki here :
https://github.com/Stephane-D/SGDK/wiki

Then you have 3 sections in 'Installation' :
* Installation & basic use --> work from command line
* SGDK with Eclipse --> work from Eclipse
* SGDK with Code::blocks --> work from Code::Blocks

Using an IDE make life easier as it provides color highlighting as well than auto completion... i would have recommended Eclipse first but i experience some problems with it lately so now i recommend to stick with Code::blocks.

tama
Interested
Posts: 17
Joined: Wed Aug 12, 2015 9:13 am
Location: Lyon, France

Post by tama » Wed Aug 12, 2015 11:20 pm

Hello.
Thank you Stef.

By the way, what for do we need to do this on CMD ? :
%GDK_WIN%\bin\make -f %GDK_WIN%\makelib.gen

So, about point 4 :

How can I see if there is conflict ?
I searched for CYGWIN in my drives and deleted folders that contained it (because after geting the error message I installed Cygwin, thinking it would resolved it).
In REGEDIT, I did search CYGWIN and found some data about what I just deleted : so I deleted those data.

In the "Environment Variables", I deleted one variable referencing to CYGWIN.

I then restarted %GDK_WIN%\bin\make -f %GDK_WIN%\makelib.gen on the CMD.
Same error message (see above for it).

info :
- I'm on VISTA 64
- unzipped the SGDK in C:\DEV\SGDK-1.12
- in C:\DEV\SGDK-1.12\bin there is a "cygwin1.dll"
- I can't find something named "mingw"

user variables set :
name = GDK / value = C:/DEV/SGDK-1.12
name= GDK_WIN / value = C:\DEV\SGDK-1.12

system variable change :
name = Path / value = added \;%GDK_WIN%\bin at the end

complete Path value =
C:\ProgramData\Oracle\Java\javapath;c:\devkitPro\msys\bin;%CommonProgramFiles%\Microsoft Shared\Windows Live;%GTK_BASEPATH%\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files (x86)\Autodesk\Backburner\;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files (x86)\Common Files\Adobe\AGL;C:\Program Files (x86)\Common Files\Autodesk Shared\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\PROGRA~2\TIGCC;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;D:\CALCUL~1\TI-89\LOGICI~1\_04~1.TIG\TIGCCV~1.95;D:\CALCUL~1\TI-89\LOGICI~1\_04~1.TIG\TIGCC-0.95\;%GDK_WIN%\bin

===========================================
HERE is the exact error message I get on the CMD =>
===========================================
C:\Users\GiF>%GDK_WIN%\bin\make -f %GDK_WIN%\makelib.gen

C:/DEV/SGDK-1.12/bin/rescomp C:/DEV/SGDK-1.12/res/libres.res C:/DEV/SGDK-1.12/res/libres.s
3 [main] ? (3940) C:\DEV\SGDK-1.12\bin\make.exe: *** fatal error - C:\DEV\SGDK-1.12\bin\make.exe: *** cygheap base mismatch detected - 0x0/0x611648E0.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
3 [main] ? (5892) C:\DEV\SGDK-1.12\bin\make.exe: *** fatal error - C:\DEV\SGDK-1.12\bin\make.exe: *** cygheap base mismatch detected - 0x0/0x611648E0.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
3 [main] ? (5596) C:\DEV\SGDK-1.12\bin\make.exe: *** fatal error - C:\DEV\SGDK-1.12\bin\make.exe: *** cygheap base mismatch detected - 0x0/0x611648E0.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
3 [main] ? (1220) C:\DEV\SGDK-1.12\bin\make.exe: *** fatal error - C:\DEV\SGDK-1.12\bin\make.exe: *** cygheap base mismatch detected - 0x0/0x611648E0.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
3 [main] ? (4420) C:\DEV\SGDK-1.12\bin\make.exe: *** fatal error - C:\DEV\SGDK-1.12\bin\make.exe: *** cygheap base mismatch detected - 0x0/0x611648E0.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
3 [main] ? (5888) C:\DEV\SGDK-1.12\bin\make.exe: *** fatal error - C:\DEV\SGDK-1.12\bin\make.exe: *** cygheap base mismatch detected - 0x0/0x611648E0.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
7 [main] make 3436 fork: child -1 - died waiting for longjmp before initialization, retry 0, exit code 0x100, errno 11
make: vfork: Resource temporarily unavailable

C:\Users\GiF>
===========================================

Thank you,
TAMA

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Thu Aug 13, 2015 12:35 pm

tama wrote:Hello.
Thank you Stef.

By the way, what for do we need to do this on CMD ? :
%GDK_WIN%\bin\make -f %GDK_WIN%\makelib.gen
Well, that is just to ensure you are using the make delivered in the SGDK package and then it uses the embeded makefile.
Note than here you are trying to rebuild the library itself, normally you should do it once, than when library is built (%GDK_WIN%\lib\libmd.lib file) you can compile your own project by using :

Code: Select all

%GDK_WIN%\bin\make -f %GDK_WIN%\makefile.gen
from your project folder.

So, about point 4 :

How can I see if there is conflict ?
I searched for CYGWIN in my drives and deleted folders that contained it (because after geting the error message I installed Cygwin, thinking it would resolved it).

...
Given all these infos it appears the cygwin1.dll file included in the bin folder of SGDK is not compatible with your Operating System (Vista 64) which is surprising for the least ! I'm using it on Windows 7 32/64 and windows 8/10 64bits without any problems.
Can you check you don't have another cygwin1.dll file sitting elsewhere in your system folder ? You should keep only the one provided in the SGDK/bin folder.

tama
Interested
Posts: 17
Joined: Wed Aug 12, 2015 9:13 am
Location: Lyon, France

Post by tama » Thu Aug 13, 2015 1:10 pm

Hi,
I did a search yesterday on my C: and D: folders and deleted what I found.
If there is a cygwin1.dll in some compressed folders (ZIP, RAR, etc), do I need also to delete those folders ?

tama
Interested
Posts: 17
Joined: Wed Aug 12, 2015 9:13 am
Location: Lyon, France

Post by tama » Thu Aug 13, 2015 1:15 pm

What if another software uses cygwin1.dll from another folder ?
It means it really has to be SGDK exclusive ?
What about that information for example : http://www.dll-downloader.net/c/cygwin1-dll/

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Thu Aug 13, 2015 3:25 pm

Normally having a single functional cygwin1.dll file for your system should be ok. If you don't have any other cygwin1.dll file then try to download another version of it to see if it helps. Again, that is the first time someone report me this problem so it's really strange but maybe vista 64 need different kind of setup than others windows systems.

tama
Interested
Posts: 17
Joined: Wed Aug 12, 2015 9:13 am
Location: Lyon, France

Post by tama » Thu Aug 13, 2015 5:51 pm

I will download randomly what I can find and try to replace the actual file in the SGDK directory.

By the way, I found the following information, do I need to do it ? (translated from French) :
-----------------------------------------------------------------------------------
Copy DLL file in System folder :
Windows 95/98/Me: C:\Windows\System
Windows NT/2000: C:\WINNT\System32
Windows XP, Windows Vista, Windows 7, Windows 8: C:\Windows\System32

If you're running on a 64-bits version of Windows,
you also have to copy this DLL in folder C:\Windows\SysWOW64\
-----------------------------------------------------------------------------------

tama
Interested
Posts: 17
Joined: Wed Aug 12, 2015 9:13 am
Location: Lyon, France

Post by tama » Thu Aug 13, 2015 9:55 pm

I just tried with 3 cygwin1.dll files randomly downloaded from the web :
I got the same message for one of them and some other errors for the others

Ah... but I saved the files in a folder on the desktop but as you said it can be problematic.
Going to saved them in USB Key.

tama
Interested
Posts: 17
Joined: Wed Aug 12, 2015 9:13 am
Location: Lyon, France

Post by tama » Thu Aug 13, 2015 10:20 pm

still the same

tama
Interested
Posts: 17
Joined: Wed Aug 12, 2015 9:13 am
Location: Lyon, France

Post by tama » Thu Aug 13, 2015 11:20 pm

I'm lost, don't understand at all how to make it work properly...

tama
Interested
Posts: 17
Joined: Wed Aug 12, 2015 9:13 am
Location: Lyon, France

Post by tama » Fri Aug 14, 2015 12:46 am

OK, it finally works !!!

I found a website with different DLL versions : http://fr.dll-files.com/cygwin1.dll.html
=> All the DLL for 64 bit didn't work : it's written that DLL file is not available
=> I chose the latest one available on 32 bits and it worked : version 32 bits - 1007.33.0.0

After that, I went to https://www.cygwin.com/ to check if the latest version in 32 bits would work
(to remind, yesterday I installed the 64 bit version to extract the DLL but it didn't work)
So, I install version 2.2.0 in 32 bits version, copied the DLL to SGDK forlder then uninstall the CYGWIN software (delete folder + delete registries in Regedit)
I deleted DGDK folder and created it again from the Zip file
=> then launched %GDK_WIN%\bin\make -f %GDK_WIN%\makelib.gen
=> it worked !!!

=> the DLL version I kept is the one from the CYGWIN wbsite, version 2.2.0 <=

-----------------------------------------------------------------------------------
So I assume that for Vista 64, we need a 32 version of the DLL
Which version is it on "the SGDK 1.12" ?
-----------------------------------------------------------------------------------

by the way, in the System Variable we have to add data in the value of PATH :
I wrote it like this => "my path list"\_04~1.TIG\TIGCC-0.95\;%GDK_WIN%\bin
I also saw that : \%GDK_WIN%\bin (without the comma) : what is correct ?


Thank you,
TAMA

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Fri Aug 14, 2015 9:23 am

Glad you got it to work :) but definitely surprising you had to change it :-/
I don't remember which version i provide in SGDK, but you should be able to see it in file properties.

tama
Interested
Posts: 17
Joined: Wed Aug 12, 2015 9:13 am
Location: Lyon, France

Post by tama » Fri Aug 14, 2015 10:34 am

your cygwin.dll file =>
file version : 1005.21.0.0
product version : 1.5.21

the version I'm using, up to date file from the official website
(the one for 32 bits system because the same one for 64 bits didn't work) =>
file version : 2002.0.0.0
product version : 2.2.0

=> but in propterties tab of the file, there is no information about 32 or 64 bits <=

tama
Interested
Posts: 17
Joined: Wed Aug 12, 2015 9:13 am
Location: Lyon, France

Post by tama » Sun Aug 16, 2015 4:36 pm

Stef,
You told me we can program in both C and Assembly.
Can I do Assembly with CodeBlocks ?

Can I create a program that is calling another one ?
If yes, can a C program call an Assembly one ? An reverse too ?

Post Reply