|
From: Peter R. <p.r...@sh...> - 2010-10-28 09:41:03
|
On 28/10/2010 10:25, Andrea Galeazzi wrote: > Il 28/10/2010 10.26, Tor Lillqvist ha scritto: >> Your initial mail used the word "method", does that mean you are using >> C++, and that the entry point you want to use is in fact a method in a >> class? Hopefully at least a static method, otherwise it wouldn't make >> any sense, would it? Anyway, using C++ for an entry point sounds like >> a crazy idea to me. But I am not a C++ person. You might need to use >> the mangled name then in the linker option, or use extern "C" around >> your OmegaStartup, or something. But anyway, there might be even more >> complications if you use C++. (Even if you use just C, various things >> might break if you try to override the default entry point. You really >> need to know what you are doing. That you have to ask these questions >> indicates that you don't.) >> >> --tml >> >> ------------------------------------------------------------------------------ >> Nokia and AT&T present the 2010 Calling All Innovators-North America contest >> Create new apps& games for the Nokia N8 for consumers in U.S. and Canada >> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing >> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store >> http://p.sf.net/sfu/nokia-dev2dev >> _______________________________________________ >> MinGW-users mailing list >> Min...@li... >> >> This list observes the Etiquette found at >> http://www.mingw.org/Mailing_Lists. >> We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated. >> >> _______________________________________________ >> You may change your MinGW Account Options or unsubscribe at: >> https://lists.sourceforge.net/lists/listinfo/mingw-users >> >> __________ Informazioni da ESET NOD32 Antivirus, versione del database delle firme digitali 5569 (20101027) __________ >> >> Il messaggio è stato controllato da ESET NOD32 Antivirus. >> >> www.nod32.it >> >> >> >> > Even if the project is a c++ project, the OmegaStartup is a very simple > C function: > > extern "C" void MemConfig(void); > extern "C" void mainCRTStartup(void); > using namespace std; > > int main(int argc, char* argv[]) > { > ........ > } > > void OmegaStartup(void) > { > MemConfig(); > mainCRTStartup(); > } > > I need MemConfing to be the first function called, even before the > mainCRTStartup(); > As you can see I know what I'm doing (this code always worked with MSC > compiler and the option /entry: mainCRTStartup), what I actually don't > know is how to do the same thing with MinGW. > I also noticed that in the object file the symbol for OmegaStartup has > become Z12OmegaStartupv; despite on that the option -e Z12OmegaStartupv > doesn't work too. > I'm sure that something escapes me, I've been struggling with this > problem for 2 day... any further help will be appreciate. > Thanks > Just a half-confident suggestion (since I have never had to do it myself) but could you use objdump to trace through the exe? The entry point must be indicated (in the header). What symbol does that take you to? But I have never used objdump... Good luck! Peter |