gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > Problem with VC++ IDE

#10184 - zazery - Fri Aug 29, 2003 4:56 am

Ok i've been doing everything in notepad before I realized I could be doing it in VC++. I then switched over to editing my code in there and then compiling it through a bat file like before. Then I found the GBA Project Appwizard r2.6. I thought I'd give it a try and installed it. I then started a new project in VC++ and just named it d just for test purposes (my finger just hit it thats all). I then looked and was pleased with what was there so I thought I'd just hit compile and I came up with this error message. I know it's probably a stupid mistake of mine but I cant' seem to understand what I did wrong.

My Devkit directory is D:\devkitadv\ and I did put that in the .mak file like it says to.


--------------------Configuration: d - Win32 Debug--------------------
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
D:\devkitadv\bin\as -I D:\devkitadv\arm-agb-elf\include -I D:\devkitadv\lib\gcc-lib\arm-agb-elf\3.0.2\include -mthumb-interwork D:\d\crt0.s -ocrt0.o
------------------------------------------
ASM-Sources Compiled
------------------------------------------
D:\devkitadv\bin\gcc -I D:\devkitadv\arm-agb-elf\include -I D:\devkitadv\lib\gcc-lib\arm-agb-elf\3.0.2\include -I D:\d -mthumb-interwork -c -g -O2 -Wall -fverbose-asm D:\d\interupt.cpp D:\d\d.cpp
In file included from D:/d/d.cpp:5:
D:/d/mathluts.h:53:1: warning: no newline at end of file
------------------------------------------
CPP-Sources Compiled
------------------------------------------
D:\devkitadv\bin\ld -L D:\devkitadv\lib\gcc-lib\arm-agb-elf\3.0.2\interwork -L D:\devkitadv\arm-agb-elf\lib\interwork -T LinkScript -o d.elf crt0.o crtbegin.o crtend.o interupt.o d.o -lstdc++ -lgcc -lc
D:\devkitadv\bin\ld: cannot find -lgcc
NMAKE : fatal error U1077: 'D:\devkitadv\bin\ld' : return code '0x1'
Stop.
Error executing NMAKE.

d.exe - 1 error(s), 1 warning(s)


Thanks,
Eric

#10186 - iuiz - Fri Aug 29, 2003 6:23 am

I had also Problems with the App-Wizzard. I am using MSVC++ '98 and found another good way.

Press alt+f7 and click on your source file (on the left). Then you select "userdefindes build" (or something like this, I have the german Version). Then go to the tab "userdefined build" and enter the following by commands:

Quote:
path=D:\devkitadv\bin
gcc -o main.elf main.cpp bg.cpp -lm
objcopy -O binary main.elf main.gba

(perhaps you will have to change the path, or something like that)

main.elf is the name, your file will be called. You could also write "blalba.elf". main.cpp and bg.cpp are my Source files. You will have to add each file manually (but it is realy not much work).


In the second textfield you will enter "main.gba" (as your file is called so).

After you have done this, click on the other source files and select "exclude from build" (I realy dont know, how this option is called in the Englisch Version, perhaps someone can tell me :)).



Now you are done! To compile just press f7. But remember: It will only compile, after you have done a change in main.cpp! Just type space and press f7. I am not realising this anymore :). If I want to compile i press the 2 buttons in nearly no time.



Improvement: Press alt+f7 again and select your Projekt on the left (it is on the top). Select "run after creation" and add the folowing command: "E:\gba\rpg\emulator\VBA.exe E:\gba\rpg\main.gba"

This will run the emu automaticaly, after you pressed f7 (you will have to change the directory).




Cu,
iuiz

//e: Can someone correct the mistakes, as I am realy not good in English ;).

#10214 - zazery - Fri Aug 29, 2003 8:30 pm

hmm that seems logical to work and I understand it but mine is VC++ 6.0 english version. I can't seem to get your ideas to work with my version. I am not too used to using the program since I learnt Visual Basic before and not C. I'm learning C at the moment.

I tried playing around with the options there and don't understand why they aren't working.

Thanks for the reply but unfortunatly it isn't working. I'll hopefully figure it out but any more help will be appreciated.

I do have another question, I'm getting EZ flash advance soon, why do I have to fix the header, how can I do it, and what does it do?

thanks,
Eric

#10216 - iuiz - Fri Aug 29, 2003 9:13 pm

I will post it tommorow again with some Screenshots for you :).

I am sorry, that it doesn't work... :(

#20999 - Xorcist - Fri May 21, 2004 7:44 am

I'm having the exact same problem with ld.exe returning 0x1, I'm just getting started too, setting up Visual C++ w/ DevKitAdvance. Did you ever figure out a solution to this problem?

Here is the exact output
Code:

-------------------Configuration: Test - Win32 Debug--------------------
Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
 C:\PROGRA~2\GBA\DEVKIT\bin\as -I C:\PROGRA~2\GBA\DEVKIT\arm-agb-elf\include -I C:\PROGRA~2\GBA\DEVKIT\lib\gcc-lib\arm-agb-elf\3.0.2\include -mthumb-interwork C:\PROGRA~2\GBA\PROJECTS\Test\crt0.s -ocrt0.o
------------------------------------------
ASM-Sources Compiled
------------------------------------------
 C:\PROGRA~2\GBA\DEVKIT\bin\gcc  -I C:\PROGRA~2\GBA\DEVKIT\arm-agb-elf\include -I C:\PROGRA~2\GBA\DEVKIT\lib\gcc-lib\arm-agb-elf\3.0.2\include -I C:\PROGRA~2\GBA\PROJECTS\Test -mthumb-interwork -c -g -O2 -Wall -fverbose-asm C:\PROGRA~2\GBA\PROJECTS\
Test\Test.c
------------------------------------------
C-sources Compiled
------------------------------------------
 C:\PROGRA~2\GBA\DEVKIT\bin\ld -L C:\PROGRA~2\GBA\DEVKIT\lib\gcc-lib\arm-agb-elf\3.0.2\interwork -L C:\PROGRA~2\GBA\DEVKIT\arm-agb-elf\lib\interwork -T LinkScript -o Test.elf crt0.o        Test.o -lstdc++ -lgcc -lc
C:\PROGRA~2\GBA\DEVKIT\bin\ld: cannot find -lgcc
NMAKE : fatal error U1077: 'C:\PROGRA~2\GBA\DEVKIT\bin\ld' : return code '0x1'
Stop.
Error executing NMAKE.

Test.exe - 1 error(s), 0 warning(s)



** Haha... just noticed what it was... the AppWizard created the makefile with:

Code:

LIBDIR  = $(DEVDIR)\lib\gcc-lib\arm-agb-elf\3.0.2\interwork
INCDIR  = $(DEVDIR)\lib\gcc-lib\arm-agb-elf\3.0.2\include


but it really should have been:

Code:

LIBDIR  = $(DEVDIR)\lib\gcc-lib\arm-agb-elf\3.2.2\interwork
INCDIR  = $(DEVDIR)\lib\gcc-lib\arm-agb-elf\3.2.2\include


for the latest release. :)

#21038 - zazery - Sat May 22, 2004 2:21 am

I really didn't fix it since I just didn't bother, I am going to probably end up using kdevelop (Slackware 9.1, aka linux) which has GBA support already built in, well at least the newest version. There were some tutorials I've come across but none have solved my problem. I'll probably be attempting it again today or tomorrow. I'll let you know what happens.

#21044 - Xorcist - Sat May 22, 2004 10:30 am

Once I changed the above directories in the makefile, everything compiled fine. Guess that appwizard is a bit old and was never updated for the latest DevKitAdvance releases.

* On a side note, anyone know if Kylix (i.e. Borland C++ Builder on Linux) can be setup to work with DevKitAdvance? And if so, have any tutorials to do so... I'd be interested in seeing if I could get it working seeing as I already have it installed under SuSE 8.2.