Tag Archives: The solution

[solution] LD: warning: directory not found for option

In the process of IOS development, this problem is easy to be confused. Let’s have a break today.

Problems and Solutions

In short, there are two aspects to this problem.

The error is as follows, which means that it is an exception when querying Library .

"directory not found for option '-L/..."

resolvent:

Project – & gt; targets – & gt; build setting – & gt; library search paths

Delete the path inside

The error is as follows, which means that it is an exception when querying framework .

"directory not found for option '-F/..."

resolvent:

Project – & gt; targets – & gt; build setting – & gt; framework search paths

Delete the path inside

OK, it’s done.

The above problems have been solved. If you want to know more, you can continue to look down.

explain

Briefly speaking, library search paths and framework search paths .

Framework Search Paths

The explanation that can be found in official documents is as follows:

Locating Frameworks in Non-Standard Directories

If your project links to frameworks that are not included in any of the standard locations, you must explicitly specify the location of that framework before Xcode can locate its header files. To specify the location of such a framework, add the directory containing the framework to the “Framework Search Paths” option of your Xcode project. Xcode passes this list of directories to the compiler and linker, which both use the list to search for the framework resources.

Note: The standard locations for frameworks are the /System/Library/Frameworks directory and the /Library/Frameworks directory on the local system.

If the frameworks you refer to are not in standard locations, you need to set “framework search paths” in the configuration file of the project to specify search paths for compilers and linkers.

Library Search Paths

As for “library search paths”, there is no decent official document, but the content should be similar, but one is used to search framework , and the other is used to search Library .

Although it is said that, what is library and what is framework are still very vague.

However, we found some blogs to illustrate this problem, which are quoted below.

quote

Search paths settings in IOS development

In the development of IOS, we often encounter some path settings, such as the introduction of Baidu map SDK, copying projects to other computers, or reporting the error of library not found when multiple people develop at the same time, or introducing a third-party library, such as asihttprequest / retableview often reporting ? Include & lt; & gt; error, so we need to configure some search paths.

Framework/Library Search Paths

1、Framework Search Paths

The search path of the framework (. Framework bundles ) attached to the project is not widely used in IOS development. Generally, the framework built in the system is used for IOS development.

2、Library Search Paths

Xcode will automatically set the search path of the. A file to be dragged to the third-party library (. A files ) in the project. In order to facilitate transplantation or multi person collaborative development, it will usually be manually set.

For example, we will set the SDK of Baidu map as follows:

$(SRCROOT)/../libs/Release$(EFFECTIVE_ PLATFORM_ Name) , where $(srcroot) macro represents your project file directory, $(effective) _ PLATFORM_ Name) macro represents whether the current configuration is OS or simulator

Header Search Path

1. C / C + + header file reference

In C / C + +, include is a mutation instruction. When compiling, the compiler will replace the relative path with the absolute path. Therefore, the absolute path of the header file is equal to the search path + relative path.

(1) ? Include & lt; iostream. H & gt; : refers to the header file under the compiler’s class library path

(2) ? Include "hello. H" : the header file that refers to the relative path of the project directory

2、(User) Header Search Path

(1) header search path refers to the search path of the header file.

(2) User header search paths refers to the search path of user-defined header files

3、Always Search User Paths

If always search user paths is set to Yes , the compiler will first search the path configured by User header search paths . In this case, ? Include & lt; string. H & gt; , User header search paths the files under the search directory will cover the header files of the system.

reference material

    search paths settings in IOS development, IOS: clarify different search paths, IOS developer Library – including frameworks

Oracle 12C installation process related errors and Solutions

For the latest version of Oracle 12c database, we will encounter many problems in the process of installing and building the database. Here I will summarize the problems I encountered, and give the corresponding solutions.


1.ORA-12500: TNS: Listener could not start the dedicated server process
As the name implies, this type of problem relates to the associated listening service

sqlplus/noolog
nn /as sysdba
s>up
conn /as sysdba
startup
conn /as sysdba
startup ORCL database associated with the service, if not opened in the CMD check can be through the task manager in the service column to find the relevant service to open the restart, ORACLESSWrite – ORACLESService – Listener – ORACLEScheduler -, generally is one of the service and Listener did not start, the service can be resolved after the restart. To reconfigure listeners, open the Net Configuration Assistant and reconfigure existing listeners. Open the netmanager and check whether the user’s localhost port 1521 is not abnormal.


ORA-12560:TNS: Protocol oracer error
Error problems can be caused by three factors:
The listening service is not up.
Windows platform a operation as follows: Start – Program – Management Tools – Services, open the Services Panel, start OracleHome92TNSListener service. The database instance is not up.
Windows platform: Start – Programs – Management Tools – Services, open the Services panel, launch Oracle Server XXXX,XXXX is your Database SID. Registry problems.
regedit, then go to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0 and set the environment variable ORACLE_SID to XXXX. XXXX is your database SID. Or just to the right of My Computer, Properties — Advanced — Environment Variable — System Variable — New, Variable Name = ORACLE_SID, Variable Value =XXXX,XXXX is your Database SID. ORACLE_SID =XXXX. ORACLE_SID =XXXX. ORACLE_SID =XXXX.


3. Port occupancy problem
CMD to perform netstat ano | findstr searches in 1521 CMD perform netstat – ano find localaddress port
Query to the PID of the executing process
Taskkill /pid ** /f Open the services panel, find the running pid process and terminate it
End the process, and the occupied port will be released


4.ORA-12505 Listener refused the connection

    sid, user name, etc. Make sure it matches the database you created — restart your computer, release the used port 1521 — restart Oracle Develpoer — then run CMD, open a command prompt, and type LSNRCTL to run stop first. Then start — Open Resource Manager
    and run C:\ Oraclexe \app\ Oracle \product\10.2.0\ Server \BIN\tnslsnr.exe
    ey_local_machine \ System \CurrentControlSet\Services\ OraclexetNSListener
    I>Path key value: C: \ oraclexe \ app \ oracle \ product \ 10.2.0 \ server \ BIN \ TNSLSNR exe


    Temarily sorted out the above four problems, in general, to ensure that the associated monitoring service is normally opened, the server SID and other configurations are correct, can test the successful connection.

Illegalargumentexception error when adding cookie to response

Many people often make this mistake when learning cookies. Someone asked me this question today, so I will share with you the solution to this problem (there is no specific solution on the Internet).
error code:

Cookie cookie=new Cookie("name","value value2");
response.addCookie(cookie);

Error
Java. Lang. IllegalArgumentException: An invalid character [32] was present in the Cookie value
Error code:

Cookie c=new Cookie("name","value,value2");
response.addCookie(c);

Error:
Java. Lang. IllegalArgumentException: An invalid character [44] was present in the Cookie value

the exception can be seen that this problem belongs to the invalid parameters, looking at the back of the prompt content
the An invalid character [44] was present in the Cookie value
cookies are invalid characters in character [44], so we query ASCII code is 44 said
“, “said 32 Spaces so we only need to replace the value of the corresponding characters, or coding

OpenGL programming error analysis


C :\ Program Files (x86)\ Microsoft Visual Studio 11.0\ VC \ Include \ GL \glew.h 84 1 consoleApplication8
Solution:
#if defined(__gl_h_) || defined(__GL_H__) || defined(__X_GL_H)
#error gl.h included before glew.h

#include <GL/glew.h>
#include <GL/glut.h>

Glew.h is written in front of GLUT.

error
1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol __imp__glewInit@0, which is found in the function “void __cdecl init(void)” (?
1> init @@yaxxz)
1>; ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol __imp__glewGetErrorString@4, which is found in the function “void __cdecl init(void)” (?
1> init @@yaxxz)
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewBindBuffer
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____ glewbufferData
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewGenBuffers
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewAttachShader
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____ glewcompileShader
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewCreateProgram
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewCreateShader
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewDeleteShader
1>; ConsoleApplication8. Obj: error LNK2001: cannot resolve the external symbol of __imp____glewEnableVertexAttribArray
1 & gt; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewGetProgramInfoLog
; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewGetProgramiv
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____ glewgetShaderInfolog
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewGetShaderiv
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewLinkProgram
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewShaderSource
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewUseProgram
1>; ConsoleApplication8.obj: error LNK2001: Unable to parse external symbol __imp____ glewvertexattribute
; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____ glewbindVertexArray
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____ glewGenvertexArrays
Solution:

#pragma comment(lib,"glew32.lib")

Error:

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutInit@8, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutInitDisplayMode@4, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutInitWindowPosition@8, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutInitWindowSize@8, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutMainLoop@0, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutCreateWindow@4, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutSwapBuffers@0, which is displayed in the function “void __cdecl display(void)” (?Display @@yaxxz)

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutDisplayFunc@4, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutKeyboardFunc@4, which is referenced in function _main

Solution:

#pragma comment(lib,"glut32.lib")

error:

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol __imp__glClear@4, which is displayed in the function “void __cdecl display(void)” (?Display @@yaxxz) is referenced in
1> init @@yaxxz)
1>; ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol __imp__glDrawArrays@12, which is displayed in the function “void __cdecl display(void)” (?Display @@yaxxz) is referenced in
1>; ConsoleApplication8.obj: error LNK2019: Unable to resolve external symbol __imp__glGetString@4, which is used in the function “void __cdecl initShader(char const *,char const *)” (?InitShader@@YAXPBD0@Z) is referenced
Solution:

#pragma comment(lib,"OpenGL32.lib")

Configuring OpenGL in Chinese version of VS2010 and problem solving

Under normal circumstances, the need to install first GLUT. Download address: http://www.opengl.org/resources/libraries/glut/glutdlls37beta.zip
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\ GL “
2. Let the glut of decompression. Lib and glut32. Lib in “” Programfiles (x86) 10.0 VC \ \ lib \ Microsoft Visual studio” (ditto)
3.
4.
4.
5.
5.
5.
5.
5.
5.
5. Open VS2010, open any project or create a new one, and be careful to add.c to the file name when creating the CPP file (for example, opengl.c). Under the Solution ->; Right-click item ->; Property – & gt; Configure properties ->; Input – & gt; Add a dependency, where you add opengl32.lib; glu32.lib ; glut32 ;
 
Possible problems:
ERROR LNK1104: Could not open the file ‘opengl32.lib glu32.lib glut32.lib’
1. Note that these files are connected by semicolon, change to opengl32.lib; glu32.lib ; glut32 ;
2. The compiler did not find the path to these files, so you need to manually add: right-click project ->; Property – & gt; VC++ directory, in the include directory and library directory to add the path to store these files.
 
“Stdafx. h” : No such file or directory
1. Verify that the environment configuration is: Properties →C/C++→ Precompiled Header → “No Precompiled Header”.
#include < #include < stdafx.h> In general, except for MFC projects, precompiled headers are not used.
 
 

Vs cannot open the source file unistd. H under Windows

Many C programs developed under Linux require the header file unistd.h, but VC does not have a header file, so compiling with VC always returns an error. This can be solved by saving the following content as unistd.h under the visual stdio header file path.

My path is: C: Program Files (x86)\Microsoft VisualStudio\2017\Community\VC\Tools\MSVC\14.16.27023\ Include

/** This file is part of the Mingw32 package.

unistd.h maps (roughly) to io.h
*/
#ifndef _UNISTD_H
#define _UNISTD_H
#include <io.h>
#include <process.h>
#endif /* _UNISTD_H */

Unistd.h is a header file for Unix system-defined symbolic constants defined by the POSIX standard. It contains many prototype functions for UNIX system services, such as the read function, write function, and getpid function. H in UNIX is similar to Windows.h in Windows.

Flash back after vs compiler running, processing method

How to solve the problem of flash back!!!!!!
I habitually deal with this problem in three ways
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — –
1, system (” pause “);
2, getchar ();
3, Ctrl + F5
Let’s discuss the pros and cons of each separately: Welcome to the land of the Kings
System (” pause “) : need to include the preprocessing header #include< stdlib.h> ||#include< windows.h>
Usage: put return (); Before the return statement, otherwise there is no meaning
Advantages: solve the flashback problem, small side effects
Disadvantages: call system function, large memory overhead

Getchar () :

Usage: put return (); Before the return statement, otherwise there is no meaning
Advantages: low overhead, receive a character to end the program
Cons: Use it on a case-by-case basis, because getchar (); You need to accept a string to represent the end, and some functions explicitly need to accept a string as the return value, if you use getchar (); To solve the flashback problem, which can be confusing and introduce errors when the program is running.
can see, although can solve the running results of the flashback problem, but in the processing is completely different, although in the operation is also approximately the same, but in the memory, CPU and other levels, overhead is sometimes different, so you can choose according to your preferences for a way for you !!!!! System (” pause “) is recommended; This way, the introduction and processing of files is also more careful, if there is a heavy use of system functionality is, of course. windows.h> #include< stdlib.h> Of course, it is suitable for those who use a lot of library functions

 

After the installation of vs2017, we can’t find the source files such as windows. H, stdio. H, etc

1. Problem description:
After the Visual Studio 2017 installation is complete, the source code prompts:
“Could not find source Windows.h”
“Could not find source file stdio.h”
“Could not find source file tchar.h”
The error code is as follows:

2. Causes of the problem:
The Windows 10 SDK for Desktop C++ [x86 and x64] (10.0.16299.0) module was omitted during the installation of VS2017.

3. Problem solving:
(1) Open VisualStudio Installer and click Modify in VisualStudio Installer.
(2) Select a single component;
(3) Check “Windows 10SDK (10.0.16299.0) for Desktop C++ [x86 and x64]” module, check this module will automatically add “Windows 10SDK (10.0.16299.0) for UWP(C ++)” and “Windows 10SDK (10.0.16299.0) for UWP(C#, VB, JS)” module;
(4) Finally click the Modify button to add these modules. Problem solved.

4. The operation process is as follows:






Svn notes: error reporting in use

Error reported during use of SVN
1. The Error while creating module: org. Apache.. Subversion javahl. ClientException: Authorization failed
the SVN: authentication failed
Happened: after start SVN service, for the first time to submit project
solution: modify the configuration files of the storage directory svnserve. Conf, passwd, authz:
the first one to open the anonymous access. Modify the svnserve.conf file and change the anon-access value to write
.
modify svnserve.conf file:
en auth-access = write, password-db = passwd, authz-db = authz and set anon-access to none(otherwise error 5 will be reported)
m>y the passwd file:
add user username = password in the form of a

modify authz file: to add

set the permissions on the combination of operation such as:
[/] #
aifa = rw #
@kaifa = rw #
cesh>r # Read-Only
* = #
4
[/] # <>> @kaifa = rw #
ceshi = r # Read-Only
* = #
2. The Filesystem has no item SVN: URL ‘SVN:// localhost/OA/DesignPattern’ non – existent in revision 2

solution:
en this error occurs, we can find what symbol is on the project?And *, we just need to right-click, submit the project again,
and put it into the repository

3. SVN: E200009: Submission failed (details below):
SVN: E200009: “F:\workspace\SVN\SpaceJohnnie\OA\ hello.txt” is not under version control

F:\workspace\SVN\SpaceJohnnie\OA> SVN commit hello.txt
SVN commit hello.txt
br> SVN commit hello.txt

4. SVN: E205007: Commit failed (details below):
SVN: E205007: Unable to get log information using external editor; Consider setting the environment variable $SVN_EDITOR, or
with the –message (-m) or –file (-f) options
n: E205007: No SVN_EDITOR, VISUAL or EDITOR environment variables are set, and
h>o “editor-cmd” option in the runtime configuration parameters

SVN commit hello.txt
br> s>ommit -m “First commit” hello.txt

>commit -m “First commit” hello.txt
5.Item is not readable
SVN: encountered an unreadable path; Access denied.
happened: an error occurred when
access configuration, the anonymous access is not a value to none, namely: anon – access = none
solution:
modify svnserve. Conf file Settings anon – access = none

Python error: typeerror: ‘Int’ object is not subscriptable

Check the line where the error is reported, which is usually an integer with a subscript:
Such as:

a = 4
c=a[2]

Error: line 2, in <; module>
c = a [2]
TypeError: ‘int’ object is not subscriptable
Or a more complicated one: two dimensions
 

a = [1,2,3,4]
c=a[2][2]

It’s a one-dimensional array, but you take an array and then you subscript it, same problem.

Hash conflict and four solutions

The cause of the hash conflict
Hashing is a solution to improve efficiency by recompressing data. However, because the hash value generated by the hash function is limited and the data may be more, there are still different data corresponding to the same value after processing by the hash function. This is where you have a hash conflict.
The influencing factors of hash conflict
Load factor (load factor = total number of data/hash table length), hash function, method of handling conflicts
Four ways to resolve hash conflicts
1. Open the address method
(1) Linear detection
When determining values sequentially, if a value for a piece of data already exists, one unit is added to the original value until no hash collisions occur.
(2) Ressquare detection
In order to determine the values, if the value of some data already exists, the original value is first added to the square of 1 units, if still exists, then subtracted 1 square units. It’s going to be 2 squared, 3 squared and so on. Until there is no hash conflict.
(3) Pseudo-random detection
When determining values in order, if some data already exists, a random number is generated by a random function, and the random number is added on the basis of the original value until there is no hash conflict.
2. Chain address method (HashMap hash resolution method)
For the same values, join using a linked list. Use an array to store each list.
Advantages:
(1) The zipper method is simple to deal with conflicts and has no accumulation phenomenon, that is, non-synonyms will never conflict, so the average search length is short;
(2) Because the node space of each linked list in the zipper method is dynamically applied, it is more suitable for the situation that the length of the table cannot be determined before making the table;
(3) In order to reduce conflicts, the open addressing method requires a small loading factor α, so a lot of space will be wasted when the node size is large. In the zipper method, α≥1 is desirable, and when the node is large, the added pointer domain in the zipper method can be ignored, so space is saved.
(4) In the hash table constructed by zipper method, the operation of deleting nodes is easy to realize. Simply delete the corresponding node on the linked list.
faults:
Pointers occupying a large space will cause a waste of space. If the space is used to increase the size of the hash table, the efficiency of the open address method will be improved.
3. Establish a public overflow area
Set up a common overflow area to store all hash conflicting data.
4. Re-hashing
The hash value of the conflict is hashed again until there is no hash conflict.