|
Hi
I created an event With the Following parameters CreateEvent(NULL,FLASE,FALSE,NULL);
From what I understand the third parameter says what the initial state of the object is
Signaled or NON signaled if it is FALSE non signaled the first time I executed the
WaitForSingleObject my thread will return and in addition set the object to signaled
Meaning all threads will have to wait till I call SetEvent
Thing is the first time around the executing thread never returns
|
|
|
|
|
I think you've got the meaning of "signalled" the wrong way around. The wait function will return only when the event is signalled. An auto-reset event will automatically reset the event to non-signalled when it returns, and manual reset event will not. Use the SetEvent to release other threads, or the ResetEvent to block other threads.
Think of the event of some operation that has to happen in your code. Other threads need to wait for that operation to complete. Once it has been completed, you signal the other threads that it is ok to proceed.
Cheers,
Mick
------------------------------------------------
It doesn't matter how often or hard you fall on your arse, eventually you'll roll over and land on your feet.
|
|
|
|
|
Okay how about the second parameter to CreateEvent if that is FALSE does that mean that after
a signal'ed event returns right away from WaitForSingleObject Windows will Automatically turn the event to NON signalled
|
|
|
|
|
Yes, it does. bManual = FALSE means that it is an Automatic ResetEvent after a wait operation.
Cheers,
Mick
------------------------------------------------
It doesn't matter how often or hard you fall on your arse, eventually you'll roll over and land on your feet.
|
|
|
|
|
Hello experts!!!
There is a component for Visual Studio C ++ "assimp" (Open Asset Import Library).
With the help of "assimp" on the screen built scene with a 3D object.
Can I with the help of "assimp" export the scene image with a 3D object into graphical file, for example BMP or JPEG?

|
|
|
|
|
Looking at the site, the package it already does that via it's viewer (open3mod).
They call it a "screenshot" although more technically it is a render. They are inserting a camera position against the 3D model in a 3D space and rendering what would be seen. You would have to do the same.
|
|
|
|
|
I like to live dangerously so I'll risk forum or administration wrath with this one.
Found this Linux application which supposedly helps with file linking.
I have created using pkg_config - "opencv.pc" file and added it in -L - add library path.
It does contain OpenCV libraries , I verified that, but linker complain of "incorrect extension ".
However, I cannot find in any pkg_config related sites HOW to actually tell GCC linker to use this "opencv.pc".
Also this pkg_config info is not that new. There is no open access user forum which makes me suspicious if this "packaging libraries " is a good and useful tool.
Please, if this post is not in line with CodeProject policies just ignore it or let me know and I'll delete it.
Cheers
Vaclav
|
|
|
|
|
I think you are making life more complicated than it needs to be. This is just another utility that you will need to learn ... see pkg-config(1) - Linux man page[^].
|
|
|
|
|
... or enter "man pkg-config" at a shell prompt.
|
|
|
|
|
The 'man' command is the first thing one needs to learn when working on Unix/Linux.
|
|
|
|
|
Thanks for lectures. I 'll let you know HOW to actually tell GCC linker to use this "opencv.pc". when I answer my own question.
Cheers
Vaclav
|
|
|
|
|
No lectures, just advice. Unfortunately your question is not detailed enough for a better answer.
|
|
|
|
|
Vaclav_Sal wrote: However, I cannot find in any pkg_config related sites HOW to actually tell GCC linker to use this "opencv.pc".
The linker doesn't use .pc files. You must use the pkg-config command to generate the options for the compiler or linker. Use command substitution[^] to embed the pkg-config command on the linker command line or to store the output in a variable.
|
|
|
|
|
Thanks for actually answering my question without an additional commentaries.
Appreciate that.
I have also found that I could include the pkg_config command(s) in "make" file.
Of course I need to figure out how to either modify the "make" automatically build by IDE or learn how to build my own.
Cheers
Vaclav
|
|
|
|
|
Still struggling with the issue
Here is exact syntax I have used - it suppose to "print" , I assume substitute, the libraries in package ( opencv ) to the linker as -l options.
It does not matter if the options are --libs opencv or opencv --libs - which is expected.
"$(pkg-config opencv --libs)"
Here is partial liker output
make all
Building target: TEST_1
Invoking: GCC C++ Linker
<b>g++: error: missing argument to ‘-l’</b>
g++ -L/usr/local/lib -o "TEST_1" ./src/TEST_1.o <b>-l""</b>
make: *** [TEST_1] Error 1
makefile:45: recipe for target 'TEST_1' failed
I have tried different format / syntax and "$(command)" is correct per the link you have provided. From the output it is notable that no -l files were included - -l"".
I do not know what else can be wrong. The command does not expands to anything linker can use and it should look as terminal output.
jim-desktop $ pkg-config opencv --libs
-L/usr/local/lib -lopencv_shape -lopencv_stitching -lopencv_objdetect -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_video -lopencv_photo -lopencv_ml -lopencv_imgproc -lopencv_flann -lopencv_viz -lopencv_core
I have asked in several forums and all I am getting is how to add -L/-l options MANUALLY to the linker options.
BTW including ":" before the manually inserted file name specifies to the pkg-config to use library file WITHOUT using the file extension. Nice to know but does not solve my issue.
Cheers
Vaclav
|
|
|
|
|
Hi All,
In my MFC project, some Text box should appear in UI for 32 bit builds and that is not appear for 64 bit builds.
For this I have added the following piece of code in Resource.h file
Resource.h:
#ifndef _WIN64
#define INCLUDE_32_BUILDS 1
#endif
#ifdef INCLUDE_32_BUILDS
#define IDC_GS_CMB_TYPE 5176
#endif
and the code in the resource file is:
#ifdef INCLUDE_32_BUILDS
LTEXT "Receiver Output Protocol :",IDC_STATIC,16,42,123,8
EDITTEXT IDC_GS_EDIT_TYPE, 150, 42, 84, 85, ES_AUTOHSCROLL | ES_READONLY
#endif
I want to show above text box for only 32 bit application and not in 64 bit application
I am able to compile the code successfully, but still I am able to see the above text in UI for 64 bit application. I think #ifdef INCLUDE_32_BUILDS is not working properly in resource file.
Please let me know how to make sure that the #ifdef INCLUDE_32_BUILDS work and the text box should not appear for 64 bit application?
Thanks,
Lakshmi.
modified 17-Nov-16 23:35pm.
|
|
|
|
|
You need to ensure that your .rc file has access to that defined value. Either add it via a #include d header file, or in your project properties.
|
|
|
|
|
Expanding Richards answer the resource compiler does not have access to the standard C preprocessor predefined macros because you haven't included any of the standard headers
_WIN64 whilst a standard predefined macro in the C preprocessor is not predefined in the resource compiler. So your #ifdef _WIN64 is failing because _WIN64 doesn't exist to the resource compiler.
And trying to do so you usually need to use RC invoke to go around some stuff the header files contain:
RC with predefined Macros (Windows)[^]
So Resource compiler starts with exactly one macro RC_INVOKED and includes only macros that are included in it's include section. Once upon a time there was an undocumented _WIN32 but I think even that has gone these days.
So the more usual trick is to use the build options tab on the resource file to preset a define. On your resource build you have configurations and you can add predefined macros.
Config Properties -> Resources -> General In the macros tab add _WIN64 manually to the 64 bit build. Add _WIN32 to the 32 bit build tab.
In vino veritas
|
|
|
|
|
Thanks Leon. It worked.
Thanks,
Lakshmi
|
|
|
|
|
I hope this forum will forgive me to ask this, but...
CMake wants to have line added
<b><b><b></b></b>cmake_minimum_required(VERSION 3.5)</b>
after which opencv.sh complains
./opencv.sh: line 1: syntax error near unexpected token `VERSION'
./opencv.sh: line 1: `cmake_minimum_required(VERSION 3.5)'
I am enclosing my crude log to illustrate some details.
And no, I do not know how to change CMake options to remove this version requirement and still would like to know the "syntax" error I made.
pre lang="text"><pre lang="text">CMake Error at traincascade/CMakeLists.txt:2 (ocv_check_dependencies):
Unknown CMake command "ocv_check_dependencies".
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
<b><b><b></b></b>cmake_minimum_required(VERSION 3.5)</b>
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
Configuring incomplete, errors occurred!
after adding
CMake Error at traincascade/CMakeLists.txt:2 (ocv_check_dependencies):
Unknown CMake command "ocv_check_dependencies".
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.5)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
Configuring incomplete, errors occurred!
after adding
Cmake complains
im-desktop $ ./opencv.sh
./opencv.sh: line 1: syntax error near unexpected token `VERSION'
./opencv.sh: line 1: `cmake_minimum_required(VERSION 3.5)'
jim@jim-desktop $
</pre></pre>
Cheers
Vaclav
|
|
|
|
|
./opencv.sh: line 1: syntax error near unexpected token `VERSION'
./opencv.sh: line 1: `cmake_minimum_required(VERSION 3.5)'
The error ir pretty clear:
There is a syntax error in line 1 of the file opencv.sh. The .sh extension indicates that it is a shell script file which is processed by the shell (probably bash) which will off course know nothing about CMake commands.
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.5)
Here CMake complains about a missing command in the file CMakeLists.txt.
So you have to add the command to the CMake file CMakeLists.txt.
|
|
|
|
|
It is not about clarity of the error - I am asking WHAT is the syntax error.
I have "cut and paste" the required line from the CMake output.
Do I need to define "token" VERSION" ?
How?
|
|
|
|
|
You are missing the point it is complaining about there is no cmake_minimum_required(VERSION 3.5) in CMakeLists.txt
You said you cut and paste "cmake_minimum_required(VERSION 3.5)" but did you put it into CMakeLists.txt, you didn't put in the script file per chance??????
I am not being condescending here but I need to check, you do get the script file has nothing to do with cmake. Like you we are a bit perplexed because it's step 1 of any cmake file.
Usually the first two lines of CMakeLists.txt are
make_minimum_required (VERSION x.x)
project (_MY_PROJECT_NAME_)
_MY_PROJECT_NAME_ being what you want to call the project
I am sorry for having to ask and check all these really beginner stuff but there is something strange going on.
Whatever the situation I suggest you simply open up a command line window, change to the directory and manually type in the cmake command (so we have any scripts out of the way) and we can see the exact screen spit from cmake itself without the script which is just another source of possible error.
Assuming we pass all this basic stuff there is left one other possibility that your first makelist pulls other makelists and those later makelists have version requirements but that is not the sort of error you seem to be getting. The problem is the exact messages change depending on version CMake and exact OS type so I will leave it as a possibility.
In vino veritas
modified 17-Nov-16 0:42am.
|
|
|
|
|
The syntax error is:
The program processing the file is not able to parse the command cmake_minimum_required(VERSION 3.5) .
The reason is:
You have pasted the command into the file opencv.sh which is processed by the shell (the Unix command line interpreter; see Unix shell - Wikipedia[^] ).
But it should be pasted into the file CMakeLists.txt which is processed by CMake.
The solution (see my initial answer):
Quote: So you have to add the command to the CMake file CMakeLists.txt. instead of opencv.sh.
|
|
|
|
|
First use of CMake, went relatively OK
I did run CMake to build OpenCV , build it with "warning":
CMake Warning at CMakeLists.txt:1250 (message):
The source directory is the same as binary directory. "make clean" may
damage the source tree
What is "source directory" ?
I did messed up some of the "destinations" , but before I'll try it again like to have an answer about "source directory".
Thanks
Cheers Vaclav
<b>The "source directory" CMake asked for was directory WERE CMakeLists.txt file is.</b>
-- modified 18-Nov-16 10:33am.
|
|
|
|