Tag Archives: C

Mount windows NTFS partition under Linux

Mounting the Windows NTFS partition under Linux

How it works: Use the mount command to mount the partition under Windows into a directory under Linux.

1.uname -r View the current Linux kernel version.

2. Go to
http://www.linux-ntfs.org/ Download the same NTFS patch as the kernel version.

3. Install patch: RPM – the ivh kernel – the module – NTFS – 2. 7.0.x.x – x – 2.1.20-0. Rr. 4.10 i686. RPM

4. Use fdisk-l to view the partition information of the hard disk.

5.
5.
5.
5.
5.
5.

: mkdir/MNT /c corresponds to the C disk

mkdir/MNT /d corresponds to D disk

mkdir/MNT /e corresponds to e disk

6.mount -t NTFS /dev/xxx/MNT /x
6.mount -t NTFS /dev/xxx/MNT /x
6.mount -t NTFS /dev/xxx/MNT /x

: mount /dev/hda1/MNT /c

the mount -t NTFS/dev/hda5/MNT/d

the mount -t NTFS/dev/hda6/MNT/e
 

Vs2015 + PCL. 1.8.1 (win10) environment configuration

This weekend did nothing, from Friday night to install the PCL library, the whole is really want to cry, again and again, every time there are dozens of even hundreds of new problems, obviously in accordance with the previous install version 1.8.0 method, I do not know what is wrong. Then on Saturday night to give up to go back to sleep, do not know what they have done, suddenly good, even before 1.8.0 encountered VTK can not use the problem is also solved, happiness comes too TTTTTTTTTTT suddenly !!!!!!!!!
I have also looked at the installation tutorials of many blogs, although they are all similar, but who can guarantee that there may be a place that does not fit and cause problems. Suffice it to say, the way to get yourself installed successfully is the right way. Here is a record of my final successful installation process, for your reference.
Install pcl1.8.1
First, download the pcl1.8.1 installation package for installation, the installation package can be found on the Internet.
Here attached my links: https://pan.baidu.com/s/1-dPRLZ1a8Ktemo2EGXU-Sw extraction code: 66 rb. I have 64 bits here. Here 32-bit or 64-bit depends on how many bits your VS compiler has, not the operating system.
I am selecting the second option, automatically generating system variables, modifying the installation directory, and customizing the installation in C:\pcl1.8.1.

             

Solution of VS2008 unable to open GL / glaux. H header file

2011-04-15 wcdj
 
I don’t know why there is no OpenGL header file in SDK after VS2008. Here is a summary for this problem.
 
In Lesson 6 of learning Nehe’s texture mapping, I initially needed to use the header file containing gl/glaux. H, but found that I didn’t have this header file on my system. There are two header paths in the compiler that reference OpenGL:
C:/Program Files/Microsoft SDKs/Windows/v6.0 A/include/gl/gl h (the default)
C:/Program Files/Microsoft Visual Studio 9.0/VC/include/gl/glut. H (the new gl manually folder)

Googled the solution.

thod 1: Find the most used solution, but I do not have VS2003 or VS2005 installed on my system, so I cannot copy it.
I have been porting old openGL program to VS2008. I have solved the problem by copying the “include/gl/glaux.h” and “lib/glaux.lib” from the VS2005 Platform SDK located on “C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK” To the PlatformSDK of VS2008 located on “C:/Program Files/Microsoft SDKS /Windows/ V6.0a “


Based on the reply to https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1065518& SiteID=1, it looks like glaux. Lib is deprecated. Instead link to kernel32.lib, user32.lib, gdi32.lib and advapi32.lib


The easiest way to sort this out is to:
) Install Glut3.6 or newer as directed.
2>pen Visual Studio 2008 and create a new project
3) Cho>C ++ -Empty solution
4) Import Al> the files from your previous OpenGL project
5) delete all headers i.e.
#include < gl/glu.h>
#include < gl/gluax.h>
and any other GL headers
6) then replace with #include < gl/glut.h>
7) recompile.

this worked for all of my 2003 & 2005 Solutions.

thod 4: Download Missing Files.
1: download the source CSDN download
OpenGL installation package download required documents:

http://d.download.csdn.net/down/2560229/ssagnn23 include:
GL. H GLAUX. H GLU. H glut.
H GLAUX. LIB GLU32. LIB glut32. LIB glut. LIB OPENGL32. LIB
GLAUX. DLL GLU32. DLL glut32. DLL glut. DLL OPENGL32. DLL

VS2008 without GL. H, H, glu.h, GLAUX. Lib, glu32.lib, opengl32.lib.

1) Copy GLUX. DLL, GLUT32.DLL, GLU32.DLL and GLU32.DLL to C:/WINDOWS/system32, which should already have OpenGL32.DLL and GLU32.DLL.
. (2) the GL H, GLAUX. J H, glu. H, glut. H a copy to the C:/Program Files/Microsoft Visual Studio 9.0/VC/include/GL
. (3) the GLAUX LIB and Glu32. LIB, glut32. LIB, Opengl32. LIB, C:/Program Files/Microsoft Visual Studio 9.0/VC/lib

br>>
nehe SRC – cn – nehe OpenGL tutorials Chinese version and the code download

http://code.google.com/p/nehe-src-cn/downloads/list nehe OpenGL tutorial Chinese version and the code download

http://www.yakergong.com/nehe/ provides each Lesson # sample code and the file you need.

4 according to the method, after downloading the file and configure, recompile, without the previous mistakes, documents found, but the following mistakes.
error C2664: “auxdibimageLoadw” : Cannot convert parameter 1 from “char *” to “LPCWSTR”
is is because I am building a Unicode character set based project, so I want to use wide characters. It is also possible not to use Unicode character sets in the property page ->; Configure properties ->; You can modify it in general. Select not to use the Unicode character set here; that is, select Unset. And then recompile it. OK!

br>>

reference:
missing glaux. H in v6.0 a SDK?

http://social.msdn.microsoft.com/Forums/en/windowssdk/thread/b66e5f7a-91f6-4dbe-b388-0c131008b08f project under VS2003 under VS2008 compilation, however, Can’t find the gl/glaux. H

http://topic.csdn.net/u/20070930/15/6a900f21-8e41-4325-862f-f6df3a425f36.html VS 2008 OpenGL configuration

http://lujun5918.blog.163.com/blog/static/287227712011013114410553/ Load images generated texture opengl program
http://topic.csdn.net/u/20070823/19/4497cb18-be2a-464f-ad20-b12191a61b26.html
 
 
 
 

C language program running results flash back how to do

Learn to compile C language friends may encounter such a problem, program debugging when there is no error, but when running the results will find that the program results flash back, resulting in no results. The following solutions are given for such problems.
Take the simplest program, for example

} getchar();} getchar(); Can. It is important to note that this approach is not suitable for all programs, but we will look at the second approach next.

Method 2: & lt; 1> Start by adding the header file #include <; stdlib.h> As shown in figure
& lt; 2> Then write a line at the end of the program’s main function (system(“pause”));

Obviously, when the first method does not work, the second method can be used, and it works in all cases.
 
 

Three solutions to flash back of program running result box under vs

When writing C/C ++ programs in VS, the result box will always flash away, and you can’t see the results of the program. This is really annoying, so here are three ways to solve it
 
Method one:
In the return 0; Before the statement, add a getchar(); In this case, getchar will wait for input, and the result box will display the result of the program.
 
As shown in the figure below:


 
Method 2:
Add the statement system(“pause”) at the end of the program; , plus the header file #include< stdlib.h> “, which will display the results after running them and prompt you to press any key to continue.
 
As shown in the figure below

 

 
Method 3:
To modify the project configuration, right-click on the project, select Properties from the right-click menu, and then select “Configuration Properties –>” from the list to the left of the pop-up dialog. The linker – & gt; System “, and then in the list on the right, in the first “subsystem” value, select “Console (/SUBSUSTEM:CONSOLE)”
As shown in the figure below:



 
 
From:
https://blog.csdn.net/rannianzhixia/article/details/66968219?locationNum=6& fps=1

Causes and solutions of black frame flashback after debugging visual studio 2017

After debugging, the black box flashes back, and the following error is displayed.

The reason:
Debugging mode at this time, the program will not be suspended, so the window will not continue to open state. So when the black box appears, it goes away.
Solution logic:
Causes the program to pause in a wait state.
Some compilers, such as Visual 6.0, perform this function automatically at the end of code execution.
Solutions:
Method 1: As shown in Figure 1, add a statement before the return statement: system (” pause “); System (” Pause “); Call the system pause command.
,
Method 2: getchar () before the return statement;

Either of the above methods can be used.
So it runs successfully.

The solution of configuring OpenGL in vs2017

I’ve just tried to mesh the sphere using OpenGL in the last two days. The solution to configure OpenGL in VS2017 is as follows:
Running is the link of https://blog.csdn.net/xdg_blog/article/details/52864872 code, the following need library file is also for this code, need to add other library method.
 
1. Download glut in the website, website link: https://www.opengl.org/resources/libraries/glut/.

2. The downloaded file is as follows:

A. Put the two lib files Glut.lib and Glut32.lib into the directory:
D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\ Lib \x86
B. Put Glut. DLL and Glut32.dll into a directory: C:\Windows\syswow64
Under 64-bit Windows: 64-bit EXE and DLL are in the directory C :\ Windows \ System32, and 32-bit EXE and DLL are in the directory C :\ Windows \ SYSWOW64. So note that registering a 32-bit OCX or DLL on a Win64-bit system requires copying the 32-bit OCX or DLL to the C :\ Windows \syswow64\ directory. C :\ Windows \ SYSWOW64 \ REGSVR32 XXXXXXXX. OCX or DLL.)
C. In the directory: D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\ Include, create a new folder GL and put the header file in GL folder.
3. In VS2017, the configuration is as follows. First create a new C ++ project, then open the toolbar: Project ->; Properties:
A. general – & gt; Character set – & gt; Is not set

B. Linker ->; Conventional – & gt; Add the library directory, add OpenGL library file directory and its own library file directory. Write the path where the two lib files are placed.
D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\ Lib
D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\ Lib \x86

C. Linker ->; Input – & gt; Attach dependencies. Add the individual lib files from OpenGL (Glut.lib and Glut32.lib are the only ones added here), separated by English keyboard semicolons.

Note: There are other ways on the web to set: linker ->; System – & gt; Subsystem – & gt; SUBSYSYTEM: WINDOWS. But I’ve tried setting this to not work, so just leave it unset by default. (Although I don’t know why ~
Finally all the way down to determine the configuration of good ~

Vc2010 configuring OpenGL environment

Glut32.Lib Glut32.dll and Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h Glut.h
2, the glut. H in the C:/Program Files/Microsoft SDKs/Windows/AA/Include/gl v7.0 directory; GLUT32. lib: C:/Program Files /Microsoft SDKS /Windows/ V7.0a/lib Glut32.dll is placed in the C:/WINDOWS/system32 directory
3. Create a new empty project in VS2010 and select Win32 Console Project
 
4. Add a.cpp file to the project with the following contents:
# include “stdafx. H”
#include< gl/glut.h>
 
Void myDisplay (void)
{
GlClear (GL_COLOR_BUFFER_BIT);
GlRectf (0.5-0.5 f to 0.5 f, f, 0.5 f);
GlFlush ();
}
Int _tmain(int argc, _TCHAR* argv[])
{
GlutInitDisplayMode (GLUT_RGB | GLUT_SINGLE);
GlutInitWindowPosition (100, 100);
GlutInitWindowSize (400, 400);
GlutCreateWindow (” the first OpenGL program “);
GlutDisplayFunc (& amp; myDisplay);
GlutMainLoop ();
Return 0;
}
5. Set the IDE environment: project->; new Property-> Configuration propertites-> linker-> Input-> Additional dependencies
OpenGL32. lib GLUT32. lib, apply, confirm.
 
 
6. F5, Start Debugging, you should see a window with a white square in the middle.

The language of C__ FILE__ 、__ LINE__ And line

Original link:
 
http://hi.baidu.com/419836321/blog/item/fcf5ceec484681cfb31cb1f7.html
 
 
 
 

__FILE__ is used in C to indicate the filename of the source file in which the statement is written, for example (test.c) :

    #include < stdio.h> int main() { printf(“%s\n”,__FILE__); }

GCC compiler generates a.out. After execution, the output is:

test.c

Compiling results under Windows VC6.0 are as follows:

C :\ Documents and Settings \ Administrator \ Desktop \ Test.c

——————————————————————————————————————————————————————————————————– ————————————————————————–

__LINE__ in C is used to indicate the position of the statement in the source file. Examples are as follows:

    #include < stdio.h>

    main() { printf(“%d\n”,__LINE__); printf(“%d\n”,__LINE__); printf(“%d\n”,__LINE__); };

The program is compiled in Linux with GCC, in Windows VC6.0 under the compilation can pass, the execution results are:

7

8

9

__LINE__ can also be reset with the #line statement, for example:

    #include < stdio.h>

    # line 200 // specify the next row __LINE__ for 200 main () { printf (” % d \ n “, __LINE__); printf(“%d\n”,__LINE__); printf(“%d\n”,__LINE__); };

After compilation and execution, the output is:

202

203

204

——————————————————————————————————————————————————————————————————– —————————————————————————

GCC also supports __func__, which indicates the function, but this keyword is not supported in VC 6.0 under Windows, for example:

    #include < stdio.h> void main() { printf(“this is print by function %s\n”,__func__); }

The output result after compilation is

this is print by function main

Note # “line”, “__LINE__”, “a __FILE__” and “__func__” are case sensitive.

 

Installation of Ubuntu + VTK

Sudo apt-get install libvtk5.2 libvtk5-qt4-dev sudo apt-get install libvtk5.2 libvtk5-qt4-dev
Different Ubuntu versions support different versions of VTK, here is Ubuntu 10.04, followed by QT4 support.
 
two
1. Download source code
Address: http://www.vtk.org/VTK/resources/software.html
The version is the latest
2. Unzip
The tar ZXVF… .
A VTK folder is created in the current directory
3. Install OpenGL
apt-get install mesa-common-dev libgl1-mesa-dev
4. Install ccmake
sudo apt-get install cmake-curses-gui
5.cd VTK
6.mkdir VTK-build
7.cd VTK-build
8.ccmake .. /
9. Press C to start the configuration and set VTK_USE_QT to ON. BUILD_SHARED_LIBS is set to ON
10. Press T to enter detailed setup, then locate QT_QMake_Executable, press ENTER to modify, and change QMAKE
The path of the input, for example:/home/zhang/QtSDK/Desktop/Qt/4.8.0/GCC/bin/qmake. Confirm and press Enter to exit the modification.
11. Press C to check the Settings.
12. Confirm by C.
13. Press G to generate makefile and exit CCMAKE automatically
14.make
15.sudo make install.
 
Add (.pro file) to the project
INCLUDEPATH =/usr/local/include/VTK to 5.10
LIBS + = L/usr/local/lib/VTK – 5.10 \
 
5.2
INCLUDEPATH =/usr/include/VTK to 5.2
LIBS += -L/usr/lib \
Select as needed at the end
-lvtkCommon -lvtksys -lQVTK -lvtkViews -lvtkWidgets -lvtkInfovis -lvtkRendering -lvtkGraphics -lvtkImaging -lvtkIO -lvtkFiltering -lvtklibxml2 -lvtkDICOMParser -lvtkpng -lvtkpng -lvtktiff -lvtkzlib -lvtkjpeg -lvtkalglib -lvtkexpat -lvtkverdict -lvtkmetaio -lvtkNetCDF -lvtksqlite -lvtkexoIIc -lvtkftgl -lvtkfreetype -lvtkHybrid
 
Command line compilation
G + + – o Cylinder – O3 – I/usr/include/VTK – 5.2 – L/usr/local/lib – Wno – deprecated – lvtkCommon lvtkDICOMParser – lvtkexoIIc – lvtkFiltering – LVTKFTGL – lvtkGenericFiltering lvtkGraphics — lvtkHybrid -lvtkImaging -lvtkIO -lvtkNetCDF -lvtkRendering -lvtksys -lvtkVolumeRendering -lvtkWidgets Cylinder.cxx
 
 

VTK (1) — compile and install

Project environment: QT+VTK+ CMAKE


The file packages used in this article are:

    visual studio 2013
    DXSDK_Jun10
    Cmake – 3.3.2 rainfall distribution on 10-12 – win32 – x86
    Qt5.7
    Qt – v – system.addin – 1 – opensource
    TBB (Thread Building Blocks)
    VTK 7.1

1. Install Visual Studio 2013 Community

    Download https://www.visualstudio.com/downloads/download-visual-studio-vs
    Select Visual Studio 2013 ->; Community 2013
    Download and install community default locations and default optional features (takes about half an hour to complete)