473,396 Members | 1,966 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,396 software developers and data experts.

can't include _alloca as an intrinsic function

Hi all,

I trying to port a WDM driver in VS.Net 2005. I had several difficulty,
but it's one of them I still did not found any solutions.

My code use the function _alloca to allocate space on the stack. When I
compile my code with the include of <malloc.hI have no problem but
the difficulty raise with the linker:
error LNK2019: unresolved external symbol __alloca_probe_16 referenced
in function "long __stdcall CreateRegistryPath(void * &,char const
*,unsigned long)" (?CreateRegistryPath@@YGJAAPAXPBDK@Z) drvutils.obj

It seems that the new Multithreaded runtime of VC8 doesn't contains
this function...

So I have try to use compiler intrinsic version by adding /Oi to
compiler option and removing the #include <malloc.h>
I have a compiler error now:
error C3861: '_alloca': identifier not
found d:\Dev\Sp07-1\XSp\_scc\VirtualAudioCable\Originals\VAC\drvutil s.cpp 1630

However _alloca is declared as available on all platform :
http://msdn2.microsoft.com/en-us/library/5704bbxw.aspx

Nov 22 '06 #1
4 3817
So I have try to use compiler intrinsic version by adding /Oi to
compiler option and removing the #include <malloc.h>
I have a compiler error now:
error C3861: '_alloca': identifier not
found d:\Dev\Sp07-1\XSp\_scc\VirtualAudioCable\Originals\VAC\drvutil s.cpp
1630
Did you try replacing the following line:
#include <malloc.h>

with this include?:
#include <intrin.h>

"mousou" <mo*********@bluemail.chwrote in message
news:11**********************@j44g2000cwa.googlegr oups.com...
Hi all,

I trying to port a WDM driver in VS.Net 2005. I had several difficulty,
but it's one of them I still did not found any solutions.

My code use the function _alloca to allocate space on the stack. When I
compile my code with the include of <malloc.hI have no problem but
the difficulty raise with the linker:
error LNK2019: unresolved external symbol __alloca_probe_16 referenced
in function "long __stdcall CreateRegistryPath(void * &,char const
*,unsigned long)" (?CreateRegistryPath@@YGJAAPAXPBDK@Z) drvutils.obj

It seems that the new Multithreaded runtime of VC8 doesn't contains
this function...

So I have try to use compiler intrinsic version by adding /Oi to
compiler option and removing the #include <malloc.h>
I have a compiler error now:
error C3861: '_alloca': identifier not
found d:\Dev\Sp07-1\XSp\_scc\VirtualAudioCable\Originals\VAC\drvutil s.cpp
1630

However _alloca is declared as available on all platform :
http://msdn2.microsoft.com/en-us/library/5704bbxw.aspx

Nov 22 '06 #2
Hi Michael,

I also try this option but it contains only function definition and I
still have the error at link.

This function should be [part of the compiler and it's not the case,
the only way to eliminate this error is to include library msvcrt.lib
or libcmt.lib. Which are conflicting with some of my driver
declaration. I have open a support request at Microsoft. I'm currious
to know what there propose.

Nov 29 '06 #3
This function should be [part of the compiler and it's not the case,
the only way to eliminate this error is to include library msvcrt.lib
or libcmt.lib. Which are conflicting with some of my driver
declaration. I have open a support request at Microsoft. I'm currious
to know what there propose.
Hi, you should ask this question in development.device.drivers, or in the
NTDEV group on www.osronline.com
That is there device driver experts hang out.

Btw, I hope you are not using the VC2005 compiler because you will not get
support.
Microsoft only supports you when building device drivers using the DDK. If
you use VC2005 you are on your own.

Device driver experts are also unlikely to (want to) help you, because as a
rule, they really hate it when you use a non-standard build environment. It
can to introduce subtle differences in behavior.

--

Kind regards,
Bruno van Dooren
br**********************@hotmail.com
Remove only "_nos_pam"
Nov 29 '06 #4
I have the answer from MS.

It's a documentation issue. There is mentioned _alloca function:
"The _alloca and setjmp functions are always generated inline; this
behavior is not affected by /Oi."

The "real" intrinsic function are documented here
http://msdn2.microsoft.com/en-gb/library/tzkfha43.aspx

Dec 4 '06 #5

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

Similar topics

1
by: Glenn Venzke | last post by:
I'm trying to write/compile a class that (1) accesses all the intrinsic ASP.NET objects (2) Uses Server.Transfer to redirect a user back to a log in page if a session has expired. I've gotten...
9
by: Gino Elloso - Philippines | last post by:
Hello, I made a webpage ( @ Geocities Free Webpages ) that contains a mousetrail clock script. I simply copied the script ( including all html tags ) exactly as it was from a source webpage (...
12
by: Santiago de Compostela | last post by:
Hi The following program doesn't compile on MS VC++ or Bloodshed Dev-C++ #include <iostream> int strlen(const char *in) {
3
by: MLH | last post by:
I make API calls to the sndPlaySound function, something like this... XX% = sndPlaySound(msound, MyParm) Several predefined system constants (or API intrinsic constants) have been recommended...
9
by: MLH | last post by:
Would the following work if placed in a form module rather than a global module? Declare Sub InternetCloseHandle Lib "wininet.dll" (ByVal hInet As Long)
3
by: George M. Garner Jr. | last post by:
Is there an intrinsic to wrap the bswap x86 instruction. I have written a function to do this with inline assembler but I am wondering if an intrinsic wouldn't be a better solution. Regards, ...
0
by: albean | last post by:
I I have a number of VB COM components used in ASP pages that access some intrinsic ASP objects. Basically we would get the context from COMSVCSLib and from there get the ASP Request and Response...
6
by: nickdu | last post by:
I usually try to stay away from _alloca(). However, I'm considering using it for a logging function. Our current logging function maintains its own buffer which it grows to fit the string being...
13
by: Ari Krupnik | last post by:
Image.width returns the width of an image as it is displayed on a browser page, which may be different from the image's intrinsic size if the 'img' element had a 'width' attribute specified. Is...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
0
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...
0
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...

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.