473,387 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

MS compiler for AMD64 and the calling conventions

I am using Microsoft (R) C/C++ Optimizing Compiler Version 14.00.40121 for
AMD64 to port a dll (C, C++ and fortran files) for WS2003. I am working with
VS2003, with customized paths in Tools > Options > Project > VC++ Directories
in order to correctly target the compiler executables and associated
libs/headers (Program Files\Microsoft Visual Cpp\Bin\x86_amd64, etc).

I am actually facing a link issue because C symbols are not generated with
the '_' prefix when I use the default calling convention __cdecl(/Gd):
expected "_routine" and got "routine" (checked with dumpbin /symbol
routine.obj).
The same code compiled with standard VS2003 compiler (win32) has the '_'
prefix: "_routine".

For testing purposes, I've tried also fastcall and stdcall conventions and
noticed no change on the symbol name even if the buildLog.htm shows that the
correct cl.exe option is used.

I am working with someone else in another country to compile the same code.
He has the same install and uses the exact same options he is able to link.

I would appreciate some quick help on this topic, thanks in advance.
--
Stephane Marguerin
Nov 17 '05 #1
4 2408
The amd64 has its own standard calling convention, maybe that is why you
cannot change it.
Nov 17 '05 #2
With Windows XP 64, none of the functions in the native 64 bit libraries have
them. So it doesn't matter if you don't have them there because it isn't a
problem. The linker should look for the names without the underscore and link
with no problems.
I've never had a problem compiling, linking and running native 64bit code,
so you shouldn't worry either.
If you do want the underscores however, you can go around and add them all
yourself.
Nov 17 '05 #3
Thanks, I was not aware of this change: where did you find this information?

My problem comes with Frotran symbols called from C. Because of an error in
my environment, I was using the 32bit fortran compiler instead of the 64bit
one... Using the correct fortran compiler fix the problem: all symbols
without the "_" prefix.

Thanks for you answers guys.
--
Stephane Marguerin
"D.Rowe" wrote:
With Windows XP 64, none of the functions in the native 64 bit libraries have
them. So it doesn't matter if you don't have them there because it isn't a
problem. The linker should look for the names without the underscore and link
with no problems.
I've never had a problem compiling, linking and running native 64bit code,
so you shouldn't worry either.
If you do want the underscores however, you can go around and add them all
yourself.

Nov 17 '05 #4
This information I got was really through poking around myself. I have
Windows x64 edition installed on my computer so I am able to run these
programs to test. I also looked around some other things, like using dumpbin
on dll files and such.
I can't remember clearly, but I think there may be information on this in
the Windows 64 programming guide in MSDN.
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Generic Usenet Account | last post by:
Compile the following snippet of code and run it. If the program spits out bat:bat instead of bat:zat, what would you say? Would you say that the compiler has a problem, or would you lay the...
16
by: aarklon | last post by:
Hi folks, recently i read the book named assembly language step by step by Jeff Duntemann. in the chapter coding for linux, he has got a paragraph named C calling conventions, which he...
1
by: Timur Safin | last post by:
Hi All, Sorry if it is offtopic here, I wasn't able to find any more relevant group... I'm slowly approaching AMD64 build for our product (as my personal fun project). And after I ran that...
11
by: John Friedland | last post by:
My problem: I need to call (from C code) an arbitrary C library function, but I don't know until runtime what the function name is, how many parameters are required, and what the parameters are. I...
6
by: John Pye | last post by:
Hi all I have a tricky situation that's preventing my Python/SWIG/C application from running on the Debian Etch AMD64 platform. It seems that the 'dl' module is not available on that platform....
19
by: llothar | last post by:
I must say i didn't expect this. I just did some measures on FreeBSD 6.2 with gcc 3.4.6 and there is absolutely no significant difference between 32 and 64 bit mode - neither in compilation speed,...
42
by: jacob navia | last post by:
http://slashdot.org/ "The leaner, lighter, faster, and most importantly, BSD Licensed, Compiler PCC has been imported into OpenBSD's CVS and NetBSD's pkgsrc. The compiler is based on the...
16
by: Jaco Naude | last post by:
Hi there, This is my first post over here and I hope someone can give me some guidance. I'm trying to embed Python into a Visual C++ 2008 application and I'm getting linker problems. I've...
12
by: Andreas Lundgren | last post by:
Hi! Is it determined that the C standard compiler always encode characters with the same character excoding? If for example the functions Foo and Bar are compiled by different compilers, is it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.