Using the visual studio 2012 command tools (i.e. in the 'native tools command prompt' command console) I have run vcvars32.bat, and navigated to *c:\program file(x86)\Microsoft Research\Detours Express 3.0*.
On running nmake in this directory, it begins building successfully, however it then exits with the error:
cl /nologo /nologo /Zi /MT /Gm- /W4 /WX /Od /DDETOURS_BITS=32 /I..\..\include /Gs /DDETOURS_X86=1 /DDETOURS_32BIT=1 /D_X86_ /DDETOURS_OPTION_BITS=64 /Fdobj.X86\vc.pdb /Foobj.X86\member.obj /c member.cpp
member.cpp
member.cpp(88) : error C2440: 'type cast' : cannot convert from 'void (__thiscall CMember::* )(void)' to 'PBYTE &'
Reason: cannot convert from 'overloaded-function' to 'PBYTE *'
There is no context in which this conversion is possible
member.cpp(90) : error C2440: 'type cast' : cannot convert from 'void (__thiscall CDetour::* )(void)' to 'PBYTE &'
Reason: cannot convert from 'overloaded-function' to 'PBYTE *'
There is no context in which this conversion is possible
// error repeated member.cpp lines 105, 120, 122.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
Not sure how to move on with this error. I also attempted to:
set DETOURS_TARGET_PROCESSOR=X86
and then "nmake clean" followed by a new "nmake" - however this results in the same error.
as specified in the title, I am building with vs2012, on a windows 8.1 box (x64).
thank you
ok, so i solved it, so i thought i'd post the answer if anyone else finds it useful.
I've done this by trial and error, so I would still like someone to come on and explain why/what this error is and what caused it etc.
however, here are the changes i made to get it to compile:
#if (_MSC_VER < 1310)
pfTarget = CMember::Target;
pfMine = CDetour::Mine_Target;
Verify("CMember::Target", *(PBYTE*)&pfTarget);
Verify("*CDetour::Real_Target", *(&(PBYTE&)CDetour::Real_Target));
Verify("CDetour::Mine_Target", *(PBYTE*)&pfMine);
#else
//Verify("CMember::Target", (PBYTE)(&(PBYTE&)CMember::Target));
//Verify("*CDetour::Real_Target", *(&(PBYTE&)CDetour::Real_Target));
//Verify("CDetour::Mine_Target", (PBYTE)(&(PBYTE&)CDetour::Mine_Target));
pfTarget = &CMember::Target;
pfMine = &CDetour::Mine_Target;
Verify("CMember::Target", *(PBYTE*)&pfTarget);
Verify("*CDetour::Real_Target", *(&(PBYTE&)CDetour::Real_Target));
Verify("CDetour::Mine_Target", *(PBYTE*)&pfMine);
#endif
my changes are in the 2nd half 'else' statement, original code is commented out.
For each error (relevant line numbers in original question) - I commented out what was there, copied and pasted from the 1st half "if" section", but changed from "pfTarget = CMember::Target;" to "pfTarget = &CMember::Target;" (based on instruction from the compiler).
seems to be two different issues, first taking the wrong path in the if/else block (_MSC_VER supposed to be set somewhere and isn't?) and secondly the required change from CMember::Target to &CMember::Target.
thanks
The solution provided by wibble didn't work for me but since the compiler errors are only occurring when compiling the samples (after MS Detours compiled successfully), the errors aren't important anymore if you just want to use the library.
Related
I'm trying to build a number of solutions from a cmd file using command lines to handle the whole build
this is the line that builds the solution:
for /f %%i in (%CFG%\bld.lst) do set OUT= %%i Release %REBUILD%& call :out & C:\"Program Files (x86)"\"Microsoft Visual Studio 12.0"\Common7\IDE\devenv.exe %%i %REBUILD% Release >>%LOG%
the solutions are in (%CFG%\bld.lst)
if I add error catching as in:
if errorlevel 1 set OUT= Failed to build %%i Release & goto :error_term at the end of the line the build crashes
if I don't then the eventviewer shows me this error:
The description for Event ID 0 from source VSTTExecution
cannot be found. Either the component that raises this event is not
installed on your local computer or the installation is corrupted. You
can install or repair the component on the local computer.
If the event originated on another computer, the display information
had to be saved with the event.
The following information was included with the event:
(devenv.exe, PID 2004, Thread 1) UIContextHelper.SetUIContext: The call to IVsAggregatableProject.GetCmdUIContextCookie failed. Error code: -2147467259
the message resource is present but the message is not found in the string/message table
if I build each of the solutions from VisualStudio the solution builds correctly
I should mention some of the projects where written in VS 2010 and some in VS 2013
it's turning my hair grey. HELP!
Danieli
Error 1 error MSB4018: The "MIDL" task failed unexpectedly.
System.TypeInitializationException: The type initializer for
'Microsoft.Build.Utilities.FileTracker' threw an exception. --->
System.IO.FileNotFoundException: The system cannot find the file
specified. (Exception from HRESULT: 0x80070002) at
System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32
errorCode, IntPtr errorInfo) at
System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32
errorCode) at
Microsoft.Build.Shared.NativeMethodsShared.ThrowExceptionForErrorCode(Int32
errorCode) at
Microsoft.Build.Shared.NativeMethodsShared.GetShortFilePath(String
path) at Microsoft.Build.Utilities.FileTracker..cctor() --- End of
inner exception stack trace --- at
Microsoft.Build.CPPTasks.TrackedVCToolTask.ComputeOutOfDateSources()
at Microsoft.Build.CPPTasks.TrackedVCToolTask.SkipTaskExecution() at
Microsoft.Build.Utilities.ToolTask.Execute() at
Microsoft.Build.CPPTasks.TrackedVCToolTask.Execute() at
Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at
Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext()
C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets 1179
Is this problem affecting all projects?
I had similar problem when porting code from older version of VS. Form my experience the most errors are generated because paths. I do not remember details but using output paths explicitly (done in older versions) creates problem since project conversion mechanism tries to use macros and as a result in empty, wrongly formatted paths.
My advice is to verify all settings pertaining to output. Make sure OutputPath, TargetDir and others are set properly. Try changing settings and use to inherit from parent.
Create empty project of the same type and compare properties of both.
I have always used erlang stdlib library zip:unzip/1 successfully. Last night i hit a bar with this error:
E:\WimaxStatsParser-1.1>erl
Eshell V5.9.2 (abort with ^G)
1> zip:unzip("e:/WimaxStatsParser-1.1/in/SomeZipFile.zip").
{error,bad_central_directory}
2>
Some one help explain the cause for this ? and how i get around it ?
ADDITIONS
I got some other error on another file: {error,bad_eocd}. Please explain this as well.
I am not able to reproduce your problem with the information you give. There are 2 functions that may send this error:
get_cd_loop/5 and get_name_extra_comment/4 in stdlib-1.18.2/src/zip.erl .
it should be easy to debug
copy the file zip.erl, zip.hrl, file.hrl in a working directory,
compile with debug_info option, you will get the error message "Can't load module that resides in sticky dir", leave the VM
copy zip.beam in the stdlib.../ebin
restart the VM in the working directory, you can now add breakpoint in the zip.erl source.
BR
Pascal.
I want load resources from c++ code. And try repeat this way. But when i try build it, i get:
E:\Android\Samples\android-ndk-assets\project>e:\Android\android-ndk-r8b\ndk-build
Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
Gdbsetup : libs/armeabi/gdb.setup
"Compile thumb : png <= pngrtran.c
jni/libpng/pngrtran.c: In function 'png_do_expand':
jni/libpng/pngrtran.c:3790:1: internal compiler error: in reload, at reload1.c:1061
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [obj/local/armeabi/objs-debug/png/pngrtran.o] Error 1
I just ran into this problem as well. Another workaround is to build the library as ARM code instead of Thumb code by adding the following line to your makefile:
LOCAL_ARM_MODE := arm
There should be no problem using ARM mode... ARM instructions require twice the space of Thumb instructions but are also much more sophisticated and capable of accomplishing a lot more in a single instruction, so depending on the cleverness of the compiler the resultant code may be bigger or smaller as well as more efficient or less efficient, but should execute with the same results.
I had the same error in android-ndk-r8b.
Looks like the bug in GCC. Do you submit bug report already?
I found the code which make error:
if (*(sp - 5) == red_high &&
*(sp - 4) == red_low &&
*(sp - 3) == green_high && //this line make error
*(sp - 2) == green_low && //this line make error
*(sp - 1) == blue_high &&
*(sp ) == blue_low)
{
*dp-- = 0;
*dp-- = 0;
}
I have a similar error in android-ndk-r8b as well. It occurs when calling ndk-build with the NDK_DEBUG flag set:
ndk-build NDK_DEBUG=1 <--- error
Try setting the NDK_BUILD flag to 0. It should compile. Of course it won't be debuggable :(
ndk-build NDK_DEBUG=0 <--- no error
When I'm trying to package a midlet with obfuscation, the following is displayed on the output window:
pre-init:
pre-load-properties:
exists.config.active:
exists.netbeans.user:
exists.user.properties.file:
load-properties:
exists.platform.active:
exists.platform.configuration:
exists.platform.profile:
basic-init:
cldc-pre-init:
cldc-init:
cdc-init:
ricoh-pre-init:
ricoh-init:
semc-pre-init:
semc-init:
savaje-pre-init:
savaje-init:
sjmc-pre-init:
sjmc-init:
cdc-hi-pre-init:
cdc-hi-init:
nokiaS80-pre-init:
nokiaS80-init:
nsicom-pre-init:
nsicom-init:
post-init:
init:
conditional-clean-init:
conditional-clean:
deps-jar:
pre-preprocess:
do-preprocess:
Pre-processing 0 file(s) into C:\Meljean's Files\NetBeansProjects\SampleApp\build\preprocessed directory.
post-preprocess:
preprocess:
pre-compile:
extract-libs:
Expanding: C:\Meljean's Files\LWUIT_1_4\lib\LWUIT.jar into C:\Meljean's Files\NetBeansProjects\SampleApp\build\compiled
do-compile:
post-compile:
compile:
pre-obfuscate:
proguard-init:
skip-obfuscation:
proguard:
Error: Expecting class path separator ';' before 's' in argument number 4
C:\Meljean's Files\NetBeansProjects\SampleApp\nbproject\build-impl.xml:427: Obfuscation failed with error code 1.
BUILD FAILED (total time: 0 seconds)
What am I going to do?
Problem might be in the WTK's installation dir.
Lets confirm this:
I guess you are using WIN SYSTEM
I guess your WTK is installed at the path where space comes inbetween.
like for ex : c:\program files\ [space between program & files]
I would suggest you to install WTK on non space dir like c:\WTK
Let me know if this is not the case.