TIM S, I have found a lot of your helpful hints as I have researched further, thanks
Surprisingly enough, I have got all but one of my original .c files to compile to .o compiled files using .gcc in Code::Blocks. My problem now is linking.
I have tried analysing the original.exe using IDA pro demo, but I could nor get a clear picture from this of the object files used.
As I don't know exactly which of my .o files need to be linked to create my new .exe. I thought that I would try linking the .o files that I have and see what transpired.
I have also analysed the original sip32.exe using depends.exe and obtained a listing of the .DLLs called at runtime.
I thought that if entered all these libraries at Project > Project build options > linker settings > Link Libraries using the stripped library name (deleting lib prefix and leaving off the .a), I should by default be using all the linking libraries that I need.
When I ran Build > Build and Run half the libraries came up as not existing (not in my C:\MinGW\lib or C:\MinGW\lib\gcc\Mingw32\4.5.0 - as I confirmed).
I deleted reference to these libraries and again ran Build > Build and Run.
I used Project > Project build options > linker settings > other linker options of:
-Wl,--enable-auto-image-base
-Wl,--add-stdcall-alias
-Wl,--enable-auto-import
-Wl,--enable-stdcall-fixup
-Wl,--cref
-Wl,--trace
which I found on the internet
and Project > Project Build options > Compiler settings > Other options of:
-mthreads
-fmessage-length=0
-m32
-mwindows
-v
-fmax-errors=0
again found on the internet
What I found was that the link libraries used are
kernel32
gdi32
user32
mingw32
gcc
ntdll
msvcrt
comdlg32
gcc_s
moldname
The libraries that I entered are not mentioned unless they are not present in C:\MinGW\lib or C:\MinGW\lib\gcc\Mingw32\4.5.0 and it makes no difference if I keep them or deleted all the link Libraries
What I get as Error messages are:
C:/2011sip/SIP/Sipprt.c:185: undefined reference to `Plot_Axes'
C:/2011sip/SIP/Sipprt.c:187: undefined reference to `Plot_Data'
obj\Debug\sipwnd.o: In function `WndProc@16':
C:/2011sip/SIP/sipwnd.c:138: undefined reference to `Read_Ini_Int'
C:/2011sip/SIP/sipwnd.c:140: undefined reference to `File_Init'
C:/2011sip/SIP/sipwnd.c:142: undefined reference to `Ex_File_Init'
C:/2011sip/SIP/sipwnd.c:197: undefined reference to `File_Open_Dlg'
C:/2011sip/SIP/sipwnd.c:201: undefined reference to `Sip_File_Read'
C:/2011sip/SIP/sipwnd.c:234: undefined reference to `Ex_File_Save_Dlg'
C:/2011sip/SIP/sipwnd.c:248: undefined reference to `File_Export'
C:/2011sip/SIP/sipwnd.c:262: undefined reference to `File_Export'
C:/2011sip/SIP/sipwnd.c:272: undefined reference to `File_Export'
C:/2011sip/SIP/sipwnd.c:290: undefined reference to `File_Save_Dlg'
C:/2011sip/SIP/sipwnd.c:304: undefined reference to `Sip_File_Write'
C:/2011sip/SIP/sipwnd.c:321: undefined reference to `Sip_File_Write'
C:/2011sip/SIP/sipwnd.c:471: undefined reference to `Analyse_Data'
obj\Debug\sipwnd.o: In function `PlotWndProc@16':
C:/2011sip/SIP/sipwnd.c:1251: undefined reference to `Plot_Axes'
C:/2011sip/SIP/sipwnd.c:1253: undefined reference to `Plot_Data'
if I delete the troublesome sipwnd.c from the compile and link, I get:
obj\Debug\Sip32.o: In function `WinMain@16':
C:/2011sip/SIP/Sip32.c:161: undefined reference to `WndProc@16'
C:/2011sip/SIP/Sip32.c:192: undefined reference to `StatBarProc@16'
C:/2011sip/SIP/Sip32.c:199: undefined reference to `PlotWndProc@16'
C:/2011sip/SIP/Sip32.c:207: undefined reference to `PlotTitleWndProc@16'
C:/2011sip/SIP/Sip32.c:215: undefined reference to `PlotStatWndProc@16'
obj\Debug\Sipdlg.o: In function `DialWndProc@16':
C:/2011sip/SIP/Sipdlg.c:273: undefined reference to `bRtData'
C:/2011sip/SIP/Sipdlg.c:275: undefined reference to `bStData'
C:/2011sip/SIP/Sipdlg.c:308: undefined reference to `bRtData'
C:/2011sip/SIP/Sipdlg.c:310: undefined reference to `bStData'
obj\Debug\Sipprt.o: In function `Print_Data':
C:/2011sip/SIP/Sipprt.c:185: undefined reference to `Plot_Axes'
C:/2011sip/SIP/Sipprt.c:187: undefined reference to `Plot_Data'
I am a little surprised by this as my code has been well written - as far as I can tell - and has compiled, linked and successfully run before. I would have thought that all the references were there already.
I am at a loss to know how to proceed - any ideas?
Thanks
Finston