This paper considers optimal synthesis of a four-bar linkage by method of controlled deviations. The advantage of this approximate method is that it allows control of motion of the coupler in the four-bar linkage so that the path of the coupler is in the prescribed environment around the given path on the segment observed. The Hooke-Jeeves’s optimization algorithm has been used in the optimization process. Calculation expressions are not used as the method of direct searching, i.e. individual comparison of the calculated value of the objective function is made in each iteration and the moving is done in the direction of decreasing the value of the objective function. This algorithm does not depend on the initial selection of the projected variables. All this is illustrated on an example of synthesis of a four-bar linkage whose coupler point traces a straight line, i.e. passes through sixteen prescribed points lying on one straight line.