Phew!
Man that was a hard fight!
Been struggling for more than 4 hours!!!!!!!!
Thanks god it had a happy ending :)
Although i have solved my problem (Thanks Icz once again) i'd like to keep digging cos i know there are a couple of things that are not really clear.
I'm coding a new project which involves the WinCap library of functions. This library comes with its proper .lib and .h files (it's all written in c and includes its source code).
I tried a 'Hello World' to see how tough this was going to be and when i linked my program i got a 'unresolved symbol' msg.
Checked my prototypes and 'common' stuff and everything was ok. I knew the problem was inside the .lib file but could not realise what it was.
Almost tired and about to give up i read Iczelion's 'Make your own .lib files' tutorial. While reading it i learned that the '@xx' data after the import name inside a .lib file is used by MASM when the INVOKE macro is used (or at least that is what i understood).
Finally i could get a _new_ .lib file using Icz techniques and now i can go back home (3:00 am) with a broad smile in me face.
The question is..
Isn't there ANY other way to come up with an 'invokable' .lib file???
I DO have the librarie's source files, but i tried rebuilding the whole damn thing (with vc++) and still the imports would show up without the '@xx' thing.
I'm sure there is another way..life can't be that cruel for the asm coder :)
Sleep tight.
Latigo
Latigo,
I have a sneaking suspicion that you have a calling convention
problem, the func@XX is the notation for decorated names in
Microsoft library format for STDCALL so make sure your asm prototypes
are of the same calling convention as the library modules, If you
mix C and STDCALL they will not work.
MASM libraries work fine in Microsoft C as long as you write the
prototypes correctly, should work the other way round fine.
Regards,
hutch@pbq.com.au
Hutch! thanks for taking a look at my post :)
My problem is that the .lib files that the author of the library provides does NOT include the @xx data in the names of the exported functions.
Does this indicate that his functions are not STDCALL??
So what i tried to do in the first place was to recompile the sources with VC++ to get 'invokable' lib files.
And as i could not get such thing i had to resort to Iczelion's solution.
Maybe i'm still missing some point here. Should that be the case i apologize.
Bye and thanks!
Latigo
i had the same problem
when you compile the lib, there' s an option in the compiler, wich i don' t remember, that will generate the good functionname@params format. just call the compiler with /help and check the parameters. i could do it with vc++ 5.
Yessssssssssssssssssss
Roy and Hutch are the men of the hour!!!
Woo!!! i finally made it thanks to you guys!!!!!
At long last!
The problem was , as this two gentlemen said, that VC++'s compiler was using the __cdecl calling convention. All i had to do was to switch that to __stdcall. That is done in Project | Settings | C/C++ | Category:Code Generation; or it can be done via commandline using the /Gz switch.
Damn it! i lost precious hours of sleep because i did NOT RTFM
hehe :)
Thanks mates.
Latigo