473,769 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_amd 64, 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 2429
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
1656
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 blame on "undefined execution of function parameters" in the C/C++ standard and "sequence points"? /////// Code snippet begins /////// #include <iostream> char foo="cat";
16
2306
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 describes as follows 1)
1
1905
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 Amd64 cross-compiler from DDK 3790 build (proven to be good enough for my driver stuff) over the sources I've updated shortly I've found this serious assertion appearing in manyplaces of the code we have: $ tcc.ver edzunet build5105
11
407
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 can use dlopen/whatever to convert the function name into a pointer to that function, but actually calling it, with the right number of parameters, isn't easy. As far as I can see, there are only two solutions: 1) This one is portable. If...
6
2001
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. The only reason I need the 'dl' module, however, is for the values of RTLD_LAZY etc, which I use with sys.setdlopenflags() in order to make my imported SWIG module share its symbols correctly with more deeply- nested plugin modiles in my C-code...
19
3817
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, nor in speed of the compiled result. As a benchmark i took a bootstrap of the SmallEiffel Compiler (which has 38 files with around 100 kloc). The times i got were very reliable. The bootstraping (compile the c files from last eiffel compiler...
42
3453
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 original Portable C Compiler by S. C. Johnson, written in the late 70's. Even though much of the compiler has been rewritten, some of the basics still remain. It is currently not bug-free, but it compiles on x86 platform, and work is being done on it to...
16
3785
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 compiled a DLL of the Python source code using the pythoncode VC++ project in the PCbuild folder of the source download and this works 100% without any warnings etc. I've done this in Debug and Release mode without any problems.
12
3914
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 unambiguous how to interpret the character string in Bar? Does string.h expect a specific string format? void Foo(void)
0
10212
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10047
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3962
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.