Register | Login | |||||
Main
| Memberlist
| Active users
| Calendar
| Chat
| Online users Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album |
| |
0 users currently in ROM Hacking. |
User | Post |
1337_Ac3 Posts: 90/90 |
Originally posted by MathOnNapkins No, no, no. Wow, your post was so totaly uncalled for.. And yes, anyone who has some kind of common sense should be able to figure out what winmain() replaces....... Arr, well, this looks like dry grass with fuel for a flamewar so let's stop. |
MathOnNapkins Posts: 1087/1106 |
lack of experience? ignorance? need we go on?
p.s. btw programs don't need a main( ) if they are windows apps. They use winmain( ). And if they use MFC the winmain( ) is even hidden. I had that pain the ass the other day trying to figure out the source of some program I downloaded. |
1337_Ac3 Posts: 89/90 |
Originally posted by Cellar Dweller + Wow, thanks for making me feel like the biggest idiot in the whole world. How come i didn't think of that... |
Cellar Dweller + Posts: 138/138 |
I got it to work on my brother's Windows machine. For some wierd reason, FuSoYa didn't provide an import library like a DLL author normally would. You can add LunarDLL.cpp to the project and it will load and call the DLL. |
T.Geiger Posts: 26/26 |
The error messages you are getting are usually caused by a lack of a linking reference to an external DLL. It is not enough to merely include the header file, you must also dig into the application settings and figure out where libraries are linked. I do not have a C compiler in front of me, so I cannot tell you exactly where to go, but compilation errors work really well in Google. |
Smallhacker Posts: 820/832 |
Originally posted by Cellar Dweller + Hm... Nope. Still the same problem. |
Cellar Dweller + Posts: 137/138 |
It looks like part of the problem is that the functions in the DLL are C style and the main program is trying to call C++ style functions. To support function overloading, methods, and as a layer of error checking, C++ mangles the names of functions in the object file in a way that encodes the function's return and argument types. Therefore, the linker can't resolve the function symbols. If you are sure that you have directed your IDE to import functions from the DLL, try changing: #include "../DLLCode/LunarDLL.h"into: extern "C" {in smw_example.cpp. If your IDE isn't importing from the DLL, which could also cause this problem, then I can't help much. It also looks like Smallhacker's IDE is trying to build the program as a console app based on the fact that the linker is looking for a "main" function. I haven't programmed for Windows in a long time, so I'm not equipped to explain how to fix that. |
1337_Ac3 Posts: 88/90 |
Originally posted by Stifu The one i got has a main (win api main), but it wont compile because i get the undefined reference to *function* and i'm using codeblocks. If someone could please make some kind of documention on how to get the stuff running it would be cool, because i kinda need it.. |
Stifu Posts: 626/647 |
I didn't spend much time on it, but if I remember right, it's just that the program isn't complete. It doesn't have a "main"... |
Smallhacker Posts: 818/832 |
This probably belongs in the Programming forum, but I believe that I'm more likely to get help in here.
Has anyone ever got the SMW program example in Lunar Compress to compile? I've tried three different compilers (Borland C++ Builder 5, Dev-C++ and M$ Visual C++ 6.0) and all of them complains about unsolved external references. Here's the error messages from VC++: --------------------Configuration: smw_example - Win32 Debug-------------------- Compiling... smw_example.cpp Linking... smw_example.obj : error LNK2001: unresolved external symbol "unsigned int (__stdcall* LunarSNEStoPC)(unsigned int,unsigned int,unsigned int)" (?LunarSNEStoPC@@3P6GIIII@ZA) smw_example.obj : error LNK2001: unresolved external symbol "int (__stdcall* LunarRender8x8)(unsigned int *,int,int,int,int,void *,unsigned int *,unsigned int,unsigned int)" (?LunarRender8x8@@3P6GHPAIHHHHPAX0II@ZA) smw_example.obj : error LNK2001: unresolved external symbol "unsigned int (__stdcall* LunarSNEStoPCRGB)(unsigned int)" (?LunarSNEStoPCRGB@@3P6GII@ZA) smw_example.obj : error LNK2001: unresolved external symbol "int (__stdcall* LunarCreatePixelMap)(void *,void *,unsigned int,unsigned int)" (?LunarCreatePixelMap@@3P6GHPAX0II@ZA) smw_example.obj : error LNK2001: unresolved external symbol "int (__stdcall* LunarCloseFile)(void)" (?LunarCloseFile@@3P6GHXZA) smw_example.obj : error LNK2001: unresolved external symbol "unsigned int (__stdcall* LunarDecompress)(void *,unsigned int,unsigned int,unsigned int,unsigned int,unsigned int *)" (?LunarDecompress@@3P6GIPAXIIIIPAI@ZA) smw_example.obj : error LNK2001: unresolved external symbol "int (__stdcall* LunarOpenFile)(char *,unsigned int)" (?LunarOpenFile@@3P6GHPADI@ZA) smw_example.obj : error LNK2001: unresolved external symbol "bool __cdecl LunarUnloadDLL(void)" (?LunarUnloadDLL@@YA_NXZ) smw_example.obj : error LNK2001: unresolved external symbol "bool __cdecl LunarLoadDLL(void)" (?LunarLoadDLL@@YA_NXZ) LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/smw_example.exe : fatal error LNK1120: 10 unresolved externals Error executing link.exe. smw_example.exe - 11 error(s), 0 warning(s) Does anyone know what the problem is? |