Sure but there isn't much to those two they are just followed by a folder path string for the library directory or the include directory.
For header files GCC uses 4 default directories in a set order, the name of those directories is set when the version of GCC.EXE was created. So I can't tell you what they are because it depends on versions, CPU etc. However you can get them back out to screen with a command
I don't do a lot with libraries and from what I know there are 2 default directories in a set order again set at compile time of the linker executable ld.exe and again it has a command to display them
Your commands above change the user directories and you can check what is happening by inserting your command line and putting -v at end and you can see what it changes.
this is my first usage of Eclipse and I am in "GUI" stage so far.
The problem is little too much for me.
First I used install.sh script for OpenCV and added "library search path" (-L) /usr/local/lib.
Than I am suppose to choose the actual library to use via (-l) from pull down box - but there is no pull down , only text box.
After "updating " Eclipse to newest I noticed that when I type in search path /usr/local/lib it ends up as "/usr/local/lib" , but still no pull down box with the libraries. I must be missing some other option.
( I do wish I was better using command line, but I am not ready for it.)
So I added cv2.so under library add (-l) .
Now everything compiles , but linker stops because it cannot find the "cv2.so" - but I can see it in correct directory.
I still think my (-l) syntax is wrong.
I also tryied to link to OpenCV .../build/lib with same results . This "build/lib" was a product of CMake I found with OpenCV.
I think my biggest issue is - I do not understand how does "shared" library works in Elipse and which library search path is correct.
Have you checked at CDT Documentation[^]? The command line options for GCC will all be listed on the GCC website, but generally for linking you need the directories listed via -L (capital L), and the names of the libraries vie -l (small l). It is sometime since I have built an application on Unix/Linux so some features may have changed.
It would probably help if you showed your complete GCC command line (between <pre> tags for clarity.) and the exact error message(s) that you receive.
If the library file does not match this style (lib prefix, .a or .so extension, or you want to link dynamically to a .so file but there is also a matching .a file), you can pass the full name with path as argument like for object files (gcc recognises if the file is an object file or a libray).
I can't help much regarding Eclipse. But a quick search shows that there are two different sections where you can configure libraries:
The general library settings (C/C++ Properties - Folder - General - Paths and Symbols)
The project and tool specific settings (C/C++ Properties - Project - Build - Settings - Tool Settings - Linker)
The first should be used for system wide general library paths while the second is for project specific settings. To add an object or library with full path and name, enter it at Miscellaneous - Other objects.
Thanks to all, I really appreciate your help.
I did some more messing around and managed to input correct -L using / copying stuff affecting ALL projects. It sort off worked.
Than I did -l and typed cv2.so and the linker could not find it.
I'll try just cv2 without the so extension next.
AS I said , there is an GUI option to select "shared" files so as soon as I can get the linker to work I'll play with that.
I just rebuild another "buidl" using CMake again and will see what I messed up this time.
I'll cannot post the linker output until I have it back working after this new Make, sorry.
ld is the linker which collects all the object modules and libraries, and combines them into a new library, or an executable program. The library options to the linker are as follows: -L followed by a directory path, adds that directory to the list of locations to be searched for any additional libraries. -l add the undecorated library name to the list of libraries required by the object code. Note that libraries are commonly held in files which are named liblibraryname.suffix, where suffix is .a or .so. However the name specified on the option line should just be libraryname, i.e. no preceing lib and no suffix. And no directory paths.
So the options you should be using for /media/jim/OpenCL/OpenCV/build/lib/libopencv_flann_pch_dephelp.a should be something like:
To nail it down again:
The -l option requires a stripped library name without path, lib prefix, and extension!
When specifying all library pathes with the -L option, it must be just:
The linker (ld) will then search all directories specified with the -L option for matching files by building the full name from the path actually searched, appending the lib prefix, appending the name passed to the -l option, and appending the extension .a. If that fails for a path, it tries again with the extension .so.
I am new to this device driver development field.
I am asked to write a Windows device driver for capturing the kernel system calls for any particular Win32 API call.
There is one MFC Dialog based application which will call the Win32 API(Ex: CreateFile() with proper arguments)
At the same time the device driver should capture all the Kernel system calls which are called corresponding to the CreateFile() API. Those Kernel system call I need to display on the GUI of my appllication at real time.
Please share any Article or the guide me in acheiveing this.
A device driver is a software that accesses a device (some kind of real or virtual hardware). What you are looking for is called API hooking or API monitoring (just search the web for these terms combined with C++ and Windows).
I tried to explore WinAPIOverride.
Will this application display Kernel System calls? I doubt. It is showing some addresses in the call stack, but not the actual system calls name. Is is possible to get the names of the kernel system calls?
for example,If CObject has a "Hello" property,I can set it's value like this:
CObject* pObject = new CObject("switch");
but It is not very good enough,if I code like this:
here,I write the wrong property name ,but the code wouldn't generate any error at compile time.
1 there is a lot class defined by string
2 there may be a lot of objects defined by any class
3 there is a lot of properties for each object
My question is how could I avoid the above mistake at compile time?
Thank you all
I could check whether a property is in the set or not at run time.
but I want to check it at compile time.
I just write "Helloooooooo" instead of "Hello" by mistake.
I want to find out this mistake when I compile it.
The only way to provoke a compiler error would be to pass the knowledge of the full list of class properties to the compiler, at compile time. That would defeat the purpose of a generic class definition, and you could just as well define simple member variables instead.
This raises the question: where do your requirements come from, i. e the two requirements to define a generic class, and to force compile time errors when accessing an incorrectly labeled property? One of them has to go.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
There is a certain window, about which we know hDC & hWnd.
By the window is used function SwapBuffer(hDC). I understand that the double buffer, and that buffer contains a certain image that is drawn in the window.
Is it possible in any way to copy the contents of the buffer to a compatible Bitmap or Image for Saving it into graphic file format?
Last Visit: 31-Dec-99 19:00 Last Update: 7-Dec-23 0:26